Repository navigation
test: make the Hessian, free-threading and 2-GPU gates actually run (#4768) - #4787
Merged
Merged
Conversation
…4768) Three test-gate bugs hid real coverage on every host that is not the original 7-GPU lab machine. 1. `tests/test_hessian.py` had a module-level `pytestmark` that skipped all 17 tests unless `device_count() > 6`, so `GPTQ.hessian_inverse` damping/flooring, Hessian chunking and the CUDA workspace locking had no running test anywhere with fewer than 7 GPUs. The gate was meant for one benchmark: drop it, mark the two benchmarks `slow`, keep an explicit CUDA-available skip on the pinned-memory CPU-vs-GPU benchmark, use the current device instead of `cuda:6`, and gate the multi-GPU merge on 2 devices with `cuda:0`/`cuda:1` instead of 8 devices with `cuda:6`/`cuda:7`. 2. The `PYTHON_GIL=0` subprocess tests were gated on `hasattr(sys, "_is_gil_enabled")`, which is true on every CPython >= 3.13 including GIL builds, so on a regular 3.14 build the child died with "Disabling the GIL is not supported by this build" and the test failed instead of skipping. Gate on `sysconfig.get_config_var("Py_GIL_DISABLED") == 1` in `test_ci_free_threaded_lane.py`, `test_exl3_dispatch_concurrency.py` and `test_exl3_workspace.py`. 3. `tests/test_excluded_device_warmup.py` schedules `cuda:0`/`cuda:1` warmups and waited for them, but the worker enters `torch.cuda.device("cuda:1")`, which raises `invalid device ordinal` on a one-GPU host and silently aborted the warmup. The tests assert scheduling, not hardware: pin `_device_ctx` to a no-op alongside the `_activate_thread_device` patch they already install, so they run on any host. Measured on this 1-GPU host: * `tests/test_hessian.py`: main 17 skipped -> 15 passed, 2 skipped (the two 2-GPU merge tests). * `tests/test_excluded_device_warmup.py`: main 3 failed -> 14 passed, 3 skipped. * `test_exl3_dispatch_concurrency.py`: main 3 failed -> skipped on this GIL build (the third test still needs the EXL3 extension, which cannot build here without CUDA_HOME, same as main). Part 2 of the issue (hard-coded indices in `test_gptq.py`, `test_g2h_tensor_quality.py`, `test_cuda_event_stream_activation_buffer.py`, `test_fp4_llama3_fp4.py`) is left for a follow-up: those need per-test device or capability selection, and the FP4 case is a mixed A100+5090 host.
This was referenced Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the gate bugs in #4768 parts 1, 3 and 4: coverage that never ran now runs.
1.
tests/test_hessian.py: all 17 tests skipped on < 7 GPUsA module-level
pytestmarkmeant for one benchmark skipped the whole merged file unlesstorch.cuda.device_count() > 6. SoGPTQ.hessian_inversedamping/flooring, Hessian chunking and the CUDAworkspace locking had no running test on any 1-4 GPU host.
@pytest.mark.slowtest_hessian_accumulation_cpu_vs_gpu: explicit CUDA skip (it needs pinned memory) andtorch.cuda.current_device()instead ofcuda:6test_hessian_merge_multi_gpu_with_attention_mask: gated on 2 devices (was 8) and usescuda:0/cuda:1instead of the lab-host
cuda:6/cuda:7torch.cuda.is_available()skips2.
PYTHON_GIL=0subprocess tests: never skipped on a GIL buildhasattr(sys, "_is_gil_enabled")is true on every CPython >= 3.13, including GIL builds, so the gate neverfired and the child died with
Fatal Python error: config_read_gil: Disabling the GIL is not supported by this build- a failure, not a skip. Gate onsysconfig.get_config_var("Py_GIL_DISABLED") == 1intest_ci_free_threaded_lane.py,test_exl3_dispatch_concurrency.py(2 parametrized cases) andtest_exl3_workspace.py.3.
tests/test_excluded_device_warmup.py: 3 tests failed on one GPUThey schedule
cuda:0/cuda:1warmups and wait for them, but the worker enterstorch.cuda.device("cuda:1"),which raises
invalid device ordinalon a 1-GPU host and silently aborts the warmup the test waits for. The testsassert scheduling, not hardware, so the new autouse fixture pins
_device_ctxto a no-op next to the_activate_thread_devicepatch they already install.Measured on this 1-GPU host
tests/test_hessian.pytests/test_excluded_device_warmup.pytests/test_exl3_dispatch_concurrency.pytests/test_exl3_workspace.py::test_concurrent_streams_do_not_overwrite_tile_workspacestill fails here for thesame environmental reason as
main: the EXL3 extension cannot build withoutCUDA_HOME.ruff checkclean on all five files.Not in this PR
Part 2 of the issue (hard-coded
cuda:6/7/8intest_gptq.py,test_g2h_tensor_quality.py,test_cuda_event_stream_activation_buffer.py,test_fp4_llama3_fp4.py) needs per-test device/capabilityselection rather than a mechanical index change - the FP4 case is specifically a mixed A100+5090 host. Left as a
follow-up so this PR stays verifiable.