Repository navigation
Tests: run the MXFP4 operand device guard check on CPU-only torch too - #16088
Merged
Merged
Conversation
#16062's fake-tensor test places tensors on cuda:1 under FakeTensorMode, which a CPU-only torch build refuses (PyTorch is not linked with support for cuda devices), so the CPU rest-2 shard is red. Skip it there, and add a test of the guard itself that runs on any build.
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This was referenced Oct 30, 2026
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.
Repo tests (CPU, rest-2)is red on main since #16062 (MXFP4 torch decode fallback: run ldexp on the operands' GPU). It fails on unrelated PRs such as #16085 and #16074:The test builds its operands on
cuda:1insideFakeTensorMode. That works on any CUDA-linked torch, with or without a GPU, but a CPU-only build cannot dispatch a fake CUDA tensor. The CPU shards install CPU-only torch. I checked the same few lines on both builds:2.13.0+cu130with no visible GPU runs them, and2.10.0+cpuraises the error above. The product's device guard is fine; the test assumed a CUDA build.Changes
test_torch_fallback_runs_ldexp_on_the_operands_gpunow skips whentorch.backends.cuda.is_built()is false. It still runs on CUDA builds, GPU or not.test_the_torch_decode_runs_inside_its_operands_device_guardruns on any build, so the CPU shards keep covering the guard. It checks three things:_dequantize_torchdecodes with the operand's device current, puts the previous device back, and leaves the current device alone for a CPU operand or an index-lesscudaoperand.torch.cuda.deviceguard is shared by both tests.Verification
_operand_device_guardfrom_dequantize_torchfails the new test on CPU-only torch.