pytorch/test/distributed/_composable
Will Feng bc9597b7d8 [Traceable FSDP2] Minor refactor to traceable FSDP2 unit tests (#136219)
Changes in this PR:
- Monkey-patching `F.scaled_dot_product_attention` with a lambda seems to not work in some cases. This PR avoids using a lambda.
- Running `fullgraph=True` and `fullgraph=False` in the same unit test seems to cause the two cases to interfere with each other and causes error. This PR splits them into two separate unit tests.
- The checks in the unit tests might not work with compile cache. This PR turns off the cache in order to have a more predictable compile behavior to do unit test on.

Test commands:
- `pytest -rA test/distributed/_composable/fsdp/test_fully_shard_compile.py::TestFullyShardCompile::test_nested_fully_shard_backend_inductor_fullgraph_True`
- `pytest -rA test/distributed/_composable/fsdp/test_fully_shard_compile.py::TestFullyShardCompile::test_nested_fully_shard_backend_inductor_fullgraph_False`
- `pytest -rA test/distributed/_composable/fsdp/test_fully_shard_compile.py::TestFullyShardCompile::test_transformer_backend_inductor_fullgraph_True`
- `pytest -rA test/distributed/_composable/fsdp/test_fully_shard_compile.py::TestFullyShardCompile::test_transformer_backend_inductor_fullgraph_False`

Pull Request resolved: https://github.com/pytorch/pytorch/pull/136219
Approved by: https://github.com/yifuwang
2024-09-18 22:30:23 +00:00
..
fsdp [Traceable FSDP2] Minor refactor to traceable FSDP2 unit tests (#136219) 2024-09-18 22:30:23 +00:00
fully_shard Revert "Add Triton CPU as an Inductor backend (#133408)" 2024-09-16 18:33:33 +00:00
test_composability [DCP][DSD] Add a test case to demonstrate the workaround to load full state dict into a 2D model (#135763) 2024-09-13 03:51:14 +00:00
test_checkpoint.py
test_compose.py
test_contract.py
test_replicate.py [DDP][FSDP2] keep DTensor params for replicate(fully_shard) (#133059) 2024-08-09 18:38:05 +00:00
test_replicate_with_compiler.py Fix ROCm skip decorator for test_ddp_tp and multiprocess UTs (#136161) 2024-09-18 11:01:23 +00:00