Skip to content

test: realign the stale #5325 guards with the module-global probes and compiled dequant - #5564

Merged
Qubitium merged 1 commit into
mainfrom
test/stale-triage-guards-5325
Nov 19, 2026
Merged

Qubitium merged 1 commit into
mainfrom
test/stale-triage-guards-5325

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Summary

Realigns four stale tests from the #5325 GPU-host triage that still fail on main for reasons unrelated to the product. Each one asserts on an implementation detail that a later, intentional refactor removed; the behaviour they were written for is still observable and is now asserted through the public surface.

Part of #5325 (items 4, 9, 14, 15). The remaining items are GPU/ROCm/AVX512-only and are not touched here.

What Changed

  • tests/test_concurrency_guards.py (item 4): has_cpu_bf16x3_precision stopped being an lru_cache in perf(cpu): reach torch.compile/inductor on CPU quantized kernels #5070 and became the module-global _CPU_BF16X3_PRECISION. Reset that global through monkeypatch instead of calling the removed cache_clear(); also reset it in _install_cpu_bf16x3_state so each test starts from an unresolved probe.
  • tests/test_torch_cpu_avx512.py (item 15): same story for has_avx512_bf16 and its _AVX512_BF16 global. Added _clear_avx512_bf16_probe(monkeypatch) and replaced the five cache_clear() calls.
  • tests/test_torch.py (item 14):
    • test_forward_observes_weight_mutation_and_state_load_clears_metadata no longer asserts that _zeros_cache is published. Since perf(cpu): reach torch.compile/inductor on CPU quantized kernels #5070 the dequant runs compiled and decodes zero-points/group-index inline, so the caches stay empty. The test now snapshots the pre-mutation payload, mutates qweight, checks the forward changed, then load_state_dicts the snapshot and requires the next forward to reproduce the original output exactly.
    • test_cached_dequant_offloads_g_idx_to_cpu_on_cuda drops the _g_idx_long_cache assertions and instead checks the observable contract: the weight comes back on CUDA, the original g_idx is offloaded to CPU, and a second dequant after the offload returns equal weights.
  • tests/test_pre_looper_failure_cleanup_4862.py (item 9):

No product code changed.

Tests

  • Unit tests have been executed and passed.
  • Existing regression tests were repaired; no new production behaviour to cover.

Baseline on origin/main @ d10a08a65 (before this PR):

pytest tests/test_concurrency_guards.py -k cpu_bf16x3_capability_probe_respects_an_active_scope
# FAILED AttributeError: 'function' object has no attribute 'cache_clear'
pytest tests/test_torch_cpu_avx512.py -k "test_cpu_feature_detection_requires_vbmi or test_cpu_feature_detection_requires_xsave"
# 2 FAILED, same AttributeError
pytest tests/test_torch.py -k "test_forward_observes_weight_mutation_and_state_load_clears_metadata or test_cached_dequant_offloads_g_idx_to_cpu_on_cuda"
# 2 FAILED assert None is not None (_zeros_cache / _g_idx_long_cache)
pytest tests/test_pre_looper_failure_cleanup_4862.py
# 2 FAILED (empty-dataset message, released == [])

After (rebased on origin/main @ d01058315):

PYTHONPATH=$PWD GPTQ_BYPASS_SAFETY_CHECKS=1 pytest \
  tests/test_torch.py \
  tests/test_concurrency_guards.py \
  tests/test_torch_cpu_avx512.py \
  tests/test_pre_looper_failure_cleanup_4862.py \
  -q -p no:cacheprovider
# 48 passed, 28 skipped

bash format/check.sh → All checks passed! (ruff 0.14.2).

Model Support / Module Plan

Not applicable: test-only change, no model definition, MODEL_MAP, or module-plan code touched.

AWQ onboarding safety

Not applicable: no model onboarding and no AWQ grouping/search/replay/fold change.

Logic Flow Documentation

Not applicable: no control flow, resolution order, or tensor lifecycle change.

Review Requirements

  • Reviewed this PR.
  • Checked that the code matches existing project structure, APIs, and conventions.
  • Avoided unnecessary monkeypatching and used the project's normal extension points where possible.
  • Minimized and compacted the impacted code surface.
  • Considered and eliminated potential regressions.

Kernel Accuracy Requirements

Not applicable: no kernel code or kernel-accuracy assertion changed. The two dequant tests only assert on returned tensors.

Notes

  • Item 16 (test_fused_bias_validation) is skipped on this host because it needs AVX512-BF16; its perf(cpu): make NF12, Paro and QQQ inductor-ready on CPU #5075-related expectation is left for an AVX512 runner.
  • Items 5, 7, 8, 10, 11, 17 and 18 from the triage need CUDA/ROCm, a pre-quantized /monster checkpoint, or a 3.14t interpreter and were not reproducible here.

@Qubitium
Qubitium marked this pull request as ready for review November 19, 2026 12:32
@Qubitium
Qubitium merged commit a668dc8 into main Nov 19, 2026
6 checks passed
@Qubitium
Qubitium deleted the test/stale-triage-guards-5325 branch November 19, 2026 12:33
Qubitium pushed a commit that referenced this pull request Nov 29, 2026
…on kwarg (#5325)

test_generation_desc_act_false loads a CUDA checkpoint without the
requires_nvidia_cuda() gate the other nodes use, so it fails on a CPU-only
host with 'RuntimeError: No CUDA GPUs are available'.

test_generation_desc_act_true is CUDA/checkpoint-only. Add a CPU-runnable spy
that asserts revision= (not rivision=) reaches GPTQModel.load, so the typo
fixed in #5565 cannot silently return.

Items A4/A15/A16 were already fixed on main by #5564/#5565 and are green at
2d3261d; verified without changes.
Qubitium added a commit that referenced this pull request Nov 29, 2026
…5325) (#6273)

A5 was a product defect, not a stale test: a meta move ran the int4pack
inverse (and its aten::equal identity check) against meta operands until
#5533 materialized the snapshot from its shape/dtype descriptor. A14 was
realigned by #5564, and the compiled entry now stages its operands outside
the traced graph (#5955), so the caches are published again. Both items are
green at main 2d3261d.

Extend the device-move test to assert every checkpoint operand's shape and
dtype is restored, not just qweight. Restore the cache expectations the A14
tests are named for: the compiled dequant publishes the g_idx cache on the
compute device, load_state_dict clears both metadata caches, and a full
forward still matches F.linear after the g_idx offload.

Co-authored-by: OpenAI Agent <[email protected]>
Qubitium added a commit that referenced this pull request Nov 29, 2026
…on kwarg (#5325) (#6258)

test_generation_desc_act_false loads a CUDA checkpoint without the
requires_nvidia_cuda() gate the other nodes use, so it fails on a CPU-only
host with 'RuntimeError: No CUDA GPUs are available'.

test_generation_desc_act_true is CUDA/checkpoint-only. Add a CPU-runnable spy
that asserts revision= (not rivision=) reaches GPTQModel.load, so the typo
fixed in #5565 cannot silently return.

Items A4/A15/A16 were already fixed on main by #5564/#5565 and are green at
2d3261d; verified without changes.

Co-authored-by: OpenAI Agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant