{"record":{"id":"12ee1bee51a76ef2","repo":"vllm-project/vllm","slug":"cuda-is-required-for-this-proof","errorCode":null,"errorMessage":"CUDA is required for this proof.","messagePattern":"CUDA is required for this proof\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"tools/gumbel_precision/prove_exponential_race_precision.py","lineNumber":116,"sourceCode":"            remaining -= batch\n        torch.accelerator.synchronize()\n        elapsed = time.perf_counter() - start\n        print(f\"{dtype}: tail_hits={hits} elapsed={elapsed:.2f}s\")\n\n\ndef main() -> None:\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\"--lower-tail-samples\", type=int, default=200_000_000)\n    parser.add_argument(\"--lower-tail-chunk-size\", type=int, default=10_000_000)\n    parser.add_argument(\"--race-trials\", type=int, default=100_000)\n    parser.add_argument(\"--race-tail-tokens\", type=int, default=262_144)\n    parser.add_argument(\"--race-gap\", type=float, default=20.5)\n    parser.add_argument(\"--race-chunk-trials\", type=int, default=64)\n    parser.add_argument(\"--seed\", type=int, default=2026)\n    args = parser.parse_args()\n\n    if not torch.accelerator.is_available():\n        raise RuntimeError(\"CUDA is required for this proof.\")\n\n    device = torch.accelerator.current_accelerator()\n    if device.type != \"cuda\":\n        raise RuntimeError(\"CUDA is required for this proof.\")\n\n    print(f\"torch={torch.__version__} cuda={torch.version.cuda}\")\n    print(f\"device={device}\")\n    measure_exponential_lower_tail(\n        device=device,\n        samples=args.lower_tail_samples,\n        chunk_size=args.lower_tail_chunk_size,\n        seed=args.seed,\n    )\n    run_many_tail_race(\n        device=device,\n        trials=args.race_trials,\n        num_tail_tokens=args.race_tail_tokens,\n        gap=args.race_gap,","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/tools/gumbel_precision/prove_exponential_race_precision.py#L98-L134","documentation":"This verification script measures exponential/Gumbel race precision and requires a real CUDA accelerator. The first guard fails when torch.accelerator.is_available() is false — torch sees no usable accelerator device in the current process.","triggerScenarios":"Running tools/gumbel_precision/prove_exponential_race_precision.py on a CPU-only host, in a container without GPU passthrough, or with CUDA_VISIBLE_DEVICES set to an empty/invalid value.","commonSituations":"Running the numerical proof on a dev box without a GPU; docker run without --gpus; CUDA driver mismatch making the device invisible to torch.","solutions":["Run the script on a machine with a working NVIDIA GPU and a CUDA-enabled torch build.","If using Docker, start the container with `--gpus all` and a CUDA base image.","Unset or correct CUDA_VISIBLE_DEVICES and verify `python -c \"import torch; print(torch.accelerator.is_available())\"` returns True first."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import torch\nif not torch.accelerator.is_available():\n    raise SystemExit(\"No accelerator visible; fix GPU passthrough/driver before running the proof\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate GPU tools behind a torch.accelerator.is_available() check in wrapper scripts.","In Docker, always launch with --gpus all.","Verify CUDA_VISIBLE_DEVICES is not empty before running GPU-only proofs."],"tags":["cuda","tooling","gpus","numerics"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}