Optimization

Optimization#

Explore techniques for maximizing performance, including model customization, sharding strategies, Pallas kernels, and benchmarking.

๐Ÿ› ๏ธ Customizing Model Configs

Optimize and customize your LLM model configurations for higher performance (MFU) on TPUs.

Customizing model configs for TPUs
๐Ÿฅž Sharding Strategies

Choose efficient sharding strategies (FSDP, TP, EP, PP) using Roofline Analysis and understand arithmetic intensity.

Sharding on TPUs
โšก Pallas Kernels

Optimize with Pallas kernels for fine-grained control.

Optimizing with Pallas kernels
๐Ÿ“ˆ Benchmarking & Tuning

Guide to setting up benchmarks, performing performance tuning, and analyzing metrics.

Benchmarking & tuning guide
๐Ÿ” FSDP Weight Prefetching

Overlap the FSDP all-gather of the next layerโ€™s weights with the current layerโ€™s compute.

FSDP weight prefetching
๐Ÿ”€ Shard Mode: explicit vs auto

Measured HLO and xprof comparison of shard_mode: explicit against shard_mode: auto on the onboarded models.

shard_mode: explicit vs shard_mode: auto โ€” a measured performance analysis