Record CUDA benchmark diagnostics

This commit is contained in:
Dobromir Popov
2026-07-01 10:57:44 +02:00
parent c4a63d9461
commit 2d833432bc
4 changed files with 88 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ from pathlib import Path
from typing import Any
from .downloader import compute_shard_checksum, download_shard
from .hardware import detect_hardware, benchmark_throughput
from .hardware import detect_hardware, benchmark_throughput_checked
from .relay_bridge import RelayHttpBridge, peer_id_from_wallet
from .server import StubNodeServer
from .torch_server import TorchNodeServer
@@ -386,7 +386,18 @@ def run_startup(
print(f" Memory budget: {memory_budget_mb / 1024:.1f} GB {memory_budget_source}", flush=True)
print("Benchmarking compute...", flush=True)
bench_tps = benchmark_throughput(device)
if device != "cuda" and gpu_name:
_cuda_score, cuda_ok, cuda_error = benchmark_throughput_checked("cuda")
hw["cuda_benchmark_ok"] = cuda_ok
if cuda_error:
hw["cuda_benchmark_error"] = cuda_error
if not cuda_ok:
print(f" CUDA benchmark unavailable: {cuda_error}; using CPU benchmark", flush=True)
bench_tps, bench_ok, bench_error = benchmark_throughput_checked(device)
hw["benchmark_device"] = device
hw["benchmark_ok"] = bench_ok
if bench_error:
hw["benchmark_error"] = bench_error
device_label = "GPU" if device == "cuda" else "CPU"
print(f" {device_label} throughput index: {bench_tps:,.0f}", flush=True)