Skip to content

Remove unnecessary all-gather qwen3 - #1870

Merged
wwwjn merged 2 commits into
mainfrom
fix-qwen3-parallel
Oct 14, 2025
Merged

wwwjn merged 2 commits into
mainfrom
fix-qwen3-parallel

Conversation

@wwwjn

@wwwjn wwwjn commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

As #1867 , thanks @yanboliang for pointing out!

Before the change:
Screenshot 2025-10-13 at 10 08 07 PM

After the change:
Screenshot 2025-10-13 at 10 08 30 PM

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 14, 2025

@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.

Could you show bitwise identity before / after the change?

@wwwjn

wwwjn commented Oct 14, 2025 •

Copy link
Copy Markdown
Contributor Author

Could you show bitwise identity before / after the change?

Nice catch! The loss is really high maybe because the seed checkpoint is initialized not properly (I set seed=0 which is not necessary).

After the change: Screenshot 2025-10-13 at 10 22 34 PM

Before the change:
Screenshot 2025-10-13 at 10 23 02 PM

@tianyu-l tianyu-l linked an issue Oct 14, 2025 that may be closed by this pull request

@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.

I'm a bit concerned by the loss being high.

Does it suggest our init_weights is not realistic? Did we miss something?

Also what parallel setup did you use for the two runs? I'm assuming they include TP.

@wwwjn

wwwjn commented Oct 14, 2025

Copy link
Copy Markdown
Contributor Author

I'm a bit concerned by the loss being high.

Does it suggest our init_weights is not realistic? Did we miss something?

Also what parallel setup did you use for the two runs? I'm assuming they include TP.

I re-tested without seed =0 , I don't think that's the reason. The 2 runs are both FSDP=2 TP=2, starting from the same seed checkpoint.

The seed checkpoint was initialized on CPU with following command, and the high loss is reproducible with the seed checkpoint created in following command:

NGPU=1 CONFIG_FILE="./torchtitan/models/qwen3/train_configs/qwen3_0.6b.toml" ./run_train.sh --checkpoint.enable --checkpoint.create_seed_checkpoint --parallelism.data_parallel_replicate_degree 1 --parallelism.data_parallel_shard_degree 1 --parallelism.tensor_parallel_degree 1 --parallelism.pipeline_parallel_degree 1 --parallelism.context_parallel_degree 1 --parallelism.expert_parallel_degree 1

However, if we don't start from the seed checkpoint and initialized on GPU and distributed settings, the loss looks normal

@fegin

fegin commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

Have we verified qwen3 checkpoint? Can this be a checkpoint issue?

@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.

How about other seed than 0?

I think it's fine to merge this PR for now, but could you create an issue to track this abnormal behavior?

@wwwjn

wwwjn commented Oct 14, 2025

Copy link
Copy Markdown
Contributor Author

Have we verified qwen3 checkpoint? Can this be a checkpoint issue?

I think it's more like a initialize issue, I will investigate more later and create an issue first

@wwwjn
wwwjn merged commit 8c1d1c5 into main Oct 14, 2025
githubsgi pushed a commit to githubsgi/torchtitan that referenced this pull request Oct 15, 2025
xrsrke pushed a commit to NousResearch/torchtitan that referenced this pull request Feb 13, 2026
As pytorch#1867 , thanks @yanboliang for pointing out!

Before the change:
<img width="1547" height="714" alt="Screenshot 2025-10-13 at 10 08
07 PM"
src="https://github.com/user-attachments/assets/d818e4b0-ec30-4d13-a85b-16b4b7aab42b"
/>

After the change:
<img width="1547" height="714" alt="Screenshot 2025-10-13 at 10 08
30 PM"
src="https://github.com/user-attachments/assets/7d2fe949-0a16-4900-9607-d3d85e467261"
/>
xrsrke pushed a commit to NousResearch/torchtitan that referenced this pull request Feb 25, 2026
As pytorch#1867 , thanks @yanboliang for pointing out!

Before the change:
<img width="1547" height="714" alt="Screenshot 2025-10-13 at 10 08
07 PM"
src="https://github.com/user-attachments/assets/d818e4b0-ec30-4d13-a85b-16b4b7aab42b"
/>

After the change:
<img width="1547" height="714" alt="Screenshot 2025-10-13 at 10 08
30 PM"
src="https://github.com/user-attachments/assets/7d2fe949-0a16-4900-9607-d3d85e467261"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Qwen3 model parallel including unnecessary all_gather

3 participants