Skip to content

[CP] Use non-CP seed configs for numerics tests - #4608

Merged
tianyu-l merged 2 commits into
gh/fegin/169/basefrom
gh/fegin/169/head
Sep 12, 2026
Merged

tianyu-l merged 2 commits into
gh/fegin/169/basefrom
gh/fegin/169/head

Conversation

@fegin

@fegin fegin commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

loss_compare.py compares a baseline config and a test config. It already supports a separate seed config, but the integration test code previously let it default to the baseline config. This stopped working after CP became a config transform. The inner attention is swapped with a parallelized one and seed checkpoint run set CP degree to 1. The validation will raise.

This PR fixes the problem

[ghstack-poisoned]
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 11, 2026
fegin added a commit that referenced this pull request Sep 11, 2026
Stack from [ghstack](https://github.com/ezyang/ghstack/tree/0.15.0)
(oldest at bottom):
* #4459
* #4608
* __->__ #4450

Add Ulysses CP with S(0)-to-S(1) all-to-all reshards around
FlexAttention.

Keep its attention mask global, reject load balancing, and validate that
attention heads are divisible by the combined TP and CP degree.
Consolidate CP config validation and reject GPT-OSS because its per-head
sinks are not sharded across CP.

Add unit and integration tests.
Comment thread tests/integration_tests/__init__.py Outdated
Comment on lines +41 to +42
seed_config: Callable[[], Trainer.Config] | None = None
"""Model-equivalent config used to create the seed checkpoint."""

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.

CP recipes install CP attention before command-line overrides are applied.

I didn't understand the change. What CLI override are you talking about? Since we are going to deprecate CLI, we shouldn't adapt to them.

Maybe some more context would be helpful

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is not about TorchTitan's CLI. It is about the commands run internally by loss_compare.py. loss_compare.py compares a baseline config and a test config. It already supports a separate seed config, but the integration test code previously let it default to the baseline config. This stopped working after CP became a config transform. The inner attention is swapped with a parallelized one and seed checkpoint run set CP degree to 1. The validation will raise.

I update the comment

[ghstack-poisoned]
@fegin
fegin requested a review from tianyu-l September 11, 2026 22:16
timeout: int | None = None
golden_numerics_path: str | None = None
"""Run through loss_compare.py using this mode-specific golden path."""
seed_config: Callable[[], Trainer.Config] | None = None

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.

to make it sounding less ambiguous, maybe

Suggested change
seed_config: Callable[[], Trainer.Config] | None = None
loss_compare_seed_config: Callable[[], Trainer.Config] | None = None

@tianyu-l
tianyu-l merged commit 89c5e0c into gh/fegin/169/base Sep 12, 2026
9 checks passed
@tianyu-l

Copy link
Copy Markdown
Contributor

uh... sorry I clicked merging ...

@tianyu-l

Copy link
Copy Markdown
Contributor

fixing in #4627

@tianyu-l
tianyu-l deleted the gh/fegin/169/head branch September 12, 2026 22:10
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.

3 participants