Allow None vram_total_gb in test_gpu.py snapshot test#26
Merged
cryptopoly merged 1 commit intomainfrom May 1, 2026
Merged
Conversation
PR #22 (Fix Windows CUDA detection) replaced the system-RAM-as-VRAM fallback in _snapshot_nvidia with a no-GPU response that returns {'vram_total_gb': None, 'vram_used_gb': None}. The pre-existing test_snapshot_vram_values_are_numeric still required (int, float), which breaks on the Linux CI runner where neither torch.cuda nor nvidia-smi is available. This fix originally landed in branch fix/test-host-platform-mock (commit 3b147a9) but was pushed after PR #24 had already merged. It was added to PR #25 too late again — same pattern. Land it directly this time before any other CI run picks up the broken contract. Loosen the type check to (int, float, type(None)) so the no-GPU path is accepted, and rename the test to ..._numeric_or_none to make the intent loud at the call site.
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.
Trivial CI test fix. PR #22 changed _snapshot_nvidia to return vram_total_gb=None when neither torch.cuda nor nvidia-smi can answer (the no-system-RAM-fallback contract), but the pre-existing test_snapshot_vram_values_are_numeric still required (int, float). Linux CI runners hit the None branch and fail.
Fix landed twice on side branches (3b147a9 in PR #24, 59cd81c in PR #25) but both pushes happened after the parent PR had already merged, so they orphaned. Landing it directly here.
Loosens the type check to (int, float, type(None)) and renames the test to ..._numeric_or_none.