Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First attempt to enable auto-sharding. This CL adds support for GDA (…
…no SDA support yet). An example of using auto sharding with GDA: ``` f = pjit(lambda x: x, in_axis_resources=pjit.AUTO, out_axis_resources=pjit.AUTO) sharding_info = pjit.get_sharding_from_xla(f, mesh, [(8, 2)], [np.int32]) inputs = [GlobalDeviceArray.from_callback(shape, mesh, ip, cb) for ip in sharding_info.in_pspec] # Use the compiled function (which was compiled in get_sharding_from_xla) out = sharding_info.compiled(*inputs) # Recommended way! # OR out = f(*inputs) ``` PiperOrigin-RevId: 438708483
- Loading branch information
Showing
4 changed files
with
284 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.