-
Notifications
You must be signed in to change notification settings - Fork 360
[Feature] Support TPU backend for ShardParallel #764
Conversation
One quick Q: how do we run TPU tests in CI? |
Google provides free TPU access for several days, but I've already extended the time twice(in the first extension they gave me 90 days and the second has 180 days). Can we use that machine for CI? |
@merrymercy hey, it seems all the tpu specific tests are being skipped (on mobile, will provide a link soon). |
Currently we skip all tests other than those for ShardParallel/reduce-scatter optimization. You can see we rewrite all tests other than tests such as |
Not all test case are skipped. The current code can pass these test cases on TPU alpa/tests/tpu/test_shard_parallel.py Lines 99 to 110 in e710f21
|
This PR:
has_cuda
andbackend
inglobal_config
IS_CUDA
insetup.py
run_auto_sharding_pass
andrun_backend_compilation
: the output of therun_auto_sharding_pass
and input ofrun_backend_compilation
is no longer the spmd-partitioned module, but instead the sharding annotated module. This is because TPU cannot compile an spmd-partitioned module with sharding configurations;AllReduce
toReduceScatter
andAllGather
is after SPMD partitioner, so we cannot do it for the tpu backend.