Repository navigation
Stop the CUDA test spoofs reporting an exhausted card - #8123
Merged
danielhanchen merged 4 commits intoAug 8, 2026
Merged
danielhanchen merged 4 commits into
danielhanchen merged 4 commits into
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This was referenced Aug 7, 2026
Both spoofs answer mem_get_info as (0, 80GB). That tuple is (free, total), so it describes a card with nothing left rather than the plausible Ampere values the docstring promises, and torch.cuda.mem_get_info delegates straight to cudart().cudaMemGetInfo, so the aggressive spoof's zero reaches everything. Code that sizes work against the free pool then refuses to run at all. unsloth_zoo's fused cross entropy takes half of it as its chunk target and raises RuntimeError: Unsloth: No or negligible GPU memory available for fused cross entropy. instead of chunking, which fails tests/version_compat/test_trl_fake_train_cpu.py ::test_sft_trains_on_cpu on a host with four idle GPUs. CI does not run that file, so this has been red only locally. Both now report 60GB free of 80GB, and a source-level test holds every mem_get_info spoof to a positive free figure that does not exceed the total.
danielhanchen
force-pushed
the
fix/cuda-spoof-reports-zero-free
branch
from
August 8, 2026 03:21
4ccce27 to
f48eb68
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
Both CUDA spoofs answer
mem_get_infoas(0, 80 * 1024**3):tests/conftest.py:100, whose docstring says it returns "plausible Ampere values"tests/_zoo_aggressive_cuda_spoof.py, in_CudaRt.cudaMemGetInfoThat tuple is
(free, total), so what it actually describes is a card with nothing left. Andtorch.cuda.mem_get_infodelegates tocudart().cudaMemGetInfo, so patching only thetorch.cuda.memorybinding does not help: the aggressive spoof's zero is what every caller sees.Anything that sizes work against the free pool then refuses to run.
unsloth_zoo's fused cross entropy takes half of it as its chunk target:so it raises rather than chunking, and
tests/version_compat/test_trl_fake_train_cpu.py::test_sft_trains_on_cpufails on a host with four completely idle GPUs. The error names GPU memory, so it reads as a product bug until you look at the fixture.CI does not run that file (
studio-backend-ci.ymlpasses--ignore=tests/version_compat, andversion-compat-ci.ymlruns only the pinned-symbol files), which is why this has been red only locally.The change
Both spoofs report 60GB free of 80GB. Nothing else about them moves.
tests/test_cuda_spoof_reports_free_memory.pyholds everymem_get_infospoof in the suite to a positive free figure that does not exceed the total, and to at least 8GB, since half the free pool is the fused loss's chunk target and it caps that at 4GB. It reads the sources withastrather than importing them, because importing either spoof mutates the interpreter'storchfor whatever runs next. It fails onmainfor both files.Tests
tests/version_compat/goes from1 failed, 1580 passedto1620 passed, 191 skippedtogether with the rest of the spoof consumers (tests/studio/test_xpu_spoof_pipeline.py,tests/test_gguf_basename_platform_matrix.py,tests/vllm_compat/).Two failures in
tests/vllm_compat/test_unsloth_zoo_imports.pyare unrelated and reproduce identically on a cleanmaincheckout.