gpucheck-cli 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gpucheck/__init__.py +1 -0
- gpucheck/adapter.py +192 -0
- gpucheck/cli.py +237 -0
- gpucheck/diagnose.py +203 -0
- gpucheck/fakes.py +140 -0
- gpucheck/load.py +126 -0
- gpucheck/metrics.py +116 -0
- gpucheck/preflight.py +95 -0
- gpucheck/report.py +101 -0
- gpucheck/resultjson.py +75 -0
- gpucheck/run.py +155 -0
- gpucheck/specs.py +59 -0
- gpucheck/upload.py +95 -0
- gpucheck_cli-0.1.0.dist-info/METADATA +122 -0
- gpucheck_cli-0.1.0.dist-info/RECORD +18 -0
- gpucheck_cli-0.1.0.dist-info/WHEEL +4 -0
- gpucheck_cli-0.1.0.dist-info/entry_points.txt +3 -0
- gpucheck_cli-0.1.0.dist-info/licenses/LICENSE +177 -0
gpucheck/run.py
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"""Run engine: preflight, baseline phase, load phase, with a safety watchdog.
|
|
2
|
+
|
|
3
|
+
Time is driven by this module's own schedule: every iteration calls
|
|
4
|
+
adapter.sample() once, then sleeps until the next 1/hz slot (measured with the
|
|
5
|
+
injected clock). Sample timestamps (t_s) come from the adapter. A sample() that
|
|
6
|
+
raises is recorded as an all-None sample whose t_s is the previous sample's t_s
|
|
7
|
+
plus 1/hz (0.0 if there is none yet), so the series stays evenly spaced.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import time
|
|
13
|
+
from collections.abc import Callable
|
|
14
|
+
from dataclasses import dataclass, replace
|
|
15
|
+
from typing import Protocol
|
|
16
|
+
|
|
17
|
+
from .adapter import GpuInventory, TelemetryAdapter, TelemetrySample
|
|
18
|
+
from .preflight import Preflight, run_preflight
|
|
19
|
+
from .specs import GpuSpec
|
|
20
|
+
|
|
21
|
+
THERMAL_MARGIN_C = 5.0
|
|
22
|
+
UNKNOWN_GPU_THERMAL_LIMIT_C = 95.0 # abort limit when the model is not in the spec table
|
|
23
|
+
THERMAL_CONSECUTIVE = 3
|
|
24
|
+
ECC_JUMP = 100
|
|
25
|
+
MAX_CONSECUTIVE_SAMPLE_ERRORS = 10
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@dataclass(frozen=True)
|
|
29
|
+
class RunConfig:
|
|
30
|
+
baseline_s: float = 60
|
|
31
|
+
load_s: float = 600
|
|
32
|
+
hz: float = 1.0
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class LoadGenerator(Protocol):
|
|
36
|
+
def start(self) -> None: ...
|
|
37
|
+
|
|
38
|
+
def tick(self) -> float | None: ...
|
|
39
|
+
|
|
40
|
+
def stop(self) -> None: ...
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class NullLoad:
|
|
44
|
+
def start(self) -> None:
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
def tick(self) -> float | None:
|
|
48
|
+
return None
|
|
49
|
+
|
|
50
|
+
def stop(self) -> None:
|
|
51
|
+
pass
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@dataclass(frozen=True)
|
|
55
|
+
class RawRun:
|
|
56
|
+
inventory: GpuInventory
|
|
57
|
+
preflight: Preflight
|
|
58
|
+
baseline: list[TelemetrySample]
|
|
59
|
+
load: list[TelemetrySample]
|
|
60
|
+
config: RunConfig
|
|
61
|
+
aborted: str | None
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class _Watchdog:
|
|
65
|
+
def __init__(self, spec: GpuSpec | None) -> None:
|
|
66
|
+
self._limit = spec.max_temp_c + THERMAL_MARGIN_C if spec is not None else UNKNOWN_GPU_THERMAL_LIMIT_C
|
|
67
|
+
self._hot = 0
|
|
68
|
+
self._last_ecc: int | None = None
|
|
69
|
+
|
|
70
|
+
def check(self, s: TelemetrySample) -> str | None:
|
|
71
|
+
if s.temp_c is not None and s.temp_c >= self._limit:
|
|
72
|
+
self._hot += 1
|
|
73
|
+
if self._hot >= THERMAL_CONSECUTIVE:
|
|
74
|
+
return "thermal"
|
|
75
|
+
else:
|
|
76
|
+
self._hot = 0
|
|
77
|
+
if s.ecc_volatile is not None:
|
|
78
|
+
if self._last_ecc is not None and s.ecc_volatile - self._last_ecc > ECC_JUMP:
|
|
79
|
+
return "ecc"
|
|
80
|
+
self._last_ecc = s.ecc_volatile
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _empty_sample(t_s: float) -> TelemetrySample:
|
|
85
|
+
return TelemetrySample(
|
|
86
|
+
t_s=t_s,
|
|
87
|
+
temp_c=None,
|
|
88
|
+
power_w=None,
|
|
89
|
+
sm_clock_mhz=None,
|
|
90
|
+
fan_pct=None,
|
|
91
|
+
throttle_reasons=None, # unknown, not "no throttling"
|
|
92
|
+
ecc_volatile=None,
|
|
93
|
+
achieved_tflops=None,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def execute_run(
|
|
98
|
+
adapter: TelemetryAdapter,
|
|
99
|
+
load: LoadGenerator,
|
|
100
|
+
config: RunConfig,
|
|
101
|
+
spec: GpuSpec | None,
|
|
102
|
+
*,
|
|
103
|
+
clock: Callable[[], float] = time.monotonic,
|
|
104
|
+
sleep: Callable[[float], None] = time.sleep,
|
|
105
|
+
) -> RawRun:
|
|
106
|
+
inventory = adapter.inventory()
|
|
107
|
+
preflight = run_preflight(adapter)
|
|
108
|
+
baseline: list[TelemetrySample] = []
|
|
109
|
+
loaded: list[TelemetrySample] = []
|
|
110
|
+
period = 1.0 / config.hz
|
|
111
|
+
state = {"last_t": None, "errors": 0}
|
|
112
|
+
|
|
113
|
+
def result(aborted: str | None) -> RawRun:
|
|
114
|
+
return RawRun(inventory, preflight, baseline, loaded, config, aborted)
|
|
115
|
+
|
|
116
|
+
if preflight.mode == "refuse":
|
|
117
|
+
return result("preflight_refused")
|
|
118
|
+
|
|
119
|
+
def take() -> TelemetrySample:
|
|
120
|
+
"""One sample, or an all-None one if the adapter raised."""
|
|
121
|
+
try:
|
|
122
|
+
s = adapter.sample()
|
|
123
|
+
state["errors"] = 0
|
|
124
|
+
except Exception:
|
|
125
|
+
state["errors"] += 1
|
|
126
|
+
last = state["last_t"]
|
|
127
|
+
s = _empty_sample(0.0 if last is None else last + period)
|
|
128
|
+
state["last_t"] = s.t_s
|
|
129
|
+
return s
|
|
130
|
+
|
|
131
|
+
def phase(count: int, out: list[TelemetrySample], watchdog: _Watchdog | None, tick: bool) -> str | None:
|
|
132
|
+
start = clock()
|
|
133
|
+
for i in range(count):
|
|
134
|
+
s = take()
|
|
135
|
+
if tick:
|
|
136
|
+
tflops = load.tick()
|
|
137
|
+
if tflops is not None:
|
|
138
|
+
s = replace(s, achieved_tflops=tflops)
|
|
139
|
+
out.append(s)
|
|
140
|
+
if watchdog is not None and (reason := watchdog.check(s)):
|
|
141
|
+
return reason
|
|
142
|
+
if state["errors"] >= MAX_CONSECUTIVE_SAMPLE_ERRORS:
|
|
143
|
+
return "telemetry"
|
|
144
|
+
sleep(max(0.0, start + (i + 1) * period - clock()))
|
|
145
|
+
return None
|
|
146
|
+
|
|
147
|
+
aborted = phase(round(config.baseline_s * config.hz), baseline, None, tick=False)
|
|
148
|
+
if aborted:
|
|
149
|
+
return result(aborted)
|
|
150
|
+
try:
|
|
151
|
+
load.start()
|
|
152
|
+
aborted = phase(round(config.load_s * config.hz), loaded, _Watchdog(spec), tick=True)
|
|
153
|
+
finally:
|
|
154
|
+
load.stop()
|
|
155
|
+
return result(aborted)
|
gpucheck/specs.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""Bundled published GPU specs and name-based lookup.
|
|
2
|
+
|
|
3
|
+
Values are the v1 seed set (SXM/PCIe split). Each row is pinned by the plan and
|
|
4
|
+
must be verified against the NVIDIA datasheet before launch.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import re
|
|
10
|
+
from dataclasses import dataclass
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(frozen=True)
|
|
14
|
+
class GpuSpec:
|
|
15
|
+
key: str
|
|
16
|
+
tdp_w: float
|
|
17
|
+
peak_bf16_tflops: float
|
|
18
|
+
max_temp_c: float
|
|
19
|
+
boost_clock_mhz: float
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
_SPECS: dict[str, GpuSpec] = {
|
|
23
|
+
s.key: s
|
|
24
|
+
for s in (
|
|
25
|
+
GpuSpec("rtx-4090", 450.0, 165.2, 90.0, 2520.0), # pinned by plan; verify against datasheet before launch
|
|
26
|
+
GpuSpec("rtx-3090", 350.0, 71.0, 93.0, 1695.0), # pinned by plan; verify against datasheet before launch
|
|
27
|
+
GpuSpec("a100-80gb-sxm", 400.0, 312.0, 85.0, 1410.0), # pinned by plan; verify against datasheet before launch
|
|
28
|
+
GpuSpec("a100-80gb-pcie", 300.0, 312.0, 85.0, 1410.0), # pinned by plan; verify against datasheet before launch
|
|
29
|
+
GpuSpec("h100-sxm", 700.0, 989.0, 83.0, 1980.0), # pinned by plan; verify against datasheet before launch
|
|
30
|
+
GpuSpec("h100-pcie", 350.0, 756.0, 83.0, 1755.0), # pinned by plan; verify against datasheet before launch
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
# "3090" or "4090" as a standalone number, not followed by "ti" (Ti variants are not in the table).
|
|
35
|
+
_RTX_3090 = re.compile(r"(?<!\d)3090(?!\d|ti)")
|
|
36
|
+
_RTX_4090 = re.compile(r"(?<!\d)4090(?!\d|ti)")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def lookup(model_name: str) -> GpuSpec | None:
|
|
40
|
+
"""Return the bundled spec matching an NVML-style model name, or None.
|
|
41
|
+
|
|
42
|
+
Matching is case- and whitespace-insensitive.
|
|
43
|
+
"""
|
|
44
|
+
s = "".join(model_name.lower().split())
|
|
45
|
+
if "nvl" in s: # NVL parts (H100/A100/RTX NVL) are not in the v1 table; never silently match
|
|
46
|
+
return None
|
|
47
|
+
if "h100" in s:
|
|
48
|
+
return _SPECS["h100-pcie"] if "pcie" in s else _SPECS["h100-sxm"]
|
|
49
|
+
if "a100" in s:
|
|
50
|
+
if "pcie" in s:
|
|
51
|
+
return _SPECS["a100-80gb-pcie"]
|
|
52
|
+
if "80gb" in s:
|
|
53
|
+
return _SPECS["a100-80gb-sxm"]
|
|
54
|
+
return None
|
|
55
|
+
if _RTX_4090.search(s):
|
|
56
|
+
return _SPECS["rtx-4090"]
|
|
57
|
+
if _RTX_3090.search(s):
|
|
58
|
+
return _SPECS["rtx-3090"]
|
|
59
|
+
return None
|
gpucheck/upload.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"""Opt-in upload client (stdlib only). Never raises: failures become UploadOutcome(ok=False)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import urllib.error
|
|
7
|
+
import urllib.request
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
|
|
10
|
+
from .resultjson import canonical_dumps, run_id
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(frozen=True)
|
|
14
|
+
class UploadOutcome:
|
|
15
|
+
ok: bool
|
|
16
|
+
url: str | None
|
|
17
|
+
grade: dict | None
|
|
18
|
+
delete_token: str | None
|
|
19
|
+
error: str | None
|
|
20
|
+
n: int | None = None
|
|
21
|
+
reason: str | None = None # server's explanation when grade is None
|
|
22
|
+
certifiable: bool | None = None # server's verdict on a --certify upload (None: not said)
|
|
23
|
+
certify_note: str | None = None # why the server refused to certify
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _fail(e: BaseException) -> UploadOutcome:
|
|
27
|
+
msg = " ".join(f"{type(e).__name__}: {e}".split())
|
|
28
|
+
return UploadOutcome(False, None, None, None, msg)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ChallengeUnavailable(Exception):
|
|
32
|
+
"""The server could not issue a certification challenge."""
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def fetch_challenge(server: str, timeout_s: float = 20) -> dict:
|
|
36
|
+
"""POST /v1/challenges; raises ChallengeUnavailable with a one-line message."""
|
|
37
|
+
try:
|
|
38
|
+
req = urllib.request.Request(
|
|
39
|
+
f"{server.rstrip('/')}/v1/challenges",
|
|
40
|
+
data=b"{}",
|
|
41
|
+
method="POST",
|
|
42
|
+
headers={"Content-Type": "application/json"},
|
|
43
|
+
)
|
|
44
|
+
with urllib.request.urlopen(req, timeout=timeout_s) as resp:
|
|
45
|
+
body = json.loads(resp.read().decode())
|
|
46
|
+
if not isinstance(body, dict) or not isinstance(body.get("workload"), dict):
|
|
47
|
+
raise ValueError("unexpected challenge response shape")
|
|
48
|
+
for k in ("challenge_id", "nonce"):
|
|
49
|
+
if not isinstance(body.get(k), str):
|
|
50
|
+
raise ValueError(f"challenge missing {k}")
|
|
51
|
+
w = body["workload"]
|
|
52
|
+
offs = w.get("gemm_n_offsets")
|
|
53
|
+
if (
|
|
54
|
+
not isinstance(offs, list)
|
|
55
|
+
or not offs
|
|
56
|
+
or not all(type(o) is int for o in offs) # type() rejects bools
|
|
57
|
+
or type(w.get("order_seed")) is not int
|
|
58
|
+
):
|
|
59
|
+
raise ValueError("challenge workload malformed")
|
|
60
|
+
return body
|
|
61
|
+
except urllib.error.HTTPError as e:
|
|
62
|
+
if e.code == 404:
|
|
63
|
+
raise ChallengeUnavailable("server has certification disabled") from e
|
|
64
|
+
raise ChallengeUnavailable(f"challenge request failed (HTTP {e.code})") from e
|
|
65
|
+
except Exception as e: # noqa: BLE001
|
|
66
|
+
msg = " ".join(f"{type(e).__name__}: {e}".split())
|
|
67
|
+
raise ChallengeUnavailable(f"could not fetch challenge ({msg})") from e
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def upload(result: dict, server: str, timeout_s: float = 20) -> UploadOutcome:
|
|
71
|
+
try:
|
|
72
|
+
req = urllib.request.Request(
|
|
73
|
+
f"{server.rstrip('/')}/v1/runs",
|
|
74
|
+
data=canonical_dumps(result).encode(),
|
|
75
|
+
method="POST",
|
|
76
|
+
headers={"Content-Type": "application/json", "X-Run-Id": run_id(result)},
|
|
77
|
+
)
|
|
78
|
+
with urllib.request.urlopen(req, timeout=timeout_s) as resp:
|
|
79
|
+
body = json.loads(resp.read().decode())
|
|
80
|
+
if not isinstance(body, dict):
|
|
81
|
+
raise ValueError("unexpected response shape")
|
|
82
|
+
grade = body.get("grade")
|
|
83
|
+
return UploadOutcome(
|
|
84
|
+
True,
|
|
85
|
+
body.get("url"),
|
|
86
|
+
grade if isinstance(grade, dict) else None,
|
|
87
|
+
body.get("delete_token"),
|
|
88
|
+
None,
|
|
89
|
+
body.get("n") if isinstance(body.get("n"), int) else None,
|
|
90
|
+
body.get("reason") if isinstance(body.get("reason"), str) else None,
|
|
91
|
+
body.get("certifiable") if isinstance(body.get("certifiable"), bool) else None,
|
|
92
|
+
body.get("certify_note") if isinstance(body.get("certify_note"), str) else None,
|
|
93
|
+
)
|
|
94
|
+
except Exception as e: # noqa: BLE001 - upload must never break the local run
|
|
95
|
+
return _fail(e)
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gpucheck-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Open-source CLI that health-checks NVIDIA GPUs
|
|
5
|
+
Author: narekkeshishyan
|
|
6
|
+
Author-email: narekkeshishyan <keshishyan01@gmail.com>
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: pynvml
|
|
10
|
+
Requires-Dist: torch ; extra == 'load'
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Project-URL: Homepage, https://gpucheck.dev
|
|
13
|
+
Project-URL: Repository, https://github.com/narek-keshishyan/gpucheck
|
|
14
|
+
Provides-Extra: load
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# gpucheck
|
|
18
|
+
|
|
19
|
+
One command that stress-tests an NVIDIA GPU and tells you whether it is healthy, throttling, or degraded.
|
|
20
|
+
|
|
21
|
+
Website: [gpucheck.dev](https://gpucheck.dev) — includes the optional $29 signed certificate for used-GPU listings.
|
|
22
|
+
|
|
23
|
+
It records a short idle baseline, runs a sustained matrix-multiply load, and samples temperature, clocks, power, and throttle reasons the whole time. It then explains what it saw in plain language: thermal throttling, power-limit throttling, memory problems, or throughput well below what that model should deliver.
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
uvx --from "gpucheck-cli[load]" gpucheck --quick
|
|
29
|
+
# or
|
|
30
|
+
pip install "gpucheck-cli[load]"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The load generator needs PyTorch with CUDA. It is an optional extra (`[load]`) because torch is large; if you already have a CUDA build of torch installed, plain `pip install gpucheck-cli` is enough. (The PyPI package is `gpucheck-cli`; the installed command is `gpucheck`.) Without torch/CUDA the tool still runs but generates no load (it prints a warning), so performance metrics are left blank.
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
gpucheck # standard run: 60 s baseline, 10 min load
|
|
39
|
+
gpucheck --quick # 30 s baseline, 150 s load
|
|
40
|
+
gpucheck --long # 60 s baseline, 30 min load
|
|
41
|
+
gpucheck --offline # never contacts a server
|
|
42
|
+
gpucheck --dry-run # print exactly what would be uploaded, upload nothing
|
|
43
|
+
gpucheck --yes-upload # upload without the prompt
|
|
44
|
+
gpucheck --server URL # upload server (http or https); default https://gpucheck-api.fly.dev
|
|
45
|
+
gpucheck --json PATH # where to write result.json (default ./gpucheck-result.json)
|
|
46
|
+
gpucheck --certify # use a one-time server challenge so the result can earn a certificate
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The result is always written locally to `result.json` first. The tool only reads from the GPU; it does not change any settings. Ctrl-C stops a run at any time; an interrupted run writes no result.json and uploads nothing.
|
|
50
|
+
|
|
51
|
+
### Upload flow
|
|
52
|
+
|
|
53
|
+
After a run, unless you passed `--offline`, gpucheck asks whether to upload (to `https://gpucheck-api.fly.dev` unless you pass `--server URL`). If you say yes you get a result page URL, a grade such as `Grade B — delivers 94.1% of a healthy <model> (n=12, low confidence)` (or the reason there is none, for example "insufficient reference (n=X)" while too few comparable runs exist, or "measurements only" for MIG), and a delete token. Save the token: it is the only way to delete the page later.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
curl -X DELETE -H "X-Delete-Token: <token>" <server>/v1/runs/<run_id>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## What gets uploaded
|
|
60
|
+
|
|
61
|
+
Nothing, unless you opt in. Uploading is off in non-interactive shells unless you pass `--yes-upload`. `--dry-run` prints the exact payload so you can read it first.
|
|
62
|
+
|
|
63
|
+
The payload is the contents of `result.json`: GPU model and driver details, measurements, findings, and the time series of samples. The GPU identifier is replaced by a salted-hash UUID, so the raw serial is never sent. The salt is a public constant in this source code, so anyone who already knows your GPU's UUID can recompute the hash and recognise your card.
|
|
64
|
+
|
|
65
|
+
Result pages are public to anyone with the link, and the server also serves back the full uploaded JSON (every field above, including the sample time series) at `/v1/runs/<run_id>`. The run ID is derived from the content, and the server returns a delete token (stored only as a hash) that lets you remove your page.
|
|
66
|
+
|
|
67
|
+
## Certificates (`--certify`)
|
|
68
|
+
|
|
69
|
+
`gpucheck --certify` asks the server for a one-time challenge, runs the workload the server prescribes (a set of matrix sizes and an execution order) instead of the default one, and uploads the result with the challenge attached. If the run qualifies, the result page offers a signed certificate for it. Certifying a run is a separate purchase, made on the result page.
|
|
70
|
+
|
|
71
|
+
What you need:
|
|
72
|
+
|
|
73
|
+
- A server that has certification turned on. The default server is `https://gpucheck-api.fly.dev`; pass `--server URL` for another one. If the challenge cannot be fetched (the server has certification turned off, or cannot be reached), gpucheck stops before the run with a message and exit code 1.
|
|
74
|
+
- Working PyTorch with CUDA. Without it, `--certify` stops with exit code 1 instead of falling back to a run with no load.
|
|
75
|
+
- The normal upload prompt still applies. A certificate can only be made from an uploaded result, so answer yes, or pass `--yes-upload` in a script.
|
|
76
|
+
|
|
77
|
+
`--certify` cannot be combined with `--offline`, `--dry-run`, or `--quick`; the argument parser rejects the combination at startup. Certificates need a full-length run (at least 600 s of load), so a quick run could never earn one.
|
|
78
|
+
|
|
79
|
+
If the challenge expires before the run finishes (challenges are valid for 2 hours), gpucheck prints one warning, `challenge expired before upload; run again to certify — result saved locally`, does not upload, and exits normally. The result is still written to the `--json` path.
|
|
80
|
+
|
|
81
|
+
Fake mode: `--fake` with `--certify` runs mechanically, but a real server rejects it with "upload arrived too soon after challenge", because the simulated run finishes instantly. This is intended: fakes cannot earn certificates.
|
|
82
|
+
|
|
83
|
+
After a `--certify` upload, gpucheck prints the server's verdict: `Certifiable: yes`, or `Not certifiable: <reason>` with the reason the server gave (`certify_note`). If the server refuses to certify a run, the upload still succeeds and the result is still stored; the run simply gets no purchase button. A certifiable run also needs a grade, a complete (not aborted, not quarantined) load phase, and a card identity before the result page offers a certificate.
|
|
84
|
+
|
|
85
|
+
### What a certificate proves
|
|
86
|
+
|
|
87
|
+
A certificate raises the cost of lying about a GPU. It is not proof of anything on its own.
|
|
88
|
+
|
|
89
|
+
- The run used a fresh one-time server challenge and could not be uploaded before the full run time had passed. The uploaded result echoes the challenge's workload parameters, but the server cannot see whether that workload actually ran.
|
|
90
|
+
- The signed payload binds that certificate to one stored result (by its SHA-256), one card (its salted-hash identifier, the same one in the uploaded result), one grade, and one run.
|
|
91
|
+
- Certificates issued while the server is in payment test mode carry a TEST banner and `livemode: false` in the signed payload. They are not real purchases.
|
|
92
|
+
|
|
93
|
+
### What a certificate does not prove
|
|
94
|
+
|
|
95
|
+
- It does not show that the card is healthy or will stay healthy. A single run is a snapshot, as described under Limitations.
|
|
96
|
+
- It does not stop someone who controls the machine. Someone with full control can fabricate telemetry that matches the prescribed workload and timing. The server cannot see the hardware directly.
|
|
97
|
+
- It does not stop re-running. A card owner can keep running until a run looks good and then buy a certificate for that one. When a newer certificate is issued for the same card, the older one is marked as superseded, which makes this visible, but it is not prevented.
|
|
98
|
+
- Revocation is not part of the signature. A revoked certificate still verifies offline; only the live verify endpoint knows about revocation.
|
|
99
|
+
|
|
100
|
+
Verifying a certificate offline needs the certificate payload, its signature, and the public key from `/v1/pubkey`. The exact steps and a one-line Python check are on the server's `/verify` page and in the server's README.
|
|
101
|
+
|
|
102
|
+
## Exit codes
|
|
103
|
+
|
|
104
|
+
| Code | Meaning |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| 0 | Run completed |
|
|
107
|
+
| 1 | Preflight refused to run (for example the GPU is busy) |
|
|
108
|
+
| 2 | No NVIDIA GPU or driver available |
|
|
109
|
+
| 3 | Run aborted partway (thermal limit, ECC errors, or lost telemetry); result.json is still written |
|
|
110
|
+
|
|
111
|
+
## Limitations
|
|
112
|
+
|
|
113
|
+
- NVIDIA GPUs on Linux only.
|
|
114
|
+
- MIG instances give measurements only; they are not graded.
|
|
115
|
+
- Needs PyTorch with CUDA to generate load; without it, performance numbers are blank.
|
|
116
|
+
- It refuses to run on a GPU that is already busy.
|
|
117
|
+
- Grades depend on a reference set of comparable runs; for new or rare models you will see "insufficient reference".
|
|
118
|
+
- A single run is a snapshot. A healthy result does not guarantee the card will never fail.
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
Apache-2.0
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
gpucheck/__init__.py,sha256=a1DhEHgibDOB2JTiR86AaGG-Y4hPiN3h0LY9EsGoKAQ,42
|
|
2
|
+
gpucheck/adapter.py,sha256=lhtvwJFK0225dGGoc6vQbCGLuyzjSz8Ec5RRR6SQmLo,7147
|
|
3
|
+
gpucheck/cli.py,sha256=6nQ2wdKQNqAvfJLUpUyYWoyzAGxejC95sVaYd8bvHe4,9149
|
|
4
|
+
gpucheck/diagnose.py,sha256=dIXk19ouGY1R3WVmMfmiwTHjq4PSVj3IIi2AyeRhc4s,7118
|
|
5
|
+
gpucheck/fakes.py,sha256=v1r-IMPyrmpm4pFVgIPbcxIWweKehfNGKeFY3nSLSd4,4065
|
|
6
|
+
gpucheck/load.py,sha256=2nQChYhKlKd4zirx5BXGegBnv4KjfPlivnAmENesABk,4812
|
|
7
|
+
gpucheck/metrics.py,sha256=44OE_P-szAlhty_v8tQpOGG08Cs-e-lHaKk3ITcjVcE,3491
|
|
8
|
+
gpucheck/preflight.py,sha256=BGnHsuzh2LQpTXLWOem3GarsOeJddEUD036G7v6QmYs,3353
|
|
9
|
+
gpucheck/report.py,sha256=phS-H8ocGgRYYdO4qPdyMkFd2n5nvHB6JmNR88gPuPI,3645
|
|
10
|
+
gpucheck/resultjson.py,sha256=4ISOQaPyw6-WLo8BHl9KjI_lJniQcgFPXa5mL3TmF1g,2413
|
|
11
|
+
gpucheck/run.py,sha256=reV-ZMfL-4h1d0upGInWc1WwXoykbksEi1qyNqm9Iqc,4665
|
|
12
|
+
gpucheck/specs.py,sha256=THpmuhsHhjGHng9zpfaZTlDD5eCUrepuDctQWBPJZ8o,2150
|
|
13
|
+
gpucheck/upload.py,sha256=LJnruD5dpmK6wqXbRVvbG4FdHHXFQXDI3uLOD_cfAPc,3773
|
|
14
|
+
gpucheck_cli-0.1.0.dist-info/licenses/LICENSE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
|
|
15
|
+
gpucheck_cli-0.1.0.dist-info/WHEEL,sha256=s_zqWxHFEH8b58BCtf46hFCqPaISurdB9R1XJ8za6XI,80
|
|
16
|
+
gpucheck_cli-0.1.0.dist-info/entry_points.txt,sha256=qv4fBcVrYZ7U_LQ2SKo5n7thDyKP1KV5uWFaN8vH92U,48
|
|
17
|
+
gpucheck_cli-0.1.0.dist-info/METADATA,sha256=htoScVW8j5oRlCOACh2cciZ5YDW1sS61_laBGWygUd8,8570
|
|
18
|
+
gpucheck_cli-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|