Skip to content

PATCH: add back n-dim device-mesh + fix tp hook registration #39693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

S1ro1
Copy link
Member

@S1ro1 S1ro1 commented Jul 26, 2025

  1. Fixes ndim check on device_mesh - This was merged in previously with Allow device_mesh have multiple dim  #38949 but was by mistake reverted by Add ep #39501, we need this for upcoming accelerate/axolotl release.
  2. Changes TP plans to make it work as before, we need to replicate (potentiall seqparallel) layer norms and other modules, as else we'd get mixed tensor+dtensor in optimizer.step()
  3. Adds merging of basemodel tp_plan with the specific model, it wasn't applied before and i.e. lm_heads were not sharded.

TODO: Add proper plans for other TP models
TODO: Add correct plan merging even for distribute_and_shard

cc @ArthurZucker @SunMarc

@S1ro1 S1ro1 added the for patch Tag issues / labels that should be included in the next patch label Jul 26, 2025
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@S1ro1 S1ro1 changed the title PATCH: add back n-dim device-mesh PATCH: add back n-dim device-mesh + fix tp hook registration Jul 26, 2025
Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: llama

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for patch Tag issues / labels that should be included in the next patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants