Skip to content

mxfp8 moe: enable ep=1 - #3935

Merged
vkuzo merged 9 commits into
mainfrom
gh/vkuzo/3/head
Jul 20, 2026
Merged

vkuzo merged 9 commits into
mainfrom
gh/vkuzo/3/head

Conversation

@vkuzo

@vkuzo vkuzo commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

this is useful for debugging small MoE models on machines with 1 GPU

no comparison vs baseline, as ep=1 with mxfp8 did not work before this PR

Test Plan:

> NGPU=1 MODULE=deepseek_v3 CONFIG=deepseek_v3_debugmodel_mxfp8 ./run_train.sh --parallelism.expert_parallel_degree=1 --debug.seed 42 --debug.deterministic
...
[rank0]:[titan] 2026-07-17 12:11:19,578 - root - INFO - step:  1  loss:  7.94516  grad_norm:  3.7806  memory:  3.80GiB(2.13%)  tps: 619  tflops: 0.34  mfu: N/A
[rank0]:[titan] 2026-07-17 12:11:19,578 - root - INFO - Synchronizing and adjusting timeout for all ProcessGroups to 0:01:40
[rank0]:[titan] 2026-07-17 12:11:19,770 - root - INFO - step:  2  loss:  5.97859  grad_norm:  4.1965  memory:  4.35GiB(2.44%)  tps: 85,636  tflops: 46.49  mfu: N/A
[rank0]:[titan] 2026-07-17 12:11:19,958 - root - INFO - step:  3  loss:  5.06384  grad_norm:  3.3065  memory:  4.35GiB(2.44%)  tps: 87,036  tflops: 47.26  mfu: N/A
[rank0]:[titan] 2026-07-17 12:11:20,141 - root - INFO - step:  4  loss:  4.92125  grad_norm:  2.7681  memory:  4.35GiB(2.44%)  tps: 89,849  tflops: 48.78  mfu: N/A
[rank0]:[titan] 2026-07-17 12:11:20,325 - root - INFO - step:  5  loss:  4.56706  grad_norm:  2.7554  memory:  4.35GiB(2.44%)  tps: 89,030  tflops: 48.34  mfu: N/A
[rank0]:[titan] 2026-07-17 12:11:20,514 - root - INFO - step:  6  loss:  4.35889  grad_norm:  2.4691  memory:  4.35GiB(2.44%)  tps: 86,676  tflops: 47.06  mfu: N/A
[rank0]:[titan] 2026-07-17 12:11:20,699 - root - INFO - step:  7  loss:  4.18233  grad_norm:  2.0657  memory:  4.35GiB(2.44%)  tps: 88,934  tflops: 48.29  mfu: N/A
[rank0]:[titan] 2026-07-17 12:11:20,882 - root - INFO - step:  8  loss:  4.14401  grad_norm:  2.0788  memory:  4.35GiB(2.44%)  tps: 89,322  tflops: 48.50  mfu: N/A
[rank0]:[titan] 2026-07-17 12:11:21,065 - root - INFO - step:  9  loss:  4.50716  grad_norm:  1.9171  memory:  4.35GiB(2.44%)  tps: 89,886  tflops: 48.80  mfu: N/A
[rank0]:[titan] 2026-07-17 12:11:21,248 - root - INFO - step: 10  loss:  4.03737  grad_norm:  1.8642  memory:  4.35GiB(2.44%)  tps: 89,696  tflops: 48.70  mfu: N/A

> NGPU=1 MODULE=deepseek_v3 CONFIG=deepseek_v3_debugmodel_mxfp8 ./run_train.sh --parallelism.expert_parallel_degree=1 --debug.seed 42 --debug.deterministic --compile.enable --compile.components model
...
[rank0]:[titan] 2026-07-17 12:13:18,632 - root - INFO - step:  1  loss:  7.94526  grad_norm:  3.7804  memory:  2.68GiB(1.50%)  tps: 591  tflops: 0.32  mfu: N/A
[rank0]:[titan] 2026-07-17 12:13:18,632 - root - INFO - Synchronizing and adjusting timeout for all ProcessGroups to 0:01:40
[rank0]:[titan] 2026-07-17 12:13:18,720 - root - INFO - step:  2  loss:  5.97692  grad_norm:  4.1932  memory:  2.92GiB(1.64%)  tps: 186,861  tflops: 101.45  mfu: N/A
[rank0]:[titan] 2026-07-17 12:13:18,805 - root - INFO - step:  3  loss:  5.06270  grad_norm:  3.3064  memory:  2.92GiB(1.64%)  tps: 192,359  tflops: 104.44  mfu: N/A
[rank0]:[titan] 2026-07-17 12:13:18,884 - root - INFO - step:  4  loss:  4.92087  grad_norm:  2.7667  memory:  2.92GiB(1.64%)  tps: 207,872  tflops: 112.86  mfu: N/A
[rank0]:[titan] 2026-07-17 12:13:18,969 - root - INFO - step:  5  loss:  4.56706  grad_norm:  2.7547  memory:  2.92GiB(1.64%)  tps: 193,396  tflops: 105.00  mfu: N/A
[rank0]:[titan] 2026-07-17 12:13:19,060 - root - INFO - step:  6  loss:  4.35946  grad_norm:  2.4696  memory:  2.92GiB(1.64%)  tps: 179,919  tflops: 97.68  mfu: N/A
[rank0]:[titan] 2026-07-17 12:13:19,148 - root - INFO - step:  7  loss:  4.18216  grad_norm:  2.0654  memory:  2.92GiB(1.64%)  tps: 186,309  tflops: 101.15  mfu: N/A
[rank0]:[titan] 2026-07-17 12:13:19,238 - root - INFO - step:  8  loss:  4.14332  grad_norm:  2.0757  memory:  2.92GiB(1.64%)  tps: 182,511  tflops: 99.09  mfu: N/A
[rank0]:[titan] 2026-07-17 12:13:19,326 - root - INFO - step:  9  loss:  4.50715  grad_norm:  1.9160  memory:  2.92GiB(1.64%)  tps: 187,111  tflops: 101.59  mfu: N/A
[rank0]:[titan] 2026-07-17 12:13:19,415 - root - INFO - step: 10  loss:  4.03669  grad_norm:  1.8630  memory:  2.92GiB(1.64%)  tps: 185,201  tflops: 100.55  mfu: N/A

Reviewers:

Subscribers:

Tasks:

Tags:

vkuzo added 2 commits July 16, 2026 12:43
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo

vkuzo commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Stack from ghstack (oldest at bottom):

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 16, 2026
vkuzo added 2 commits July 17, 2026 11:10
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jul 17, 2026
Summary:

this is useful for debugging small MoE models on machines with 1 GPU

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: d6a5e63
ghstack-comment-id: 4995920101
Pull-Request: #3935
vkuzo added 2 commits July 17, 2026 12:09
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jul 17, 2026
Summary:

this is useful for debugging small MoE models on machines with 1 GPU

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: eb4bbc9
ghstack-comment-id: 4995920101
Pull-Request: #3935
vkuzo added 2 commits July 17, 2026 13:57
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jul 17, 2026
Summary:

this is useful for debugging small MoE models on machines with 1 GPU

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: 2251af2
ghstack-comment-id: 4995920101
Pull-Request: #3935
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jul 20, 2026
Summary:

this is useful for debugging small MoE models on machines with 1 GPU

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: 52f14a1
ghstack-comment-id: 4995920101
Pull-Request: #3935
@vkuzo
vkuzo changed the base branch from gh/vkuzo/2/head to main July 20, 2026 14:06
@vkuzo

vkuzo commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

lint failure seems unrelated, merging

@vkuzo
vkuzo merged commit c95b211 into main Jul 20, 2026
10 of 14 checks passed
mreso added a commit to mreso/torchtitan that referenced this pull request Jul 20, 2026
Absorbs 4 upstream commits (mxfp8 MoE ep=1 pytorch#3935, deepseek mxfp8 debug config
pytorch#3934, model config in Trainer to_dict pytorch#3919, GPU-agnostic AutoParallel tests
pytorch#3805). No conflicts; pytorch#3935 touches common MoE but the HF backend imports and
MoE EP=2 training verified clean (12.35 -> 7.23).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants