Skip to content

[TEST] test_paro_prewarm_rotation_extension_skips_unsupported_configs fails after any earlier test loads the Paro rotation extension (patches .load, product short-circuits on _ROTATION_EXTENSION_READY) #5430

Closed

Description

@Qubitium

Found on main @ 1405751, AMD Radeon AI PRO R9700 (gfx1201), torch 2.16 dev ROCm 10.1, transformers 5.23.0. The mechanism does not depend on the platform.

What is wrong

tests/test_paro.py::test_paro_prewarm_rotation_extension_skips_unsupported_configs (tests/test_paro.py:2694-2718) monkeypatches paro_utils_module._PARO_ROTATION_EXTENSION.load and then expects that prewarm_paro_rotation_extension(fused_rotation=True, group_size=128, krot=8) calls it exactly once (assert calls == ["load"]). The product path never reaches that attribute when the extension is already loaded in the process:

  • prewarm_paro_rotation_extension (gptqmodel/utils/paro.py:1015) calls _load_rotation_extension();
  • _load_rotation_extension (gptqmodel/utils/paro.py:443-448) returns True straight away from the module global _ROTATION_EXTENSION_READY, and otherwise asks _extension_api().is_available("paro"), not _PARO_ROTATION_EXTENSION.load.

So the test passes only when it is the first thing in the process to touch the Paro rotation extension. Any earlier test in the same pytest session that runs a real fused rotation (on GPU) sets _ROTATION_EXTENSION_READY = True, and this test then fails.

Repro (GPU host, one pytest process)

pytest -q tests/test_paro.py::test_paro_prewarm_rotation_extension_skips_unsupported_configs
# 1 passed
pytest -q tests/test_paro_rotation_inference_cache_5317.py tests/test_paro.py::test_paro_prewarm_rotation_extension_skips_unsupported_configs
# FAILED ... assert [] == ['load']   (1 failed, 3 passed)
pytest -q tests/kernels/test_paro_triton_cudagraph_5225.py tests/test_paro.py::test_paro_prewarm_rotation_extension_skips_unsupported_configs
# FAILED ... assert [] == ['load']   (1 failed, 5 passed)

tests/test_paro.py on its own passes (243 passed).

Suggested fix

In the test, monkeypatch.setattr(paro_utils_module, "_ROTATION_EXTENSION_READY", False), and patch the call the product actually makes (_extension_api().is_available or _load_rotation_extension) instead of _PARO_ROTATION_EXTENSION.load.

Severity: low (test only). It is red on any GPU lane that runs the Paro test files in one session.

🤖 Generated with Claude Code

Activity

  1. Qubitium commented on Nov 19, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim: agent-4e3a0639ecaf is working on this issue now.

    Started 2026-11-19T05:22:38Z. The claim expires 4.0h after this comment is last edited (heartbeat). Other agents: do not start this issue while the claim is live.

    Scope: Make test_paro_prewarm_rotation_extension_skips_unsupported_configs independent of earlier tests: patch the seam the product path actually uses (or reset the module-level ready flag) so the test does not depend on process-global extension state.

  2. Qubitium commented on Nov 19, 2026

    @Qubitium
    CollaboratorAuthor

    Fixed in e09969306 (PR #5442).

    The test now patches the seam the product actually calls, _load_rotation_extension, instead of _PARO_ROTATION_EXTENSION.load. That is already how the neighbouring tests in tests/test_paro.py spy on the same helper (:2839, :2904, :6277), so the gating contract is unchanged: unsupported configs return False without attempting a load, and the supported one attempts exactly one.

    I also added test_paro_prewarm_reports_true_when_the_extension_is_already_loaded, which pins the process state that made the old test fail: with _ROTATION_EXTENSION_READY already True, a prewarm must return True without probing is_available or rebuilding. That guards the product short-circuit the old test accidentally depended on.

    Verified

    pytest tests/test_paro_rotation_inference_cache_5317.py \
           tests/test_paro.py::test_paro_prewarm_rotation_extension_skips_unsupported_configs
    before (main @ 8618744ac): 1 failed, 3 passed     assert [] == ['load']
    after:                     4 passed
    
    pytest tests/kernels/test_paro_triton_cudagraph_5225.py <same test>
    before: 1 failed, 5 passed
    after:  6 passed
    
    pytest tests/test_paro_rotation_inference_cache_5317.py tests/test_paro.py
    before: 1 failed, 246 passed
    after:  248 passed
    

    Re-verified on main after the merge (7a86e3cad): 248 passed. All twelve tests/test_paro*.py files in one session: 311 passed.

    No product code changed: the short-circuit is correct and intentional; only the test was coupled to session state.

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