Skip to content

Revert "Avoid repeat_interleave output-size sync (#3274)" - #3335

Merged
xmfan merged 1 commit into
mainfrom
xmfan/stack/32
May 13, 2026
Merged

xmfan merged 1 commit into
mainfrom
xmfan/stack/32

Conversation

@xmfan

@xmfan xmfan commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

Stacked PRs:


Revert "Avoid repeat_interleave output-size sync (#3274)"

This reverts commit e917ff4.

cc @syed-ahmed, who reported it breaks

-m torchtitan.train --module torchtitan_configs.deepseek_v3 --config deepseek_v3_671b --profiler.no-enable-profiling --metrics.enable-tensorboard --metrics.save_for_all_ranks --training.steps 50 --training.local_batch_size 16 --training.seq_len 4096 --parallelism.tensor_parallel_degree 1 --parallelism.pipeline_parallel_degree 4 --parallelism.context_parallel_degree 1 --parallelism.expert_parallel_degree 32 --compile.components model,loss --parallelism.data_parallel_shard_degree=64 --activation_checkpoint.mode=full
[rank0]:[CUDA_KERNEL_ASSERT] /opt/pytorch/pytorch/aten/src/ATen/native/cuda/Repeat.cu:20: compute_cuda_kernel: block: [3,0,0], thread: [416,0,0]: Assertion failed: `result_size == cumsum_ptr[size - 1]`: Invalid input! In `repeat_interleave`, the `output_size` argument (30364) must be the same as the sum of the elements in the `repeats` tensor (30365).

Strange issue
routed_input.shape[0] == 30364 # number of
num_tokens_per_expert_group.sum() == 30365

This would imply the CPU splits used to allocate the all-to-all output disagree with the CUDA count tensor later used for permutation

This reverts commit e917ff4.

stack-info: PR: #3335, branch: xmfan/stack/32
@xmfan
xmfan force-pushed the xmfan/stack/32 branch from 5095205 to 73fe5ee Compare May 13, 2026 00:28
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 13, 2026

@tianyu-l tianyu-l left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we add TODO in code / create an issue for followup?

@xmfan
xmfan merged commit 7b418ab into main May 13, 2026
30 of 33 checks passed
saforem2 added a commit to saforem2/torchtitan that referenced this pull request May 13, 2026
… revert

Three-commit upstream merge (HEAD ee4e91a):

- 6f2fa2f [rl] switch to vllm v2 engine (pytorch#3330)
- 7b418ab Revert "Avoid repeat_interleave output-size sync (pytorch#3274)" (pytorch#3335)
  — restores prior token_dispatcher behavior after the optimization
  broke deepseek_v3 at high EP
- 1a22c2d [graph_trainer] Remove deprecated AOT compile mode (pytorch#3327)

Zero ezpz files touched. No replay needed. All flavors
(agpt_{debugmodel,2b,2b_real,20b,80b,80b_real},
moe_{debugmodel,500m,10B_2B_sdpa}) build cleanly post-merge.
@aditvenk

aditvenk commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

should we add TODO in code / create an issue for followup?

Filed #3478

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td 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.

4 participants