Repository navigation
test: realign the qwen3-omni decoder walk and the hessian-release oracle (#4769) - #5187
Merged
Merged
Conversation
…cle (#4769) Two tests in #4769 are still red at 49a6dc5 on this host and both are test-side staleness, not product bugs. tests/test_qwen_moe_converter.py transformers 5.22 moved the thinker decoder under language_model, so model.thinker.model.layers[0] raises AttributeError. Resolve the decoder with the production helper gptqmodel.utils.model.thinker_text_model, which qwen3_omni_moe.py itself uses and which returns getattr(thinker.model, "language_model", thinker.model), so 5.20 and 5.22 both work. _assert_converted_experts still runs against the real converted layer and the MODULE_CONVERTER_MAP assertion is kept. tests/test_fallback_hessian_release.py adopt_hessian_from now releases both deferred-source registries itself (260af2a, #4430), so follower._deferred_hessian_sources is already empty when the test indexes [0]. The invariant the test protects is unchanged and now stronger - the adopted source is released before the memory-heavy clone_module - so assert it at the new boundary: the registry is drained, the follower's ready event was synchronized, and the leader's H is gone before quantization starts. Red on 49a6dc5: 2 failed, 15 passed. Green: 17 passed. Neighbours: 409 passed, 12 skipped.
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.
Fixes #4769 (the residual that is still red on this host).
Scope
The issue's last residual comment listed two failures reproducible here at
main@49a6dc5b9(RTX 4090, CUDA 13.2, torch 2.15.0+cu132, transformers 5.22.1, py3.14). Both are test-side staleness, not product bugs. Everything else the residual listed was re-verified green in this pass and is untouched.test_qwen_moe_converter.py::test_qwen3_omni_uses_defuser_for_fused_expertsAttributeError: 'Qwen3OmniMoeThinkerModel' object has no attribute 'layers'language_modeltest_fallback_hessian_release.py::TestFallbackReleasesPartials::test_shared_input_fallback_releases_adopted_source_before_cloneIndexErroronfollower._deferred_hessian_sources[0]adopt_hessian_fromnow drains the registry itself (#4430)1. transformers 5.22 decoder nesting
graph LR subgraph "transformers 5.20" A["thinker"] --> B["model<br/>(Qwen3OmniMoeThinkerModel)"] --> C["layers[0]"] end subgraph "transformers 5.22" D["thinker"] --> E["model<br/>(Qwen3OmniMoeThinkerModel)"] --> F["language_model"] --> G["layers[0]"] end H["test hard-coded<br/>thinker.model.layers[0]"] -.->|"works on 5.20"| C H -.->|"AttributeError on 5.22"| EThe test walked a fixed path. The product code was already layout-tolerant:
Qwen3OmniMoeGPTQ.module_treelists boththinker.model.layersandthinker.model.language_model.layers, andconvert_modelreportsthinker.model.language_model.layers.0.mlp.experts→_ExpertContaineron 5.22, so nothing was silently skipped.The fix uses the production accessor
gptqmodel.utils.model.thinker_text_model, which is exactly whatqwen3_omni_moe.pyuses and which returnsgetattr(thinker.model, "language_model", thinker.model):The assertions are unchanged:
_assert_converted_expertsstill runs against the real converted layer and"qwen3_omni_moe" not in MODULE_CONVERTER_MAPis kept.2. Hessian source release moved to adoption
Before #4430 the release happened at
quantize(); the test observed the deferral in between. #4430 made adoption the last consumer and releases immediately, so the deferral is created and drained insideadopt_hessian_from.The invariant the test protects is unchanged and in fact stronger — the adopted source must be gone before the memory-heavy
clone_module, so leader H + leader partial + follower copy are never all live at clone time. The test now asserts it at the new boundary: the registry is drained, the follower's ready event was synchronized, andweakref(leader.H)is dead afterleader.free()and beforequantize(). Reverting the #4430 block makes the retargeted test fail onassert follower._deferred_hessian_sources == [], so the guard is preserved rather than deleted.follower._hessian_ready_eventis used instead of "last event created" so there is no ordering assumption.Evidence
Red on
49a6dc5b9(both files,CUDA_VISIBLE_DEVICES=""):Green:
1 passedeachtest_fallback_hessian_release.pytest_qwen_moe_converter.pytest_fallback.py,test_exl3_projection_resume.py,test_gptq_hessian_accumulation.py,test_gptq_shared_hessian.py,test_gptq_hessian_pipeline.py,test_shared_input_hessian_dedup.py,test_qwen3_omni_embeddings_4816.py,test_defuser_version_check.py,test_qwen3_omni_key_map_4881.py,module_tree/test_model_alignment.pyuvx [email protected] checkon both filesNot verified
thinker_text_model'sgetattrfallback.tests/models/test_qwen3_omni.pyneeds the real 30B checkpoint, unavailable offline.test_bits_new(offlineallenai/c4builder cache),test_quant_batch::test_diff_batch(this venv'sflash_attn_2_cudaundefined symbol), and the ROCm/R9700-only remainder.