Skip to content

[TEST] The 2-GPU #4653 gate test_quantize_never_claims_the_excluded_device always fails: its subprocess still calls quantize(batch_size=..., calibration_data_min_length=...) removed by #4724 (TypeError before any measurement) #4868

Closed

Description

@Qubitium

Found on main @ 4f287eb, 2 GPUs visible (RTX 5090 + RTX 4090), torch 2.15 + CUDA 13.2.

What is wrong

tests/test_excluded_device_warmup.py::test_quantize_never_claims_the_excluded_device[filter] and [loaddev] are the end-to-end regression gate for #4320/#4653 ("an excluded GPU gets no context and no allocations during quantize"). Both fail on every host with 2+ GPUs before they measure anything. The subprocess script they run still calls the pre-#4724 API (tests/test_excluded_device_warmup.py:490):

model.quantize(
    calibration,
    batch_size=1,
    backend=BACKEND.TORCH,
    calibration_data_min_length=1,
)

#4724 (refactor(api): quantize() takes a CalibrationConfig; drop the calibration kwargs) removed those kwargs. #4688 (the #4653 fix that added this test) landed after #4724 had already changed the API, and #4787 later made the 2-GPU gates actually run. So the test went in red, and the multi-GPU "excluded GPU stays unclaimed" guarantee has no working test.

It is the only .quantize(...) call in tests/ that still passes removed calibration kwargs. I scanned every .quantize( call in the test tree for batch_size=, calibration_data_min_length=, calibration_concat_size=, calibration_sort= and calibration_dataset= outside a CalibrationConfig.

Repro

CUDA_DEVICE_ORDER=PCI_BUS_ID CUDA_VISIBLE_DEVICES=<two GPUs> \
pytest -q tests/test_excluded_device_warmup.py::test_quantize_never_claims_the_excluded_device
E       AssertionError: ...
E         TypeError: BaseQModel.quantize() got an unexpected keyword argument 'batch_size'
E       assert 1 == 0
tests/test_excluded_device_warmup.py:545: AssertionError
============================== 2 failed in 17.42s ==============================

Suggested fix

from gptqmodel import CalibrationConfig
model.quantize(
    CalibrationConfig(dataset=calibration, batch_size=1, min_length=1),
    backend=BACKEND.TORCH,
)

With only that change, both parametrizations pass on the 5090+4090 pair (2 passed in 20.67s). The product behavior is fine: the excluded GPU has no context and peak 0 MiB for both compute_device_filter and device=("cuda:1",). Only the gate is broken.

Related: CI did not catch this because the test is gpu/slow/integration and needs 2 GPUs. A cheap guard would be a CPU-only test that compiles every embedded subprocess script in tests/ and checks that its quantize( calls bind to the current signature (inspect.signature(BaseQModel.quantize).bind).

Severity

Low (test-only). It does leave the #4320/#4653 behavior unguarded on multi-GPU hosts.

🤖 Generated with Claude Code

Activity

  1. Qubitium commented on Nov 17, 2026

    @Qubitium
    CollaboratorAuthor

    Agent claim released: agent-11788dff99fd finished this issue.

    Pull request: #4919

    test-only: move the 2-GPU gate subprocess onto CalibrationConfig, and add a CPU-only guard that binds every embedded quantize() call in tests/ to the live signature

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