Repository navigation
fix(kernel): import resolve_kernel_config in ParoQuantTritonLinear and restore the Ruff gate - #4366
Merged
Merged
Conversation
#4364 moved ParoQuantTritonLinear onto KernelConfig but dropped the accessor import, so constructing the Triton ParoQuant kernel raised NameError: kernel = resolve_kernel_config(kwargs.get("kernel")) ^^^^^^^^^^^^^^^^^^^^^ The default backend selection never instantiates that class on a CPU-only host, so the suite stayed green while the class was unimportable-in-practice. Add the import and a regression test that asserts the symbol resolves and the constructor still reads the policy. Also sort the import blocks the new imports made unsorted in #4364 (this is what the Ruff Check gate reported for 13 files) and drop the now-unused env_flag import in qqq.py. format/check.sh is green again.
Collaborator
Author
|
CI note:
These are not touched by this PR; its diff is the missing import, the |
Collaborator
|
@ZX-ModelCloud fix. |
Collaborator
Author
I will fix |
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.
TL;DR
Follow-up to #4364, which shipped with two defects. Net: 13 files, small.
ParoQuantTritonLinear.__init__readsresolve_kernel_config(...)but themodule never imported it, so constructing that kernel raises
NameError.Ruff Checkgate is red onmainfor 13 files, 12 of them import-orderfallout from the new imports and one now-unused
env_flagimport.1. The bug
#4364replaced the ParoQuant Triton environment reads with the policy object:but the import block only gained the other modules' accessors. The failure is
invisible to the suite because
AUTOnever selectsPAROQUANT_TRITONon aCPU-only host, so nothing in CI constructs the class:
flowchart LR A["AUTO backend selection on a CPU host"] --> B["never builds ParoQuantTritonLinear"] B --> C["NameError is never raised in CI"] D["explicit backend=PAROQUANT_TRITON<br/>or a CUDA host with Triton"] --> E["ParoQuantTritonLinear.__init__"] E --> F["resolve_kernel_config is undefined"] F --> G["NameError before the layer can quantize"]2. The fix
Add the missing import, and add a regression test that does not depend on the
device or the backend selector:
I verified the test fails when the import is reverted and passes with it:
3. The lint gate
format/check.shonmain(9b11fb3):After this PR
format/check.shprintsAll checks passed!. No behaviourchanges beyond the missing import; the import-order and unused-import edits are
mechanical (
ruff check --fix).4. Validation
tests/test_paroquant.pyhas two failures on this host caused byninjanotbeing on
PATHfor the JIT extension; the identical failures reproduce on aclean
mainworktree and are unrelated.