Repository navigation
test(interop): load HF-bridge accelerator checkpoints with device_map (#6473 follow-up) - #6544
Merged
Merged
Conversation
#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]>
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.
Summary
Fixes #6542
Since #6473,
_hf_bridge_loadintests/test_checkpoint_interop_4053.pycallsfrom_pretrained(...).to(device). The HF bridge selects kernels for the device the load targets, which is CPU when nodevice_mapis given. The checkpoint pinsbackend=marlin/exllama_v2, so the load correctly raises... does not support device: cpubefore.to()runs, and the #6137 runtime-layout refusal is never tested. This is the same mechanism as #6527 / #6528 in another file.What Changed
_hf_bridge_load(path, "cpu")is unchanged.device_map={"": device}afterpytest.importorskip("accelerate"). Transformers needs Accelerate for anydevice_map; fix: scope Accelerate isolation to GPT-QModel calls; restore HF/Optimum/PEFT compat #6501 restored that path in a GPT-QModel process.Tests
Product behavior: with the CUDA load, the bridge selects
MarlinLinear/ExllamaV2Linear, the runtime layout is marked (_marlin_repacked/_native_shuffled), andsave_pretrainedraisescannot be reconstructedwithout publishingmodel.safetensors. These are the test's own assertions, which now run and pass.Measured Impact / Model Support / AWQ / Logic Flow / Kernel Accuracy
Not applicable (test-only change).
Review Requirements
Notes
Found during a release-readiness test sweep of
origin/mainc649fcb. Related: #6527 / #6528.🤖 Generated with Claude Code