Skip to content

New example: [REDACTED] - #7121

Open
qgallouedec wants to merge 2 commits into
mainfrom
sft-moe-expert-parallel-8-nodes-v2
Open

New example: [REDACTED]#7121
qgallouedec wants to merge 2 commits into
mainfrom
sft-moe-expert-parallel-8-nodes-v2

Conversation

@qgallouedec

@qgallouedec qgallouedec commented Sep 9, 2026

Copy link
Copy Markdown
Member

LoRA SFT on [REDACTED] on 8 nodes with SFTTrainer, sharded at load time by transformers' DistributedConfig.

Same shape as #6869's examples.

Needs huggingface/transformers#48204.


Note

Low Risk
Documentation and a self-contained example only; no changes to TRL trainers or library APIs.

Overview
Adds sft_moe_expert_parallel, a distributed-training example that runs LoRA SFT on a large MoE with SFTTrainer across 8 nodes (64 GPUs). The training script wires transformers.distributed.DistributedConfig into model_init_kwargs (tp_size=8, fsdp_size=8, expert parallel + token dispatch) so the checkpoint is sharded at load time, uses packed sequences, save_only_model=True (no resume), and documents pins on transformers ep-fsdp-2d-mesh and peft main.

A companion sft_moe_expert_parallel.slurm launches torchrun via Slurm with IPv4 rendezvous. docs/source/example_overview.md gains an index row for the new folder.

Reviewed by Cursor Bugbot for commit 878a8c3. Bugbot is set up for automated code reviews on this repo. Configure here.

Fixed-config script plus its SLURM launcher: SFTTrainer with a load-time DistributedConfig
(tp_size=8, fsdp_size=8, expert parallelism with token dispatch) on 64 GPUs. Defaults are the
measured operating point; the constraints behind them are in the docstring.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T01:28:44.786856Z e4a6163 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@bot-ci-comment

bot-ci-comment Bot commented Sep 9, 2026

Copy link
Copy Markdown

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4a616384b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread examples/sft_moe_expert_parallel/sft_moe_expert_parallel.slurm Outdated
Comment thread examples/sft_moe_expert_parallel/sft_moe_expert_parallel.py
Comment thread examples/sft_moe_expert_parallel/sft_moe_expert_parallel.py
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