Ensuring correct device dispatch after module replacement
Maintainers usually reply within 1 day
@yiliu30 is already working on this.
Since Jan 25, 2026.
Assessment
This issue has not been assessed yet.
Description
When loading a model across multiple devices using device_map="auto", the accelerate library attaches hooks to move module inputs to the correct devices automatically.
For certain models (for example, gpt‑oss), we replace the original MoE modules during initialization. However, after this replacement, the newly inserted modules do not have the required Accelerate hooks attached. As a result, input tensors may not be dispatched to the correct devices.
We need to investigate when Accelerate binds these hooks during the model loading process. Based on that, we should re-dispatch (or re-attach hooks to) the replaced modules if necessary to ensure correct multi-device execution.
If needed, we can dispatch the replaced model with dispatch_model:
from accelerate.big_modeling import dispatch_model
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 193
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 55
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from intel/auto-round
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
intel/auto-round#2525 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 44/100
intel/auto-round#2532 ·
Maintainers usually reply within 1 day
-
[Bug]: FP8 static KV cache accuracy issuePossibly taken @xin3he claimed this 6 days ago. Openbug
intel/auto-round#2518 · 1 reaction · 1 assignee ·
Maintainers usually reply within 1 day
-
[Feature]: split special_model_handler to a folderPossibly taken @Cross2pro claimed this 3 days ago. Openenhancement
Difficulty 3/5 Half a day Newbie friendliness 42/100
intel/auto-round#2514 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 20/100
intel/auto-round#2507 ·
Maintainers usually reply within 1 day
All issues in intel/auto-round
Similar issues
-
link-rot
Difficulty 1/5 Under an hour Newbie friendliness 67/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
developmentseed/titiler-cmr#265 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Insecure Brotli version <1.2.1Possibly taken @jamescw19 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
stac-utils/stac-fastapi-pgstac#438 · 1 reaction ·
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day