Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize
host_local_array_to_global_array
by caching the local to g…
…lobal conversion and flattening of axis resources. Also take a fast path for device_put which does not do `abstractify` and only canonicalize_dtype on the entire array once (instead of doing it for every shard). This results in a 5x speedup! Before: ``` --------------------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------------------- host_local_array_to_global_array 3.03 ms 3.02 ms 220 ``` After: ``` --------------------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------------------- host_local_array_to_global_array 0.673 ms 0.671 ms 985 ``` PiperOrigin-RevId: 489880547
- Loading branch information
Showing
2 changed files
with
51 additions
and
14 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