Skip to content

test(exl3): route the #4793 inner-handle burst back through the native stub (#4895) - #4924

Merged
Qubitium merged 1 commit into
mainfrom
root/exl3-inner-handle-4895
Nov 17, 2026
Merged

Qubitium merged 1 commit into
mainfrom
root/exl3-inner-handle-4895

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Summary

tests/test_exllamav3_inner_handle_4793.py, the #4793 regression test from #4803, has been red on main since #4835 (fa91047ef). The test built its trellis on CPU; ExllamaV3Linear._needs_torch_fallback() (added by #4835) routes any non-CUDA trellis to _ensure_torch_inner(), so the burst never reached _ensure_inner(), built a real ExllamaV3TorchLinear from the fake 2x2x16 trellis, and died in exllamav3_torch.py:

ValueError: EXL3 module `proj` storage differs from logical dimensions or 128-channel padding

That was worse than a plain red test: the #4793 handle-publication race lost its guard, because the stubbed native handle was never exercised. This PR restores the original coverage with the smallest change and makes a future routing drift fail loudly.

What Changed

Tests

# red on origin/main (76fd2c7bb, before the fix)
$ pytest -q tests/test_exllamav3_inner_handle_4793.py
FAILED ...::test_cold_start_burst_publishes_one_handle
FAILED ...::test_repeated_clear_then_burst_never_returns_none[5]
2 failed in 7.02s

# green after the fix (rebased on origin/main 5a13ec241)
$ pytest -q tests/test_exllamav3_inner_handle_4793.py
2 passed in 7.84s

# the EXL3/EXLLAMAV3 surface #4835 forgot
$ pytest -q tests/test_exl3_*.py tests/test_exllamav2_*.py tests/test_exllamav3*.py tests/kernels/test_exllamav3*.py
500 passed, 13 skipped, 19 failed in 162.94s

# skip path verified by hiding the GPU
$ CUDA_VISIBLE_DEVICES= pytest -q tests/test_exllamav3_inner_handle_4793.py -rs
2 skipped

The 19 sweep failures all reproduce on origin/main without this change and are unrelated to it:

  • 14 in tests/kernels/test_exllamav3_kernel.py: AttributeError: 'object' object has no attribute 'wait_stream' at exl3_lib/quantize.py:1460, caused by pre-existing test pollution. tests/test_exl3_workspace.py replaces implementation.get_quant_stream at module import and caches a stub object() stream in the module's _quant_streams; any later quantization in the same process picks it up. test_exl3_workspace.py followed by the kernel file is 15 failed, 13 passed on a clean origin/main (5a13ec2) worktree without this PR. The kernel file alone is 21 passed, 1 failed (the one failure is the 8 GiB allocation below).

  • 1 tests/kernels/test_exllamav3_kernel.py::test_exllamav3_hadamard_addresses_rows_past_two_to_the_32_elements: 8 GiB allocation with ~2.7 GiB free on the shared GPU.

  • 2 tests/test_exl3_auto_nf12_recovery.py: subprocess import failure in this venv (kernels.CUDAProperties / flash_attn_2_cuda symbol mismatch), environment-only.

  • 1 tests/test_exl3_projection_resume.py: _Capture test stub lacks _release_deferred_hessian_sources, added to production code by perf(exl3): tile Hessian symmetrization and release the capture partial (#4818) #4837; stale test double.

  • 1 tests/test_exl3_workspace.py::test_concurrent_quantize_shares_one_stream_and_scratch_per_device: CUDA OOM; the assigned GPU was ~92% held by another process on this shared host.

  • Unit tests have been executed and passed, or the reason they are not applicable is documented.

  • I added a new simple/fast unit test for this change, or documented why that is not applicable.

Lint: ruff check tests/test_exllamav3_inner_handle_4793.py -> All checks passed.

Model Support / Module Plan

Not applicable: test-only change; no MODEL_MAP, alias, definition, fusion or AWQ grouping change.

Logic Flow Documentation

Not applicable: no control flow, resolution order or tensor lifecycle change. The test now pins the existing forward() -> _ensure_inner() branch (gptqmodel/nn_modules/exllamav3.py:420-430) instead of drifting into _ensure_torch_inner().

Review Requirements

I or an AI agent (such as Codex or Claude) have:

  • 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 or accuracy change. The native LinearEXL3 constructor remains stubbed; only the test's routing assertion is new.

Notes

The test keeps the #4793 semantics: a cold-start burst publishes exactly one handle, and repeated clear_weight_cache() then burst never returns None. A real-kernel variant on a 1B EXL3 checkpoint is intentionally out of scope here (the issue notes ~20 s per burst); this stubbed-native guard is the fast regression test for the Python handle publication.

…e stub (#4895)

tests/test_exllamav3_inner_handle_4793.py built its trellis on CPU. Since
#4835 (fa91047), forward() sends every non-CUDA trellis to
_ensure_torch_inner(), so the burst never reached _ensure_inner() and the
stubbed native handle was never built. It failed on the fake 2x2x16 trellis
with "storage differs from logical dimensions or 128-channel padding" instead
of guarding the #4793 handle race.

Build the trellis on CUDA, where _needs_torch_fallback() is false, and skip
the file without CUDA so a CPU-only host does not silently test the portable
path. Assert that the stubbed LinearEXL3 served every forward and that no
torch inner was built, so a future routing change fails loudly instead of
quietly losing the #4793 regression guard.

Red on origin/main: 2 failed. Green: 2 passed.
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