Overview of Tensor Parallelism examples
mainThis directory provides demonstrations of SPMD Megatron-LM style Tensor Parallelism using PyTorch native Tensor Parallel APIs. The examples cover three progressive levels of complexity:
- Simple module-level Tensor Parallelism: Demonstrated on a dummy MLP model.
- Tensor Parallelism with Sequence Parallel: Demonstrates module-level parallelism with Sequence Parallel inputs and outputs on a dummy MLP model.
- FSDP + Tensor Parallel: An end-to-end (E2E) demonstration combining Fully Sharded Data Parallel (FSDP) and Tensor Parallel (including Sequence Parallel) using a Llama2 model.
For detailed technical documentation on the underlying APIs, refer to the official PyTorch distributed.tensor.parallel documentation.