Skip to content

Conversation

@hshahTT
Copy link

@hshahTT hshahTT commented Jul 18, 2025

Adds an environment variable CONVERT_SHLO_TO_SHARDY that does 2 things:

  • Uses V2 sharding annotations when generating the GSPMD SHLO module (i.e., in V1 a mesh annotation string like: devices=[2,1,4]0,1,2,3,4,5,6,7 becomes this in V2: devices=[2,1,4]<=[8]).
  • Converts the new GSPMD module with the V2 annotations into a Shardy module.

hshahTT added 24 commits June 19, 2025 13:38
@hshahTT hshahTT requested a review from AleksKnezevic July 18, 2025 18:02
return t

op_sharding = mesh.get_op_sharding(partition_spec)
if os.environ.get('CONVERT_SHLO_TO_SHARDY', False):

Choose a reason for hiding this comment

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

should this be hidden under a different env var or does shardy inherently only understand V2?

Copy link
Author

Choose a reason for hiding this comment

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

Shardy only understands V2. I wasn't able to get the pass working with a V1 graph, and also Kevin mentioned that V2 is a required work item for getting the Shardy pass working: pytorch#9348 (comment)

Choose a reason for hiding this comment

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

ok, awesome, then it can remain under the CONVERT_SHLO_TO_SHARDY flag.

@hshahTT hshahTT merged commit 62e9704 into master Jul 18, 2025
hshahTT added a commit that referenced this pull request Aug 30, 2025
…n PyTorch/XLA (#1)

Adds an environment variable CONVERT_SHLO_TO_SHARDY that does 2 things:

- Uses V2 sharding annotations when generating the GSPMD SHLO module (i.e., in V1 a mesh annotation string like: devices=[2,1,4]0,1,2,3,4,5,6,7 becomes this in V2: devices=[2,1,4]<=[8]).
- Converts the new GSPMD module with the V2 annotations into a Shardy module.
hshahTT added a commit that referenced this pull request Sep 7, 2025
…n PyTorch/XLA (#1)

Adds an environment variable CONVERT_SHLO_TO_SHARDY that does 2 things:

- Uses V2 sharding annotations when generating the GSPMD SHLO module (i.e., in V1 a mesh annotation string like: devices=[2,1,4]0,1,2,3,4,5,6,7 becomes this in V2: devices=[2,1,4]<=[8]).
- Converts the new GSPMD module with the V2 annotations into a Shardy module.
hshahTT added a commit that referenced this pull request Oct 3, 2025
…n PyTorch/XLA (#1)

Adds an environment variable CONVERT_SHLO_TO_SHARDY that does 2 things:

- Uses V2 sharding annotations when generating the GSPMD SHLO module (i.e., in V1 a mesh annotation string like: devices=[2,1,4]0,1,2,3,4,5,6,7 becomes this in V2: devices=[2,1,4]<=[8]).
- Converts the new GSPMD module with the V2 annotations into a Shardy module.
hshahTT added a commit that referenced this pull request Oct 3, 2025
…n PyTorch/XLA (#1)

Adds an environment variable CONVERT_SHLO_TO_SHARDY that does 2 things:

- Uses V2 sharding annotations when generating the GSPMD SHLO module (i.e., in V1 a mesh annotation string like: devices=[2,1,4]0,1,2,3,4,5,6,7 becomes this in V2: devices=[2,1,4]<=[8]).
- Converts the new GSPMD module with the V2 annotations into a Shardy module.
sshonTT pushed a commit that referenced this pull request Oct 3, 2025
…n PyTorch/XLA (#1)

Adds an environment variable CONVERT_SHLO_TO_SHARDY that does 2 things:

- Uses V2 sharding annotations when generating the GSPMD SHLO module (i.e., in V1 a mesh annotation string like: devices=[2,1,4]0,1,2,3,4,5,6,7 becomes this in V2: devices=[2,1,4]<=[8]).
- Converts the new GSPMD module with the V2 annotations into a Shardy module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants