Skip to content

[spmd_types] llama3 enablement - #3763

Merged
pianpwk merged 17 commits into
mainfrom
gh/pianpwk/52/head
Jun 26, 2026
Merged

pianpwk merged 17 commits into
mainfrom
gh/pianpwk/52/head

Conversation

pianpwk added 2 commits June 23, 2026 23:06
[ghstack-poisoned]
[ghstack-poisoned]
has_compile = any("compile.enable" in arg for arg in variant)
if not _is_pp_only(variant, t.ngpu) and not (has_cp and has_compile):
prefix.append("--parallelism.spmd_backend full_dtensor")
prefix.append(f"--parallelism.spmd_backend {backend}")

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.

actually shall enable debug.spmd_typechecking for those without PP, or SAC + Flex?

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.

keeping a list of tests to skip typechecking on

pianpwk added 3 commits June 24, 2026 09:08
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@pianpwk pianpwk changed the title Enable Llama3 SPMD backend integration [spmd_types] llama3 enablement Jun 24, 2026
prefix.append(f"--parallelism.spmd_backend {backend}")
if (
backend == "spmd_types"
and not has_ac_mode

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.

a lot of times default is SAC

  • is this switching everything to none AC?
  • I thought spmd_types work with SAC / full AC in general, just not SAC + flex

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.

yeah so I wasn't sure, I guess we can filter for flex but I think it's the default for llama3 now? either we can do

  1. test everything with typechecking + no AC
  2. test everything with SAC but no typecheck
  3. do both 1 & 2 but add decent CI workload

but either should pass, minus the filtered tests

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.

oh I see.
1 sounds OK, because we are still testing AC with the non-supported ones, right?

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

CI failed with

Last 50 lines:
      return func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/distributed/fsdp/_fully_shard/_fsdp_param.py", line 270, in _init_sharded_param
      param_data = self._init_sharding_spec(param, fsdp_placement, shard_dim)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/distributed/fsdp/_fully_shard/_fsdp_param.py", line 346, in _init_sharding_spec
      raise ValueError(
  ValueError: When dp_mesh_dims is provided, all parameters must be DTensors on the full SPMD mesh (e.g. via distribute_module). Got plain tensor for parameter 'weight'.

I guess because pytorch side change hasn't taken effect in nightly.

prefix.append(f"--parallelism.spmd_backend {backend}")
if (
backend == "spmd_types"
and not has_ac_mode

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.

oh I see.
1 sounds OK, because we are still testing AC with the non-supported ones, right?

@pianpwk

pianpwk commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

because we are still testing AC with the non-supported ones, right?

yeah good point, those are spmd backend + no typecheck + default AC unless specified

pianpwk added 2 commits June 25, 2026 09:28
[ghstack-poisoned]
[ghstack-poisoned]
pianpwk added 3 commits June 25, 2026 10:16
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@pianpwk
pianpwk changed the base branch from gh/pianpwk/52/base to main June 25, 2026 21:56
pianpwk added 2 commits June 25, 2026 15:34
[ghstack-poisoned]
[ghstack-poisoned]
@pianpwk
pianpwk changed the base branch from main to gh/pianpwk/52/base June 25, 2026 23:00
pianpwk added 2 commits June 25, 2026 16:02
[ghstack-poisoned]
[ghstack-poisoned]
@pianpwk
pianpwk changed the base branch from gh/pianpwk/52/base to main June 25, 2026 23:03
@pianpwk
pianpwk changed the base branch from main to gh/pianpwk/52/base June 25, 2026 23:16
pianpwk added 2 commits June 25, 2026 16:16
[ghstack-poisoned]
[ghstack-poisoned]
@pianpwk
pianpwk changed the base branch from gh/pianpwk/52/base to main June 26, 2026 01:34
@pianpwk
pianpwk merged commit 0a4aa45 into main Jun 26, 2026
8 of 11 checks passed
submartingales pushed a commit to botcanlearn/torchtitan-upstream that referenced this pull request Jun 26, 2026
ghstack-source-id: 781b4e6
ghstack-source-id: 781b4e6
Pull Request resolved: pytorch/torchtitan#3763
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