Repository navigation
Description
Found on main @ 3867c82, RTX 4090 (CUDA 13.2, torch 2.15, py3.14) and Radeon AI PRO R9700 (gfx1201, ROCm 10.1, torch 2.16, py3.14t). All items below are still red on main @ c52ae99.
This is the round-17 follow-up to #4764. I ran every non-model file under tests/ one file at a time, on both GPUs. These tests went red after b225a43 (the round-14 triage sha). Each was re-run 3 times alone and failed 3/3. Each was bisected with the HEAD test file copied onto every probed tree. In every case the test is out of date and the library behaves as its commit intends. The reason is given per item.
Already filed by others, so not repeated here: test_docs_contract_refs.py (#4967), and test_gguf_load_policy_env_removal.py / test_lazy_turtle_conversion_cache.py (#4941, fixed in 33787ae).
1. 1ba670307 (#4871, fix #4847: TorchLinear compiles the unbound dequantize_weight). CPU, both platforms
tests/module_tree/test_fusion_kernel_backends.py::test_native_fusion_shapes_oracle_ownership_and_invalidation[{gate_up,qkv_gqa}-cpu-TorchLinear-torch.float16]
assert all(ref() is None for ref in refs), "Original native weight allocations were retained"
| tree | result (-k "cpu and TorchLinear and gate_up") |
|---|---|
| 6ec93e6 (parent) | pass |
| 1ba6703 | fail |
The pre-fusion qweight is still alive right after group.install(), but gc.collect() frees it. I traced the referrers with GC disabled. The only owner is cyclic garbage that Dynamo leaves after tracing the compiled TorchLinear.dequantize_weight: LazyCache -> LazyVariableTracker(unrealized Tensor) -> ConstDictVariable of the module's _buffers ({'qweight': ...}). Since #4871 the module is a graph input of the compiled function, not a bound self, so the trace state keys the module's buffers. The parent commit has no such retention with GC disabled. The test's no-GC weakref check is the strictest form of the #4240 contract and now catches this trace garbage. The real-model #4847 path is fine: Llama-3.2-1B GPTQ, BACKEND.TORCH, load + generate + drop with GC disabled leaves 0/112 qweights alive on HEAD (CUDA and CPU), against 112/112 and 0.962 GiB on the parent.
Fix: run gc.collect() before the weakref check (the retained storage is transient trace garbage), or warm the modules without the compiled dequant path. Related: tests/test_quant_linear_release_4847.py::test_compiled_dequantize_does_not_pin_the_module replaces torch_compile with the identity function, so the real Dynamo state that this fusion test trips over is never exercised (see #4937 for the optimize() side).
2. 9d2ea51eb (#4829, fix #4807: a failed run keeps the offload root while hooks read from it). CPU, both platforms
tests/test_failed_run_fence_4595.py::test_failed_quantize_does_not_leak_offload_bundles
tests/test_failed_run_fence_4595.py:220 assert not offload_root.exists() or list(offload_root.iterdir()) == []
Left contains one more item: PosixPath('.../offload/run-63cabe289edb46a7')
Bisect: 9d2ea51^ passes, 9d2ea51 fails. Since #4829, a failed quantize() hands the per-run directory to the model's weakref.finalize, because completed layers are still disk-offloaded shells that read from it. The test asserts the directory is gone while qmodel is still alive, which is the behaviour #4829 deliberately removed. The #4595 property ("a late finalizer must not recreate a released run dir") is no longer what this assertion checks. Fix: del qmodel; gc.collect() before the assertion, or assert that every bundle left under the root belongs to a module that still owns a disk-offload hook.
3. 40e69d475 (#4837, EXL3 releases the capture partial). Needs a visible CUDA device, both platforms
tests/test_exl3_projection_resume.py::test_process_resumes_from_packed_checkpoint_without_requantizing
gptqmodel/looper/exllamav3_processor.py:221 capture._release_deferred_hessian_sources()
AttributeError: '_Capture' object has no attribute '_release_deferred_hessian_sources'
Bisect: 40e69d4^ passes, 40e69d4 fails. The test's _Capture double (test line 35) mirrors the GPTQ capture attributes by hand and was not given the new method. Fix: add def _release_deferred_hessian_sources(self): pass to the double. With CUDA_VISIBLE_DEVICES="" the branch is not reached and the test passes, which is why CPU-only runs miss it.
4. fa91047ef (#4835, EXL3 reconstructs through the portable kernel off CUDA). CPU, both platforms
tests/test_kernel_audit_regressions.py::test_exllamav3_wide_inputs_route_to_torch_reconstruction
AttributeError: 'types.SimpleNamespace' object has no attribute '_needs_torch_fallback'
Bisect: fa91047^ passes, fa91047 fails. This is the same commit and the same kind of stub drift as #4895, but in a second file that #4924 did not touch. The SimpleNamespace stand-in for self lacks the _needs_torch_fallback() that forward() now calls first. Fix: give the stub _needs_torch_fallback=lambda: False, so that the wide-input routing under test is still reached.
5. d86b4251a (#4810, Qwen2.5-Omni saved in the source HF key layout). CPU, both platforms
tests/test_moe_resave_preserves_experts_4589.py::test_resave_refuses_when_expert_shell_is_not_defused
RuntimeError: Loader: the checkpoint '.../quantized/model.safetensors' does not provide tensors for 2 non-quantized parameter(s):
model.layers.0.mlp.experts.gate_up_proj, model.layers.0.mlp.experts.down_proj. ...
(test expects ValueError, match="Refusing to re-save")
The refusal still happens, just earlier: the uninitialized-parameter guard added in #4810 fires while save() rebuilds the un-defused shell. I checked that nothing is written: the refused/ directory exists but is empty. Fix: accept either refusal, pytest.raises((ValueError, RuntimeError), match="Refusing to re-save|does not provide tensors"), and keep the "no model.safetensors" assertion.
6. 5fb25294f (#4930, fix #4861: capture derives position_ids from the mask). CPU, both platforms
tests/test_positional_mask_capture_4660.py::test_replayed_layers_reproduce_native_layer_output[{eager,sdpa}]
Mismatched elements: 288 / 864 (33.3%) Greatest absolute difference: 0.0717 at index (0, 8, 1)
Bisect: 5fb2529^ passes, 5fb2529 fails. The test's right-padded batch has 3 rows x 3 pad slots x 32 channels = 288 elements, which is exactly the mismatch count. Capture now uses generate()'s ids (pad slots get position 1). The test's "native" oracle calls model(**example) with the default arange positions, so only the pad slots differ, and those are excluded from the Hessian by the keep mask. Fix: build the native oracle with the same derived position_ids (mask.cumsum(-1) - 1, pad = 1), or compare only mask == 1 positions.
7. 57a605583 (#4856, fix #4805: QQQ CPU cache replaces the checkpoint layout). CPU, both platforms
tests/test_qqq_kernel_memory_4387.py::test_qqq_torch_forward_is_bitwise_unchanged[-1, 128]
tests/test_qqq_kernel_memory_4387.py:63 packed_i64 = packed.to(torch.int64) # packed = module.B
AttributeError: 'NoneType' object has no attribute 'to'
Bisect: 57a6055^ passes, 57a6055 fails. The first CPU forward now drops B/s_group/s_channel by design, and _oracle_int8_weight() reads module.B after that forward. Fix: build the oracle weight (and s_channel) before calling module(x), or read them from module.state_dict(), which rebuilds the checkpoint tensors.
How to reproduce
pytest -q tests/module_tree/test_fusion_kernel_backends.py -k "cpu and TorchLinear and fp16" \
tests/test_failed_run_fence_4595.py tests/test_kernel_audit_regressions.py tests/test_positional_mask_capture_4660.py \
tests/test_qqq_kernel_memory_4387.py tests/test_moe_resave_preserves_experts_4589.py
pytest -q tests/test_exl3_projection_resume.py # with one CUDA/ROCm device visible
Severity: low, test-only. Items 3 and 4 leave the #4818 and #4789 paths without a working guard until they are fixed.
🤖 Generated with Claude Code
Activity
Qubitium commentedon Nov 17, 2026
Agent claim:
agent-root-4969is working on this issue now.Qubitium commentedon Nov 17, 2026
Four more tests, also still red on
main@ c52ae99. Each failed 3/3 when run alone and was bisected the same way (HEAD test file copied onto each probed tree):8.
7edbca826(#4909, desc_act sink-row cap). CPU, both platforms.tests/test_rocm_quant_blas.py::test_gptq_hessian_accumulation_enters_the_overrideand::test_chunked_hessian_accumulation_enters_the_override_per_chunkThe test builds
gptq.GPTQ.__new__(gptq.GPTQ)and sets onlycolumns,preferred_staging_dtypeandresolve_hessian_chunk_size.compute_hessian_xtxnow readsself.qcfgfor the #4742 sink cap. Fix: setaccumulator.qcfg = QuantizeConfig()on the double.9.
0facf5f29(#4893, fix #4860: materialize unreached layers after a cancelled run). CPU, both platforms.tests/test_qwen2_5_omni_lm_head.py::test_omni_lm_head_rejects_shared_weights[gptq, rtn]The refusal itself still works (
NotImplementedError: ... lm_head layer with tied weights is not supported). The test tieslm_head.weightto the lazy (meta)embed_tokens.weightof an unmaterialized shell. Since #4893, the failure path materializes both modules from the checkpoint, so afterwardslm_headholds the checkpoint's own (different) head andembed_tokensholds the checkpoint embedding. They are no longer the same object and their values differ. I checked that both are on CPU and non-meta. The test's identity assertion only held while nothing was materialized. Fix: tie after materialization (or on a non-lazy load), or assert only on the refusal and on "noTorchLinearinstalled". Owner call: whether the failure-path materialization should re-apply a user tie made on meta parameters.10.
6dffaf230(#4826, fix #4815: key the HIP JIT cache by the gfx target). ROCm only.tests/test_torch_ops_jit_extension.py::test_cuda_cache_fingerprint_payload_includes_resolved_arch_flags,::test_torch_ops_jit_extension_cuda_fingerprint_tracks_visible_capabilities,::..._prefers_arch_override,::..._tracks_visible_capabilities_even_with_overrideOn R9700: 6dffaf2^ (e308444) 12/12 pass, 6dffaf2 4 failed. On HIP the build root is now keyed by the gfx target, so the tests that fake CUDA capabilities /
TORCH_CUDA_ARCH_LISTno longer change the fingerprint. Fix:skipif(torch.version.hip)on these four (the HIP twin istests/test_hip_jit_cache_target_4815.py), or monkeypatch the gfx probe as well.Also:
tests/test_vl_legacy_checkpoint_resave_4802.py::test_vl_legacy_checkpoint_resave_roundtrip[internvl](red since 0f14dd7) is a real library regression, filed as #4973.🤖 Generated with Claude Code
Qubitium commentedon Nov 17, 2026
Agent release:
agent-root-4969finished. All seven items are fixed and merged in #4978 (squash commit1addb9cf73c2840da16f605886746e723a5c3d68). Worktree and branch removed.Qubitium commentedon Nov 17, 2026
Agent claim released:
agent-53ba17eb4d83is no longer working on this issue.The issue is free to claim.
PR #4978 already covers this triage; releasing so the claim does not block it.
Qubitium commentedon Nov 17, 2026
Fixed by #4978 (merged as
1addb9cf7). All seven triaged nodes are green on the merged tree; the stale doubles/oracles were realigned and no product code changed.test: realign seven stale doubles and oracles (ModelCloud#4969) (Mode…