Skip to content

[TEST] tests/test_exllamav3_inner_handle_4793.py (#4803) red since #4835: its CPU-trellis stub is now routed to the torch fallback, so the #4793 handle race has no working guard #4895

Closed

Description

@Qubitium

Found on main @ 5cded90, RTX 4090 host (fails the same with or without a visible GPU).

What is wrong

tests/test_exllamav3_inner_handle_4793.py, the regression test #4803 added for #4793, has been red on main since #4835 (fa91047ef, fix for #4789):

$ 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]
E  AssertionError: ['ValueError: EXL3 module `proj` storage differs from logical dimensions or 128-channel padding', ...]
tree result
fa91047ef^ 2 passed
fa91047ef (#4835) 2 failed
main 5cded90 2 failed

Cause: the test stubs LinearEXL3 and validate_device, then builds the module with a CPU trellis (torch.zeros((2, 2, 16), dtype=torch.int16), test line 68). #4835 added ExllamaV3Linear._needs_torch_fallback() (gptqmodel/nn_modules/exllamav3.py:303-314), so forward() now sends any non-CUDA trellis to _ensure_torch_inner(). That path builds a real ExllamaV3TorchLinear from the fake 2x2x16 trellis, and exllamav3_torch.py:381 rejects it.

The bigger issue is that the stubbed native handle, the thing #4793 is about, is never reached. If the test is "fixed" by loosening the assertion, it will pass without exercising _ensure_inner() at all. With a CPU trellis it now covers the torch helper instead.

I checked the real path separately, and the #4803 fix itself holds. Real Llama-3.2-1B-Instruct-EXL3-W4 on CUDA, 28 ExllamaV3Linear modules, 8 barrier-synchronized threads with one stream each, 5 rounds of clear_weight_cache() followed by a cold burst: fp16 and bf16, GIL on and PYTHON_GIL=0 (3.14t, torch 2.16). Result: 0 errors and 0 mismatches against a serial reference in 1120 calls per configuration.

Suggested fix

  • Make the test's trellis a meta-free CUDA tensor when CUDA is available. _needs_torch_fallback() returns False only for CUDA, and meta raises on the native path.
  • Or make it patch _needs_torch_fallback to return False, so the burst again goes through _ensure_inner().
  • Skip it without CUDA, instead of letting it silently test another path.
  • Also add a real-kernel variant: the barrier burst above takes about 20 s on a 1B checkpoint.

Test that should have caught it

#4835's PR ran test_exl3_in_session_fp16_4789.py but not the other EXL3 test files. Running tests/test_exl* and tests/test_exllamav3* for any change to gptqmodel/nn_modules/exllamav3.py would have caught it.

Severity

Low/medium: a red test on main, and while it is red the #4793 concurrency fix has no working regression guard.

🤖 Generated with Claude Code

Activity

  1. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim: agent-root-4895 is working on this issue now.

  2. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Agent release: agent-root-4895 finished this issue. PR: #4924 (squash-merged as 10caeea).

  3. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim released: agent-11788dff99fd is no longer working on this issue.

    The issue is free to claim.

    already fixed on main by 10caeea (#4924): the burst is routed back through the native stub; both tests pass on origin/main @ b98f402, nothing left to change

  4. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim released: agent-53ba17eb4d83 is no longer working on this issue.

    The issue is free to claim.

    already fixed on main by 10caeea (#4924); tests/test_exllamav3_inner_handle_4793.py is 2 passed on pristine origin/main d5dde13, nothing left to change

  5. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Fixed by #4924 (merged as 10caeea27): the burst is routed back through the native stub, and both nodes in tests/test_exllamav3_inner_handle_4793.py pass on main.

  6. added a commit that references this issue on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions