Run the same checks on Linux that the Windows scripts run
The product could only reach a GPU through one hard-coded route: `wsl.exe -d Ubuntu`, a device named "RTX 4090", and launch scripts that existed only as PowerShell. On this machine `WSL_DISTRO_NAME` is already set, so the local shell is Linux and the wsl.exe hop was unnecessary; on any other Linux host it is impossible. Every SGLang, vLLM and KTransformers profile was reported "missing" here even with a working 4090. profiles.py now asks the host what it is instead of assuming: `uses_wsl()` is false inside WSL and only true when wsl.exe is actually on PATH, `host_shell()` runs `bash -lc` directly or through `wsl.exe -d settings.wsl_distro`, `gpu_available()` replaced `wsl_gpu_available()`, and `launch_script()` picks the .sh twin on a Linux host and the .ps1 on a Windows one. The schema field `wsl_gpu` became `gpu_available` because the old name lied on Linux. Training no longer fails on a card name. `cuda_bf16_training()` gates on cuda_available plus bf16_supported, which the training environment already records, so an RTX 5090 or a 4080 passes and a non-BF16 4090 still fails. Fourteen .sh twins cover the six launch profiles plus install, verify, serve, download and finetune; the six WSL-hopping .ps1 files read ELY_EYE_WSL_DISTRO instead of Ubuntu. PowerShell parsing is not verified here because no pwsh exists on this host. ci.yml runs pytest, ruff, go build/vet/test/gofmt, the Vite build and a docker build-plus-curl on every push. To make that lint gate mean anything, the 17 pre-existing ruff findings across backend/src are cleared: 14 mechanical fixes plus three probe handlers that now name the failure families they absorb (OSError, SubprocessError, ValueError) instead of catching Exception. Verification: pytest 239 passed; ruff check backend/src bench clean (17 at HEAD); mypy on the 12 touched files 14 errors, identical at HEAD; pyright on the same files 8 errors, identical at HEAD; bash -n clean on all 15 .sh.
This commit is contained in:
1 parent
36f40c4c59
commit
922d01202f
34 files changed
+482
-88
No files matched your search
@@ -24,6 +24,11 @@ from ..training import (
|
||||
)
|
||||
|
||||
|
||||
def cuda_bf16_training(environment: dict[str, Any]) -> bool:
|
||||
"""The requirement is CUDA plus BF16 support, not one card name written down in 2025."""
|
||||
return bool(environment.get("cuda_available")) and bool(environment.get("bf16_supported"))
|
||||
|
||||
|
||||
def count_safetensor_keys(path: Path) -> int:
|
||||
return int(safetensor_weight_stats(path)["tensor_count"])
|
||||
|
||||
@@ -173,8 +178,7 @@ def validate_training_trace(manifest: AdapterManifest, adapter_root: Path) -> di
|
||||
}
|
||||
)
|
||||
environment = summary.get("environment") if isinstance(summary.get("environment"), dict) else {}
|
||||
device_name = str(environment.get("device_name") or "")
|
||||
report["cuda_training"] = bool(environment.get("cuda_available")) and "RTX 4090" in device_name
|
||||
report["cuda_training"] = cuda_bf16_training(environment)
|
||||
report["bf16_supported"] = bool(environment.get("bf16_supported"))
|
||||
report["valid"] = (
|
||||
report["trace_sha256_ok"]
|
||||
@@ -282,11 +286,7 @@ def validate_training_proof(manifest: AdapterManifest, adapter_root: Path) -> di
|
||||
and int(proof_weight_stats.get("nonzero_elements") or 0) > 0
|
||||
and bool(proof_weight_stats.get("all_finite"))
|
||||
),
|
||||
"proof_cuda_bf16": (
|
||||
bool(proof.get("bf16"))
|
||||
and bool(proof_environment.get("cuda_available"))
|
||||
and "RTX 4090" in str(proof_environment.get("device_name") or "")
|
||||
),
|
||||
"proof_cuda_bf16": bool(proof.get("bf16")) and cuda_bf16_training(proof_environment),
|
||||
"proof_bf16_supported": bool(proof_environment.get("bf16_supported")),
|
||||
"proof_contract_ok": training_payload_contract_ok(proof, manifest),
|
||||
"proof_optimizer_ok": proof.get("optimizer") == "paged_adamw_8bit",
|
||||
|
||||
Reference in new issue
Block a user