Skip to content

test(interop): load HF-bridge accelerator checkpoints with device_map (#6473 follow-up) - #6544

Merged
Qubitium merged 1 commit into
mainfrom
test/interop-4053-hf-bridge-device-map
Dec 1, 2026
Merged

Qubitium merged 1 commit into
mainfrom
test/interop-4053-hf-bridge-device-map

Conversation

@Qubitium

@Qubitium Qubitium commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #6542

Since #6473, _hf_bridge_load in tests/test_checkpoint_interop_4053.py calls from_pretrained(...).to(device). The HF bridge selects kernels for the device the load targets, which is CPU when no device_map is given. The checkpoint pins backend=marlin / exllama_v2, so the load correctly raises ... does not support device: cpu before .to() runs, and the #6137 runtime-layout refusal is never tested. This is the same mechanism as #6527 / #6528 in another file.

What Changed

Tests

# origin/main c649fcb5f, RTX 4090, torch 2.15.0+cu132, accelerate 1.15.0
pytest -q -p no:cacheprovider --timeout=900 tests/test_checkpoint_interop_4053.py
# 2 failed, 26 passed
#   [marlin-MarlinLinear]        ValueError: MarlinLinear does not support device: cpu
#   [exllama_v2-ExllamaV2Linear] ValueError: ExllamaV2Linear does not support device: cpu

# this PR
pytest -q -rs -p no:cacheprovider --timeout=900 tests/test_checkpoint_interop_4053.py
# 28 passed (no skips)

uvx [email protected] check gptqmodel ... tests setup.py
# All checks passed!

Product behavior: with the CUDA load, the bridge selects MarlinLinear / ExllamaV2Linear, the runtime layout is marked (_marlin_repacked / _native_shuffled), and save_pretrained raises cannot be reconstructed without publishing model.safetensors. These are the test's own assertions, which now run and pass.

  • Unit tests have been executed and passed.
  • Existing test updated (no product change).

Measured Impact / Model Support / AWQ / Logic Flow / Kernel Accuracy

Not applicable (test-only change).

Review Requirements

  • Reviewed this PR.
  • Minimal surface: one test helper.

Notes

Found during a release-readiness test sweep of origin/main c649fcb. Related: #6527 / #6528.

🤖 Generated with Claude Code

#6473 changed _hf_bridge_load to from_pretrained().to(device). The HF
bridge selects kernels for the load device, so a pinned Marlin/ExLlamaV2
checkpoint was rejected on the CPU load before .to() ran, and the
runtime-layout save refusal (#6137) was never reached. Use device_map for
accelerator targets (requires optional accelerate) and keep CPU loads
unchanged.

Fixes #6542

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Qubitium
Qubitium marked this pull request as ready for review December 1, 2026 02:43
@Qubitium
Qubitium merged commit 3297c7e into main Dec 1, 2026
6 checks passed
@Qubitium
Qubitium deleted the test/interop-4053-hf-bridge-device-map branch December 1, 2026 02:43
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.

test: checkpoint_interop_4053 HF-bridge runtime-layout refusal loads on CPU via .to(cuda) since #6473 (marlin/exllama_v2 reject cpu)

1 participant