Repository navigation
Conversation
|
🤖 Hi @darisoy, I'm running an automatic MaxText review of this pull request. You can track my progress in the logs. To request another review later, add the |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request updates the FSDP weight prefetching documentation to reflect recent architectural improvements. It provides detailed guidance on handling complex, inhomogeneous model blocks, configuring expert and context parallelism, and applying optimal XLA flags to maximize performance on TPU hardware. The changes include updated usage examples and performance tables to help users achieve better throughput and HBM efficiency. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
📋 Review Summary
Verdict: No significant issues found. The documentation update is highly precise, accurate, and comprehensively details the recent FSDP prefetching improvements and best practices.
Inferred spec & validation
- Sources: PR description, code before/after.
- Problem: FSDP weight prefetching documentation needs updating to reflect new features (symmetric scan, inhomogeneous block prefetching, co-sharded axes, and
moe_flat_fsdp_weights).
| Spec item | Implementation | Validating test |
|---|---|---|
Document symmetric unroll=2 scan |
✅ | docs/guides/optimization/fsdp_prefetch.md ✅ |
| Document inhomogeneous sub-layer scans | ✅ | docs/guides/optimization/fsdp_prefetch.md ✅ |
| Document expert & context parallelism sharding | ✅ | docs/guides/optimization/fsdp_prefetch.md ✅ |
| Provide recommended MaxText and XLA flags | ✅ | docs/guides/optimization/fsdp_prefetch.md ✅ |
f1ec5bf to
db4c1f1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
0d108b7 to
d0df57c
Compare
d0df57c to
28ea4a4
Compare
…on/fsdp_prefetch.md`) - Add forward-pass timeline diagrams without and with weight prefetching - Document inhomogeneous nested sub-layer scans and `unroll=2` double buffering (#5865, #5922) - Document `prefetch_fsdp_defer_grad_reduce_scatter=True` for homogeneous and inhomogeneous blocks (#5973, #5994) - Document expert/context co-sharding (#5848), `moe_flat_fsdp_weights=True` (#5890), `moe_gmm_v2_dlhs_transpose_rhs=True`, `moe_use_direct_token_gather=True`, and XLA flags - Update DeepSeek-V3 and Qwen3.5 benchmark tables
28ea4a4 to
537e84d
Compare
Summary
Updates the FSDP weight prefetching guide (
docs/guides/optimization/fsdp_prefetch.md) with recent optimizations, visual forward and backward timelines, and TPU7x benchmark results:docs/_static/fsdp_*_overview.svg) comparingprefetch_fsdp_weights=Falsevs.prefetch_fsdp_weights=True(withprefetch_fsdp_defer_grad_reduce_scatter=Truein the backward pass) across TensorCore, Dedicated FSDP SparseCore 0, and SparseCore 1.reduce-scatter(prefetch_fsdp_defer_grad_reduce_scatter=True): Explains why gathering weights withto="reduced"(returningunreducedper-device weight gradients fromjax.vjp) and pinningscatter_dimas major-most (_pin_scatter_dim_major) allow a single SparseCorereduce-scatter, and documents how carrying step k'sunreducedweight gradients in the backwardscancarry and issuing theirxla_explicit_fsdp-taggedpsum_scatterat the start of step k−1 hides backward FSDPreduce-scatters alongside the prefetchall-gathers on the dedicated FSDP SparseCore.whileloops so interior sub-layers share anunroll=2double-buffered inner scan ([GDN 0, GDN 1] → [GDN 2] → [attention]in forward, and[attention] → [GDN 2] → [GDN 1] → [GDN 0]with deferred backwardreduce-scatteron Qwen3.5).gmm_v2flags (moe_gmm_v2_dlhs_transpose_rhs=Trueandmoe_use_direct_token_gather=True): Documents eliminating explicit backwarddlhsRHS weight-transpose copies and token-replication data formatting once FSDP collectives are hidden.DeepSeek-V3FSDP-only at−34.2%,DeepSeek-V3withEP=4at−38.1%, andQwen3.5-35B-A3Binhomogeneous nested scan at−25.1%) alongside detailed ablation tables.Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.