Skip to content
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

Add reshard API in experimental. Currently for sharding_in_types we have 2 APIs: mesh_cast and reshard. Both work in sharding_in_types mode and affect the sharding of the aval. Following are the semantics of both: #25978

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

copybara-service[bot]
Copy link

Add reshard API in experimental. Currently for sharding_in_types we have 2 APIs: mesh_cast and reshard. Both work in sharding_in_types mode and affect the sharding of the aval. Following are the semantics of both:

  • mesh_cast: AxisTypes between src and dst mesh must differ. There should be no "visible" data movement. The shape of the aval doesn't change.

  • reshard: Mesh should be the same between src and dst (same axis_names, axis_sizes and axis_types). Data movement is allowed. The shape of the aval doesn't change.

We might make reshard == device_put, hence the API is in experimental. This decision can be taken at a later point in time. The reason not to just give device_put this power is because device_put does a lot of stuff right now (and is going to get even more powers in the near future like cross-host transfers) and it's semantics would be very confusing if we keep piling sharding-in-types stuff on it.

@copybara-service copybara-service bot force-pushed the test_716879595 branch 2 times, most recently from 8a2850b to c69e51d Compare January 20, 2025 19:30
… have 2 APIs: `mesh_cast` and `reshard`. Both work in sharding_in_types mode and affect the sharding of the aval. Following are the semantics of both:

* `mesh_cast`: AxisTypes between src and dst mesh **must** differ. There should be **no "visible" data movement**. The shape of the aval doesn't change.

* `reshard`: Mesh should be the **same** between src and dst (same axis_names, axis_sizes and axis_types). **Data movement is allowed**. The shape of the aval doesn't change.

We might make `reshard` == `device_put`, hence the API is in experimental. This decision can be taken at a later point in time. The reason not to just give `device_put` this power is because `device_put` does a lot of stuff right now (and is going to get even more powers in the near future like cross-host transfers) and it's semantics would be very confusing if we keep piling sharding-in-types stuff on it.

PiperOrigin-RevId: 717588253
@copybara-service copybara-service bot merged commit 799eb98 into main Jan 20, 2025
@copybara-service copybara-service bot deleted the test_716879595 branch January 20, 2025 19:39
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.

1 participant