Skip to content

test(load): keep the #5022 bridge nodes runnable without Optimum or CUDA (#5022) - #5051

Merged
Qubitium merged 1 commit into
mainfrom
root/hf-bridge-optimum-guard-5022
Nov 18, 2026
Merged

Qubitium merged 1 commit into
mainfrom
root/hf-bridge-optimum-guard-5022

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #5046 (#5022). That PR added
tests/test_hf_bridge_cpu_offload_5022.py and listed it in the AWQ CPU
(unit)
lane, but the lane installs only requirements.txt and a CPU-only
torch build, so:

ERROR at setup of test_hf_from_pretrained_loads_an_offloaded_map
E   ModuleNotFoundError: No module named 'optimum'

The module-scoped environment fixture imported optimum unconditionally, so
all seven nodes errored at setup and the AWQ CPU (unit) job went red on
236f31b07.

What Changed

tests/test_hf_bridge_cpu_offload_5022.py only:

  • the fixture tolerates a missing optimum; the availability probe is only
    forced when the package is importable.
  • the two end-to-end nodes importorskip("optimum"), and the shared
    checkpoints fixture now skips on a CPU-only runtime before quantizing,
    so a CPU lane no longer builds checkpoints it will never use (that fixture is
    only consumed by the two CUDA nodes).
  • the offload-map node skips when the Marlin kernel class cannot be constructed
    in the current runtime — a CPU-only torch build raises
    ImportError: Marlin kernel requires CUDA at construction even with the
    runtime stubs.

Tests

runtime result
CPU-only, optimum absent (the CI lane; simulated by shadowing optimum with a module that raises ImportError) 4 passed, 3 skipped, 0 errors
CPU-only, optimum present 4 passed, 3 skipped
CUDA + optimum, rebased on af2ab180a 7 passed

tests/test_docs_contract_refs.py alongside it: 23 passed.
ruff check clean.

No product code changes; the fix and its red-on-main evidence are in #5046.

Notes

…UDA (#5022)

The AWQ CPU lane installs `requirements.txt`, which has no `optimum`, and its
torch build has no CUDA. The file's module-scoped environment fixture imported
`optimum` unconditionally, so all seven nodes errored at setup with
`ModuleNotFoundError: No module named 'optimum'` on that lane.

* the fixture tolerates a missing `optimum` (the availability probe is only
  forced when the package is importable);
* the two end-to-end nodes `importorskip("optimum")`, and the shared
  `checkpoints` fixture skips on a CPU-only runtime *before* quantizing, so the
  lane no longer builds checkpoints it will never use;
* the offload-map node skips when the Marlin kernel class cannot be constructed
  in the current runtime (a CPU-only torch build has no Marlin extension).

Result on a CPU-only, optimum-free runtime: 4 passed, 3 skipped, 0 errors.
With CUDA and Optimum: 7 passed.
@Qubitium
Qubitium merged commit 139edad into main Nov 18, 2026
6 checks passed
@Qubitium
Qubitium deleted the root/hf-bridge-optimum-guard-5022 branch November 18, 2026 00:27
Qubitium added a commit that referenced this pull request Nov 18, 2026
…5022) (#5052)

The AWQ CPU `unit` lane lists `tests/test_hf_bridge_cpu_offload_5022.py` (added
by #5046, hardened by #5051), but the `paths:` filter had no entry for it. A PR
that only touched that file therefore never ran the lane that owns it, so the
#5051 fix could not be observed there.

Add the `tests/test_hf_bridge_*.py` pattern beside the other test-file patterns.
`gptqmodel/utils/importer.py` and `gptqmodel/utils/model.py` stay out on
purpose: both are touched by most PRs, and the lane already runs for
`gptqmodel/models/**` and `docs/**`.
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