feat: enable meta device targets in TransformerBridge device_map#1493
feat: enable meta device targets in TransformerBridge device_map#1493hiro-nikaitou wants to merge 1 commit into
Conversation
be00253 to
6cfecef
Compare
|
Hi @hiro-nikaitou, thanks for the contribution! I ran the enabled path end-to-end and every meta I ran the following (tiny-gpt2, CPU, this branch): The docstring's example scenario is genuinely enabled, but the map is discarded, not honored. And its failure-mode caveat is off: failures are at boot (not forward), and Net effect of merging as-is: users lose You have a couple paths forward for resolving this:
I lean towards option 1, but if you'd like to dig deeper & tackle option 2, you are more than welcome to. Whichever route you take, make sure to add tests that validate your changes. |
…er review Per jlarson4's review on PR TransformerLensOrg#1493: meta device_map values crash at boot (NotImplementedError in HF tie_weights, KeyError in Accelerate offload hooks) and are silently ignored when load_weights=False. Changes: - Remove 'meta' from _UNSUPPORTED_OFFLOAD_DEVICE_MAP_VALUES so the resolver passes it through unconditionally - Validate meta at boot() level where load_weights is in scope: reject with ValueError when load_weights=True, accept when False - Disk offload remains blocked in the resolver (Bridge wrappers bypass Accelerate hooks) - Updated tests: resolver-level meta pass-through, boot-level rejection (default) and acceptance (load_weights=False) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: hiro-nikaitou <vieteviete@proton.me>
d61ea4b to
8315b43
Compare
…er review Per jlarson4's review on PR TransformerLensOrg#1493: meta device_map values crash at boot (NotImplementedError in HF tie_weights, KeyError in Accelerate offload hooks) and are silently ignored when load_weights=False. Changes: - Remove 'meta' from _UNSUPPORTED_OFFLOAD_DEVICE_MAP_VALUES so the resolver passes it through unconditionally - Validate meta at boot() level where load_weights is in scope: reject with ValueError when load_weights=True, accept when False - Disk offload remains blocked in the resolver (Bridge wrappers bypass Accelerate hooks) - Updated tests: resolver-level meta pass-through, boot-level rejection (default) and acceptance (load_weights=False) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: hiro-nikaitou <vieteviete@proton.me>
8315b43 to
88cf8d7
Compare
Part of #1280.
Enables device targets in TransformerBridge , building on the CPU support shipped in #1459.
Changes:
Limitations (documented in resolve_device_map docstring):
Meta-offloaded parameters are skipped by but may still cause forward-pass errors in Bridge-wrapped components that access offloaded tensors without Accelerate . This is safe for config inspection () and for users who understand the constraints.
Closes the portion of #1280. Disk offload remains blocked pending the hook-routing fix described in #1459.