Pin the eager decoder in the AuxK test so it runs anywhere - #142
Open
alepot55 wants to merge 1 commit into
Open
Conversation
The test builds CPU tensors and its docstring says it uses the eager decoder fallback, but nothing made that true: `decoder_impl` is bound at import time and prefers the Triton kernel, which rejects CPU tensors. The test therefore fails on any machine where Triton imports, GPU or not, so `pytest` is red on a fresh clone. Patch `decoder_impl` for the duration of the test and call `eager_decode` for the reference value.
|
|
This was referenced Aug 23, 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.
What
test_auxk_loss_does_not_double_count_b_decbuilds CPU tensors, and its docstring says it "runs on CPU using the eager decoder fallback, so it requires no GPU". Nothing makes that true.decoder_implis bound at import time insparsify/utils.pyand prefers the Triton kernel wheneversparsify.xformersimports, which it does whenever Triton is installed, GPU or not.So the test fails on both kinds of machine, for the same reason:
RuntimeError: 0 active drivers ([]). There should only be one.ValueError: Pointer argument (at 0) cannot be accessed from Triton (cpu tensor?)pytestis red on a fresh clone either way. SettingSPARSIFY_DISABLE_TRITON=1works around it, but the test should not need the caller to know that.Fix
Patch
decoder_implfor the duration of the test withmonkeypatch, and calleager_decodedirectly for the reference value.After
On an A100,
pytestonmaingoes from1 failed, 10 passedto11 passed.