Skip to content

Prototype API to build global tensor using local processes #8842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pgmoka opened this issue Mar 17, 2025 · 2 comments · May be fixed by #8932
Open

Prototype API to build global tensor using local processes #8842

pgmoka opened this issue Mar 17, 2025 · 2 comments · May be fixed by #8932
Assignees
Labels
distributed SPMD and other distributed things. enhancement New feature or request

Comments

@pgmoka
Copy link
Collaborator

pgmoka commented Mar 17, 2025

As a sub-item for enabling 2D sharding with minibatch=True, we want to create a protoype of SPMD that uses local batching. This will hopefully be the beginning of an implementation that might substitute the current workaround.

@pgmoka pgmoka added the distributed SPMD and other distributed things. label Mar 17, 2025
@pgmoka pgmoka self-assigned this Mar 17, 2025
@ysiraichi ysiraichi added the enhancement New feature or request label Mar 18, 2025
@pgmoka pgmoka changed the title Prototype SPMD using local process data Prototype API to build global tensor using local processes Mar 27, 2025
@pgmoka
Copy link
Collaborator Author

pgmoka commented Apr 3, 2025

We plan on creating this prototype based on the existing mark_sharding. We need an API such that each host TransferShardsToDevice for the devices they are associated with. We can consider the existing pipeline for mark_sharding:

mark_sharding -> _xla_mark_sharding -> XlaMarkSharding -> CreateTensorsData -> CreateShardedData -> TransferShardsToDevice

In our prototype, we will do something like:

create_global_tensor_from_local_process_data -> _create_global_tensor_from_local_process_data -> XlaGlobalTensorFromLocalProcessData -> CreateGlobalTensorData -> CreateGlobalShardedData -> TransferShardsToDevice

@pgmoka pgmoka linked a pull request Apr 3, 2025 that will close this issue
@pgmoka
Copy link
Collaborator Author

pgmoka commented Apr 15, 2025

I am still working on this prototype; I wanted to give a follow-up in the progress:

I have done an attempt of prototyping by just trying to create CreateGlobalTensorData -> CreateGlobalShardedData -> TransferShardsToDevice, and creating something like load_local_shards_. I however ran into a series of issues related object creation.

I have increased the scope of this prototype for the entire flow cited in #8842 (comment).

I have ran into a couple type coversion issues with xla::Shape, but I currently believe there is a path forward by leveraging xla::ShapeUtil::MakeShape. This will hopefully unblock us to run some tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distributed SPMD and other distributed things. enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants