Skip to content

[spmd_types] raise on SAC + Flex + typechecking - #3672

Merged
pianpwk merged 16 commits into
mainfrom
gh/pianpwk/41/head
Jun 17, 2026
Merged

[spmd_types] raise on SAC + Flex + typechecking#3672
pianpwk merged 16 commits into
mainfrom
gh/pianpwk/41/head

Conversation

@pianpwk

@pianpwk pianpwk commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

SAC + Flex, or SAC + typecheck + non-flex, or typecheck + Flex + full/no AC is fine, but this is not (likely SAC + regional inductor issue, cache missing on flex region during recompute, due to typechecking global state change? No sure, raising temporarily while we figure this out, asking to use the other available options

Stack from ghstack (oldest at bottom):

pianpwk added 2 commits June 15, 2026 00:01
[ghstack-poisoned]
[ghstack-poisoned]
pianpwk added 2 commits June 15, 2026 10:18
[ghstack-poisoned]
[ghstack-poisoned]
from torchtitan.tools.logging import logger


def _checkpoint_contexts_without_recompute_typecheck(context_fn):

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.

maybe

Suggested change
def _checkpoint_contexts_without_recompute_typecheck(context_fn):
def _no_spmd_typecheck_in_recompute(context_fn):

pianpwk added 6 commits June 15, 2026 23:54
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
submartingales pushed a commit to botcanlearn/torchtitan-upstream that referenced this pull request Jun 16, 2026
pianpwk added a commit that referenced this pull request Jun 16, 2026
Moves full_dtensor backend off pytorch's loss_parallel -> our custom
autograd fn

Stack from [ghstack](https://github.com/ezyang/ghstack/tree/0.12.0)
(oldest at bottom):
* #3673
* #3655
* #3654
* #3653
* #3278
* #3672
* #3472
* #3632
* __->__ #3671
pianpwk added 2 commits June 16, 2026 16:22
[ghstack-poisoned]
[ghstack-poisoned]
@pianpwk pianpwk changed the title [spmd_types] disable typecheck for SAC [spmd_types] raise on SAC + Flex + typechecking Jun 16, 2026
@pianpwk
pianpwk marked this pull request as ready for review June 16, 2026 23:30
@pianpwk
pianpwk requested review from fegin, wconstab and wwwjn as code owners June 16, 2026 23:30
pianpwk added 2 commits June 16, 2026 16:31
[ghstack-poisoned]
[ghstack-poisoned]
Comment thread torchtitan/trainer.py Outdated
Comment on lines +114 to +116
@staticmethod
def _uses_flex_attention(config: Configurable.Config) -> bool:
return any(config.traverse(FlexAttention.Config))

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.

no need to introduce this function

Comment thread torchtitan/trainer.py
and self.model_spec is not None
and self._uses_flex_attention(self.model_spec.model)
):
raise ValueError(

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.

add a TODO, o/w sounds defeated

pianpwk added 2 commits June 16, 2026 20:37
[ghstack-poisoned]
[ghstack-poisoned]
@pianpwk
pianpwk changed the base branch from gh/pianpwk/41/base to main June 17, 2026 03:41
@pianpwk
pianpwk merged commit eb27b0f into main Jun 17, 2026
8 of 11 checks passed
submartingales pushed a commit to botcanlearn/torchtitan-upstream that referenced this pull request Jun 17, 2026
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.

2 participants