Repository navigation
test(generation): bind the KV-quant hook on the compile-policy harness - #6670
Merged
Merged
Conversation
#6603 added BaseQModel._prepare_kv_quant_cache and generate() now calls it unconditionally. The _Harness double in the #4669 policy tests binds only the three policy methods, so the five generate() tests raised AttributeError before reaching their assertions. Bind the real method (the harness has no kv_quant, so it returns the kwargs unchanged) instead of duplicating a stub. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Summary
The #4669 generation compile-policy tests are red on
origin/main: fivegenerate()tests raiseAttributeError: '_Harness' object has no attribute '_prepare_kv_quant_cache'.Root cause is the test double, not the product. #6603 (
feat(turboquant): add runtime softmax-attention KV-cache quantization) addedBaseQModel._prepare_kv_quant_cacheandgenerate()now calls it unconditionally on every input branch. Every real wrapper inherits the method; the_Harnessdouble binds only_kernels_support_compile,_generation_compile_kwargsandgenerate, so it never reaches its assertions.What Changed
tests/test_generation_compile_policy_4669.py(+1): bind the real hook on_Harness:The harness has no
kv_quantattribute, so the real method returns the kwargs unchanged — exactly the pre-#6603 behavior these policy tests assert. No product code change.Tests
Measured Impact
Not applicable: test-only change.
Model Support / Module Plan
Not applicable: no
MODEL_MAP, module-tree, plan or definition change.AWQ onboarding safety
Not applicable: no AWQ grouping, search, replay or fold change.
Logic Flow Documentation
Not applicable: the harness now mirrors the real
BaseQModel.generate()call chain; no shipped control flow changes.Review Requirements
Kernel Accuracy Requirements
Not applicable: no kernel, dispatch or fusion change.
Notes
kv_quant).tests/test_optimize_generate_cpu_offload_5099.pyonly referencesBaseQModel.generatein its docstring and does not bind it.🤖 Generated with Claude Code