Skip to content

feat: enable meta device targets in TransformerBridge device_map#1493

Open
hiro-nikaitou wants to merge 1 commit into
TransformerLensOrg:devfrom
hiro-nikaitou:feat/device-map-meta-support
Open

feat: enable meta device targets in TransformerBridge device_map#1493
hiro-nikaitou wants to merge 1 commit into
TransformerLensOrg:devfrom
hiro-nikaitou:feat/device-map-meta-support

Conversation

@hiro-nikaitou

Copy link
Copy Markdown

Part of #1280.

Enables device targets in TransformerBridge , building on the CPU support shipped in #1459.

Changes:

  • Remove from so explicit meta targets are passed to HF instead of raising at validation time.
  • Update / docstrings to describe meta support and its known limitations.
  • Update post-load check in — meta targets now warn only at forward time via Accelerate (no hard block at boot).
  • Update to .

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.

Part of TransformerLensOrg#1280.

Enables 'meta' device targets in TransformerBridge device_map, building
on the CPU support shipped in TransformerLensOrg#1459.

- Remove 'meta' from _UNSUPPORTED_OFFLOAD_DEVICE_MAP_VALUES
- Update docstrings and error messages to reflect meta support
- Remove 'meta' from post-load hf_device_map validation (now warning only)
- Update test: test_meta_value_in_device_map_rejected -> allowed

Meta-offloaded parameters are skipped by cast_floating_params_to_dtype
but may still cause forward-pass errors in Bridge-wrapped components
that access offloaded tensors without Accelerate align_module_device.
This is safe for config inspection (load_weights=False) and documented
in resolve_device_map docstring.

Disk offload remains blocked pending the hook-routing fix described in
PR TransformerLensOrg#1459.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: hiro-nikaitou <vieteviete@proton.me>
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