Repository navigation
test(hf-bridge): load the legacy-qzeros Marlin case with device_map again (#6473 follow-up) - #6528
Merged
Merged
Conversation
…gain #6473 replaced device_map={'': 0} with from_pretrained().to('cuda:0'). Without a device_map the HF bridge selects the kernel on CPU, so the test never reached MarlinLinear (the #6274 path) and failed. Restore the device_map spelling, gated on the now-optional accelerate. Fixes #6527 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
tests/test_hf_bridge_legacy_qzeros_marlin_6274.py::test_legacy_symmetric_checkpoint_loads_on_the_auto_marlin_kernelhas been red onmainsince #6473 (assert any(isinstance(m, MarlinLinear) ...)→ False).#6473 rewrote the load as
from_pretrained(dir).to("cuda:0"). Without adevice_map, Transformers loads on CPU and the HF bridge's AUTO selection correctly picks a CPU kernel (TorchCpuAvx512Linear)..to()only moves it, so the test no longer reaches the Marlin + deferred-qzerospath it guards (#6274). #6501 restored Transformers/Accelerate compatibility, so this PR restores the originaldevice_map={"": 0}spelling for this node. The node now skips when the optionalacceleratepackage is absent.Fixes #6527
What Changed
AutoModelForCausalLM.from_pretrained(dir, device_map={"": 0})afterpytest.importorskip("accelerate")._loadhelper are unchanged.Tests
Red (origin/main c649fcb, RTX 4090):
Green (this PR, accelerate 1.15 installed):
Product behavior check (same checkpoint):
device_map={"": 0}loadsMarlinLinearwith a finite forward that matches the CPU-selected kernel (max abs diff 2e-3)..to("cuda:0")givesTorchCpuAvx512Linear, as expected for CPU-time selection.Model Support / Module Plan / AWQ / Logic Flow / Kernel Accuracy
Not applicable (test-only change).
Review Requirements
Notes
The node now needs the optional
acceleratepackage. Where it is not installed, the node skips, and that skip is not Marlin validation.🤖 Generated with Claude Code