potentialpaper

FlashMask-3: Efficient and Expressive Mask-Aware Distributed Attention

Guoxia Wang, Qianyue He, Siming Wu, Haoyang Xie, Qiwen Bao, Jinle Zeng, Jiabin Yang, TIAN WU, Dianhai Yu

NeurIPS 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. Long-context training of large language and multimodal models couples expressive structured attention masks (document, prefix-LM, share-question, sliding-window, block-sparse) with multi-node context parallelism, exposing the mask as a dominant bottleneck. The column-wise sparse mask of FlashMask compresses such masks from O(n2)O(n^2) to O(n)O(n) via four query-axis boundary vectors and covers a broad family of structured patterns. Implemented for Ampere GPUs, FlashMask does not exploit FlashAttention-3's TMA/WGMMA warp-specialized pipeline on Hopper GPUs, and offers no distributed support. We observe that the column-wise sparse mask is indexed by key positions but stores query-axis interval boundaries. Under any multi-chunk context-parallel assignment, this property reduces per-rank mask localization to a provably zero-communication \emph{clip--shift--max} on the boundary vectors, directly compatible with the single-GPU kernel. Building on this property, FlashMask-3 introduces a mask-aware Hopper kernel with a three-role warp specialization atop the FlashAttention-3 TMA/WGMMA pipeline, together with a mask-aware distributed extension: zero-communication mask localization, a sparsity-aware load balancer (HCC-IPO), and a mask-aware compute-communication overlap with mask-driven communication pruning, whose forward all-gather additionally adopts topology-aware hierarchical routing. On a single H100 GPU across 12 structured masks at context lengths from 4K to 128K, FlashMask-3 improves achieved TFLOPs over FlashMask, FlexAttention, and MagiAttention by 45% to 141%, 34% to 71%, and 2% to 44%, respectively. Under context-parallel degrees from 4 to 32 with 8K sequence per device, it attains 31% to 75% compute-communication overlap efficiency and improves throughput over Megatron-Core CP (ring), Megatron-Core CP (all-gather) and MagiAttention by 1.80×1.80\times to 3.71×3.71\times, 1.71×1.71\times to 2.92×2.92\times and 1.09×1.09\times to 1.46×1.46\times respectively. In end-to-end training of a 118B-A14B MoE model at a 128K context on 128 H100 GPUs, it raises throughput by 7.3% to 11.0% over a Dual Chunk all-gather baseline, with attention forward+backward 24.5% to 44.9% faster. The source code is available at \url{https://github.com/PaddlePaddle/FlashMask}.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
4 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]PDF[1]
Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:50 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
Meta-review

I have read the authors' responses, which addressed all five priorities from the initial meta-review with new experiments: (1) end-to-end 128-GPU pretraining evidence (tokens/s/GPU with component ablations showing the necessity of hierarchical communication at cross-node scale); (2) a direct FlashAttention-3 head-to-head on the masks FA3 supports, plus a three-way ablation separating the Hopper-port gains from the FlashMask-3-specific KV Index Generator; (3) a characterization of communication pruning under packed batches - including the authors' correction of a reporting error (the CP experiments used weak scaling with global batch B=32/P, not B=1); (4) reconciled speedup reporting (the appendix numbers came from an early measurement run and are corrected); and (5) quantified scheduler/preprocessing overhead, prefetched off the critical path at 0.60-0.75% of a step. Reviewer_PNaG's final justification raises their score to 5 on this basis; Reviewer_FM36 rates 5; Reviewer_wuBV (4) did not return in discussion, but each of their questions received a substantive answer. Final ratings are 4/5/5.

The recommendation is Accept. The camera-ready must include: (a) the citation corrections flagged by the conference's reference check - the Child et al. sparse-transformers reference is an arXiv preprint (1904.10509), not an ICLR paper, and the USP (Fang et al.) reference lists numerous co-authors who are not authors of that paper and must be corrected; (b) the promised standard deviations, the resolved "Figure ??" reference, and the artifact/code link; and (c) the B>1/weak-scaling erratum and corrected appendix numbers.

Final justification

Final ratings 4/5/5; the rebuttal delivered new experiments on every prioritized item, and Reviewer_PNaG raised their score to 5 on that basis. Accept, with required citation corrections in the camera-ready.

Area Chair U1Vd · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

I have read the authors' responses, which addressed all five priorities from the initial meta-review with new experiments: (1) end-to-end 128-GPU pretraining evidence (tokens/s/GPU with component ablations showing the necessity of hierarchical communication at cross-node scale); (2) a direct FlashAttention-3 head-to-head on the masks FA3 supports, plus a three-way ablation separating the Hopper-port gains from the FlashMask-3-specific KV Index Generator; (3) a characterization of communication pruning under packed batches - including the authors' correction of a reporting error (the CP experiments used weak scaling with global batch B=32/P, not B=1); (4) reconciled speedup reporting (the appendix numbers came from an early measurement run and are corrected); and (5) quantified scheduler/preprocessing overhead, prefetched off the critical path at 0.60-0.75% of a step. Reviewer_PNaG's final justification raises their score to 5 on this basis; Reviewer_FM36 rates 5; Reviewer_wuBV (4) did not return in discussion, but each of their questions received a substantive answer. Final ratings are 4/5/5.

The recommendation is Accept. The camera-ready must include: (a) the citation corrections flagged by the conference's reference check - the Child et al. sparse-transformers reference is an arXiv preprint (1904.10509), not an ICLR paper, and the USP (Fang et al.) reference lists numerous co-authors who are not authors of that paper and must be corrected; (b) the promised standard deviations, the resolved "Figure ??" reference, and the artifact/code link; and (c) the B>1/weak-scaling erratum and corrected appendix numbers.

Final justification

Final ratings 4/5/5; the rebuttal delivered new experiments on every prioritized item, and Reviewer_PNaG raised their score to 5 on that basis. Accept, with required citation corrections in the camera-ready.

8 comments
Authors · CommentOpenReview ↗

Response to AC Priority 5: Scheduler / preprocessing overhead and overlap robustness (Reviewer_PNaG)

  1. (Lower priority) Standalone scheduler/preprocessing overhead and overlap robustness under sparse or small workloads (Reviewer_PNaG).

This is a fair point, and we want to be precise about where the preprocessing runs, how often it runs, and when it stops paying off. Q1, Q2 and Q3 are closely related, so we group them here. Q4 (pruning at B>1) and Q5 (component breakdown of the overlap gain) are answered in our responses to AC priorities 3 and 1.

(1) Where the scheduling cost comes from, and whether it is on the critical path (Q1). Both the w_i weight computation and the HCC-IPO assignment work on the compact boundary representation (the four boundary vectors), not on the dense mask. The cost therefore scales linearly with the sequence length, O(N), so it does not grow as the quadratic tile count the reviewer mentions.

The w_i preprocessing and the HCC-IPO scheduling are not on the critical path. For a given set of w_i the schedule output is deterministic, so we prefetch it and overlap it with the compute and communication of the previous iteration, and its latency is not exposed in the end-to-end attention time. We measured the standalone latency of this scheduling step (P=32, chunk=2048) next to the attention execution time under the same configuration. Times are mean plus or minus standard deviation over the measured runs.

Mask Attention time (ms) Total TFLOPs/s Schedule time (ms)
Causal Document 35.08 ± 4.19 496.09 42.75 ± 8.90
Document 67.44 ± 8.78 514.95 23.52 ± 6.34
Prefix LM Document 35.84 ± 4.29 503.65 43.71 ± 6.33

The standalone scheduling latency is about 23 to 42 ms, the same order as a single attention execution (about 35 to 67 ms). This is not a negligible cost, which is exactly why we prefetch it rather than run it inline, and its result is reused across layers through a bucket cache keyed on the mask pattern. To confirm that the preprocessing is fully hidden at the end-to-end level, we measured the balance preprocessing time against the full step time in the same 128-GPU MoE pretraining as our end-to-end response:

attn sparsity avg time per step (ms) avg balance preprocess time (ms) avg ratio (%)
70% 20014.2 ± 1317.6 119.9 ± 16.0 0.60%
80% 17887.3 ± 2020.8 110.1 ± 10.2 0.62%
86% 16174.8 ± 2146.6 120.6 ± 10.4 0.75%

Even though the standalone schedule cost is the same order as one attention call, once it is prefetched and overlapped it accounts for only 0.60% to 0.75% of the step.

(2) Reuse across layers, and how we handle mixed mask stacks (Q2). To be candid, the current implementation does not switch the assignment per layer inside a mixed mask stack. We make one decision before training instead. For a model whose layers use different mask types, we score each mask type, take a weighted sum over the ratio of those types in the stack, and run a single unified HCC-IPO on that aggregate profile. We then compare the predicted performance of this unified assignment against the baseline DualChunk layout, and adopt HCC-IPO for the actual run only if it is faster; otherwise we fall back to DualChunk. So the assignment is computed once, offline, and held fixed across layers during training, rather than recomputed per attention call. We should also be honest about the other side of this: if the mask type changes frequently from layer to layer, a single static assignment stops being a good fit for every layer, and re-solving at that frequency would introduce load-balancing latency that cannot be fully hidden. We list this as an applicability limitation of the method.

(3) Relation to the backend's default CP layout (Q3). HCC-IPO does not unconditionally replace the default layout. As above, the offline decision compares the unified HCC-IPO assignment against the baseline DualChunk layout and keeps HCC-IPO only when it is predicted to be faster, otherwise it falls back to DualChunk. So on workloads where the default layout is already effective, for example balanced full or causal masks, we stay on DualChunk and pay no rebalancing cost. HCC-IPO is adopted only when heterogeneous packing makes the default layout imbalanced enough that the rebalancing pays for itself.

(4) Overlap robustness under sparse or small workloads. The reviewer is right that the overlap needs enough attention compute to hide the all-gather and reduce-scatter, and that very small or very sparse contexts leave less compute to hide behind. This is the amortization caveat we noted in the Appendix A Limitations section. The behavior degrades gracefully rather than breaking: the sentinel mechanism and sm_margin=0 keep the kernel ordering deadlock-free across sparsity levels, so in the worst case the overlap simply recovers less of the communication, it does not fail.

Authors · CommentOpenReview ↗

Response to AC Priority 4: Reporting consistency (Reviewer_PNaG, Reviewer_FM36)

  1. Reporting consistency (Reviewer_PNaG, Reviewer_FM36). Please reconcile the speedup ranges between the abstract/Section 4.2 and Appendix Table 5, fix the unresolved "Figure ??" reference, add the promised standard errors, and provide the promised code/artifact link.

The reviewers are right on all four points. They are fixed in our revision and the corrections will appear in the camera-ready. We give the corrected details here.

(1) Speedup ranges. The appendix table did not match the abstract and Section 4.2. Those appendix numbers came from an early measurement run that used a different batch size and aggregation setting, and we did not update them after we settled on the final protocol. We have rerun the full context-parallel suite under one protocol (weak scaling, local KV = 8K per device, B = 32/P, H_Q = 64, H_KV = 1, CP degree from 4 to 32). The forward+backward speedups (geometric mean over all masks and CP degrees, with the observed min and max) are:

vs. baseline Min Max Geo. mean ± std
MagiAttention 1.09× 1.46× 1.26 ± 0.15×
Megatron-Core CP (ring) 1.80× 3.71× 2.42 ± 0.65×
Megatron-Core CP (all-gather) 1.71× 2.92× 2.05 ± 0.39×

The appendix table is corrected to match these values.

(2) Figure reference. The broken "Figure ??" now resolves to the CP-scaling comparison figure. This is fixed.

(3) Error bars on the results. The submitted version reported means only, even though we answered Yes on the checklist. In the revised tables we report the standard deviation across the timed runs, and every new result we add during this rebuttal is reported with its standard deviation (please see the tables in the other response boxes).

(4) Code and artifact. Because of the double-blind policy we did not include a repository link in the submission. Our code will be open-sourced, and we commit to adding the public link to the paper once it is accepted.

Authors · CommentOpenReview ↗

Response to AC Priority 3: Communication pruning at B>1 (Reviewer_PNaG)

  1. Communication pruning at B>1 (Reviewer_PNaG). The context-parallel experiments use B=1; please characterize how mask-driven communication pruning behaves with heterogeneous packed batches (skipped K/V chunk fraction and throughput).

The concern is valid. First, a clarification about the submitted paper. Sections 4.2 and D.1.2 stated that the CP experiments used B=1. That statement is a reporting error and is misleading: the runs actually used weak scaling with a global batch of B=32/P, which keeps the per-GPU attention workload B * P * L^2 approximately constant as CP scales (L=8K is the local sequence length); B reaches 1 only at P=32. The distributed benchmark results the reviewers saw in the main manuscript were therefore already at B>1 for the lower CP degrees. We have corrected the setup description to B=32/P in the revised version.

During the rebuttal we also implemented a per-batch pruning path: the skip decision is made separately for each batch element rather than over the union of the whole batch, which removes the cross-batch redundancy the reviewer described.

We measured both schemes at CP degree 32 with cross-node communication on the document mask, varying the batch size B. Each batch contains heterogeneous packed documents. In the table, "skip" is the fraction of K/V chunks skipped, "inter-node comm reduction" is how much the per-batch scheme lowers cross-node communication relative to shared-batch, and "calc peak/avg" is the compute-load peak-to-average ratio (the compute load of the most loaded rank divided by the mean over all ranks). All numbers are mean plus or minus standard deviation.

B Shared skip Per-batch skip skip △ Per-batch inter-node comm reduction Shared peak/avg Per-batch peak/avg Shared TFLOPs/s Per-batch TFLOPs/s TFLOPs/s △
1 30.02% ± 5.88% 30.02% ± 5.88% 0.00% 0.00% ± 0.00% 1.0767 ± 0.0252 1.0767 ± 0.0252 516.00 ± 5.27 515.93 ± 5.32 -0.07
2 31.52% ± 5.40% 31.90% ± 6.05% +0.37% 10.62% ± 5.56% 1.0554 ± 0.0339 1.0525 ± 0.0344 526.66 ± 9.35 520.03 ± 8.09 -6.64
3 30.90% ± 4.52% 30.40% ± 3.62% -0.50% 15.44% ± 7.91% 1.0427 ± 0.0310 1.0538 ± 0.0344 538.13 ± 5.39 526.87 ± 19.17 -11.25
4 29.35% ± 2.54% 30.39% ± 4.46% +1.04% 19.73% ± 6.38% 1.0363 ± 0.0260 1.0538 ± 0.0351 544.82 ± 2.31 531.52 ± 14.68 -13.29

First, the pruning benefit remains effective as (B) increases. Although shared-batch pruning takes the union of the communication requirements across samples, the skipped K/V chunk fraction remains around 30% from (B=1) to (B=4), rather than decreasing substantially. Meanwhile, shared-batch throughput increases from 516 to 545 TFLOPs/s. Thus, for the document masks and batch sizes evaluated here, combining the communication requirements across samples does not eliminate the available sparsity.

Second, the per-batch scheme does reduce cross-node communication further, and the reduction grows with B, from about 11% at B = 2 to about 20% at B = 4. But it does not improve the overall throughput; it is slightly lower than shared-batch, and the gap widens with B. This is a real tradeoff in our design rather than an implementation artifact. HCC-IPO optimizes compute-load balance first and cross-node communication second. When we balance each batch element separately, the high-compute-load work from different batch elements can land on the same rank, which raises the global compute imbalance. The table shows this directly: at B = 3 and B = 4 the per-batch peak/avg (1.0538) is higher than shared-batch (1.0427 and 1.0363). Because throughput here is bound by compute balance and not by communication volume, the extra communication saving does not pay off, and shared-batch stays the better operating point for throughput.

In short, we implemented the pruning refinement the concern points to, and it does cut cross-node communication as expected, but in this system the throughput bottleneck is compute balance rather than communication volume, so the net throughput effect is slightly negative. We think the more useful takeaway is where the real bottleneck sits, and we will add both the per-batch path and this analysis to the paper.

Reviewer FM36OpenReview ↗
Rating
5/6
Confidence
3/5
Quality
3/4
Clarity
3/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

for 8x8 attention mask matrix 0 1 2 3 4 5 6 7 query q=0 . . . . X . . . query q=1 . . . . X . . . query q=2 . . . . . . . . query q=3 . . . . . . . . query q=4 . . . . D . . . query q=5 . . . . X . . . query q=6 . . . . X . . . query q=7 . . . . X . . .

Prior FlashMask stores those masked query rows using two intervals:

  • upper masked interval: [UTS[4], UTE[4]) = [0, 2)
  • lower masked interval: [LTS[4], LTE[4]) = [5, 8)

This FlashMask-3 paper observes that these boundary values are query-axis coordinates, so under context parallelism each rank can convert global boundaries into local boundaries with clip -> shift -> max, without communicating with other ranks.

It implemented mask-aware attention using Hopper TMA/WGMMA, covering warp specialization, tile skipping and scheduling, load balancing

Strengths and weaknesses

Strengths

  • the idea is effective and simple: convert global boundaries into local boundaries with clip -> shift -> max, avoiding cross-rank communication
  • coherent system design from prior FlashMask to this new FlashMast-3, with specialization on Hopper GPUs
  • conducted valuable ablation studies on persistent scheduling, load balancing, and communication overlap

Weakness

  • the specific implementation is very narrowed to column-wise sparse boundary format. General masks would need other implementation
  • lacks FlashAttention-3 baseline for masks FA3 already supports
  • "our code will be open-sourced" - I did not see an URL, anonymized repository, artifact link
Questions
  • would it possible to do a direct comparison against FA3 on the subset of masks it supports, such as full, causal, and varlen/document masks?
  • I see claim that "our experimental results have reported the standard error", but the experiment seems to be reporting mean value only? Can you add them and explain how they are computed
  • can you provide a more detailed ablation that separates gains from the Hopper/FA3-style kernel port from FlashMask-3-specific contributions
Limitations
  • talk about tensor-shape sensitivity, including larger batch sizes, head dimensions, MHA vs. GQA, and different hq/hkv ratios
  • be accurate about reproducibility limitations, since code is promised but not available yet
Formatting concerns

address unresolved figure number "Figure ?? compares FlashMask-3 (Balance+Overlap) against MagiAttention" page 23 figure font are too small to read - not printing friendly

2 comments
Authors · CommentOpenReview ↗

Response to Reviewer FM36

We thank the reviewer for the Accept rating. Responses to the three questions below.

Q1. Direct comparison against FA3 on the subset it supports (full, causal, varlen/document).

Please see Answer #2 in our response to the Meta Review, which gives the head-to-head comparison against FlashAttention-3 on full, causal, and varlen/document masks.

Q2. The claim reports "standard error" but experiments seem to report mean only; add them and explain how computed.

Thank you for pointing this out. We did not actually list the standard error in the paper. In the revision we will add the standard deviation to the table data, computed as σ=∑i=1N(xi−μ)2N\sigma = \sqrt{\dfrac{\sum_{i=1}^{N}(x_i - \mu)^2}{N}}. In addition, essentially all of the experiments we added during the rebuttal already report the standard deviation.

Q3. More detailed ablation separating the Hopper/FA3-style kernel port from FlashMask-3-specific contributions.

Please see Answer #2 in our response to the Meta Review, which includes the ablation separating the FA3-style Hopper port from the KV Index Generator and the other FlashMask-3-specific contributions.

We are grateful for your Accept rating. If the FA3 comparison and the answers above confirm your assessment, we would appreciate it if you could reflect this in your final score.

Authors · CommentOpenReview ↗

Dear FM36,

Thank you again for your positive assessment and helpful comments. We have posted our responses to the points you raised and wanted to make sure they reached you before the discussion period closes.

If anything in our reply is unclear or if you have any remaining questions, we would be glad to clarify. Otherwise we hope the responses address your comments.

Best regards,

The Authors

Reviewer PNaGOpenReview ↗
Rating
5/6
Confidence
3/5
Quality
3/4
Clarity
3/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper presents FlashMask-3, a mask-aware exact attention system for structured long-context masks on Hopper GPUs and distributed context parallelism. It keeps FlashMask's O(n) column-wise sparse mask representation, adds a FlashAttention-3-style Hopper kernel, and extends it to distributed CP via zero-communication mask localization, HCC-IPO load balancing, and NVSHMEM-based communication overlap/pruning. The evaluation reports strong single-GPU attention throughput and distributed CP-attention speedups over FlashMask, FlexAttention, MagiAttention, and Megatron CP baselines.

Strengths and weaknesses

Strengths

  • Clean, proven distributed mask transform. The key-indexed/query-boundary mask structure enables an elementwise clip-shift-max transform that derives rank-local masks with no cross-rank communication while preserving the single-GPU kernel interface. Theorem 1 proves equivalence to the global mask.
  • Principled load balancer. HCC-IPO targets the min-max CP compute objective, uses exact 2/3-way sub-solvers, provides a lower-bound optimality certificate, and is deterministic so ranks can derive the same assignment without extra communication. Its overhead remains an open systems question, but the formulation is strong.
  • Strong attention-level evaluation and ablations. The experiments cover many structured masks, long sequence lengths, CP degrees up to 32, multiple baselines, and ablations for tile scheduling, load balancing, and communication overlap.
  • Well-integrated systems design. The paper connects mask representation, Hopper TMA/WGMMA kernel design, persistent tile scheduling, CP load balancing, and NVSHMEM communication overlap/pruning into a coherent attention system for packed long-context workloads.

Weakness

  • Scheduler overhead is not isolated. In packed training, mask geometry can change every microbatch, so w_i preprocessing and scheduling may run at per-batch frequency. This can matter for smaller or highly sparse cases: with S=8K, SWA=256, useful attention is roughly S * window, while a full scan with 128-token Q/K blocks still touches (8192/128)^2 = 4096 tiles. Appendix A notes that smaller contexts may not amortize scheduler overhead, but the paper does not report standalone preprocessing+scheduling latency, overlap/prefetch behavior, or deterministic per-rank recomputation cost.
  • Unclear communication pruning at B>1. The per-batch HCC-IPO assignment is sound for compute because w_i aggregates over batch and heads. Communication pruning is stricter: a K/V chunk is skipped only if fully masked for the rank's whole batched attention work. With heterogeneous packed samples, the needed K/V union can grow with batch size, reducing pruning and communication benefit. The CP experiments use B=1.
  • Overlap robustness under sparse/small workloads is unclear. The overlap design needs enough attention compute to hide AG/RS, but sparse masks and smaller contexts reduce that compute. The implementation also relies on careful kernel ordering to avoid deadlock, using a sentinel mechanism while setting sm_margin=0 in experiments. Robustness across sparsity levels, context sizes, and GPU scheduling behavior is not fully characterized.
  • Distributed speedup reporting appears inconsistent. The abstract and §4.2 report 1.09-1.47x over MagiAttention, 1.73-2.93x over Megatron all-gather, and 1.82-3.72x over Megatron ring. Appendix Table 5 reports larger maxima and different geomeans, e.g. 1.06-4.09x and 1.99x geomean over MagiAttention. The included configurations need clarification.
  • Megatron speedups need context. Megatron CP is a useful systems baseline, but its chunking assumptions are known to break under expressive document/prefix masks, as the paper discusses and visualizes. MagiAttention is the cleaner comparison for mask-aware distributed attention; large Megatron speedups should be interpreted with this caveat.
Questions
  • What is the standalone latency of w_i preprocessing plus HCC-IPO scheduling, and is this work overlapped/prefetched or on the critical path?
  • In mixed global/local/SWA layer stacks, is the HCC-IPO assignment cached per distinct mask pattern and reused across layers, or recomputed for each attention call?
  • Does HCC-IPO replace the backend's default context-parallel chunk layout, or can it compose with simpler layouts when they are already effective?
  • How does mask-driven communication pruning change with batch size and heterogeneous packing, particularly skipped K/V chunk fraction and throughput for B>1?
  • Can the authors break down communication-overlap gains by component: mask pruning, hierarchical routing, and NVSHMEM overlap?
Limitations
  • Batch-size effects on communication pruning are not evaluated. The distributed CP experiments use B=1, leaving unclear how much mask-driven AG/RS pruning remains for heterogeneous packed batches.
Final justification

I would like to raise my score from weak accept to accept. The rebuttal addressed my main concerns: end-to-end 128-GPU results, quantified scheduler/preprocessing overhead and showed it is prefetched/cached, characterized communication pruning for B>1, reconciled the speedup reporting, and provided a direct FA3 comparison. Even though static aggregate assignment for mixed mask stacks limitation exists, the new evidence provided by the authors strengthens the paper and supports a positive recommendation.

Formatting concerns

No.

2 comments
Authors · CommentOpenReview ↗

Response to Reviewer PNaG

We thank the reviewer for the careful reading. Responses to the five questions below.

Q1. Standalone latency of w_i preprocessing + HCC-IPO scheduling, on the critical path or overlapped/prefetched?

Please see Answer #5 in our response to the Meta Review, which reports the standalone preprocessing plus scheduling latency and shows it is prefetched off the critical path, amounting to 0.60% to 0.75% of a step after prefetch.

Q2. In mixed global/local/SWA stacks, is the HCC-IPO assignment cached per distinct mask pattern and reused, or recomputed per attention call?

Please see Answer #5 in our response to the Meta Review, which covers how the assignment is computed once offline, cached, and reused rather than recomputed per attention call.

Q3. Does HCC-IPO replace the backend's default CP chunk layout, or compose with simpler layouts when already effective?

Please see Answer #5 in our response to the Meta Review, which explains that HCC-IPO does not unconditionally replace the default layout: the offline decision compares it against DualChunk and adopts HCC-IPO only when it is predicted faster, otherwise falling back to DualChunk.

Q4. How does mask-driven communication pruning change with batch size and heterogeneous packing (skipped K/V chunk fraction and throughput for B>1)?

Please see Answer #3 in our response to the Meta Review, which characterizes per-batch pruning under heterogeneous packed batches, including the skipped K/V fraction and throughput as B grows, and explains why shared-batch stays the better operating point for throughput.

Q5. Break down communication-overlap gains by component: mask pruning, hierarchical routing, NVSHMEM overlap.

Please see Answer #1 in our response to the Meta Review. The end-to-end run there isolates the overlap gain into its components (balance, hierarchical routing, NVSHMEM overlap, and chunk-skip pruning), which is the component-level breakdown requested here.

If our rebuttal has addressed your concerns satisfactorily, we would appreciate it if you could reflect this in your final score.

Authors · CommentOpenReview ↗

Dear PNaG,

I hope you’re doing well. I wanted to follow up on my rebuttal, where I’ve addressed your questions and comments. I sincerely appreciate your time and constructive feedback.

If there’s anything else you’d like me to clarify or expand on, please let me know. Your insights are invaluable in improving my submission.

Thank you again for your thoughtful review. I look forward to your response.

Best regards,

The Authors

Reviewer wuBVOpenReview ↗
Rating
4/6
Confidence
4/5
Quality
3/4
Clarity
3/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This work addresses the central challenge of efficiently supporting expressive structured attention masks during long-context distributed transformer training. The paper introduces FlashMask-3, a distributed attention framework built on FlashAttention-3 that extends the original FlashMask representation to Hopper GPUs and context-parallel training. Its main technical contributions include: (1) a Hopper-optimized, mask-aware attention kernel based on a three-role, warp-specialized pipeline; (2) a zero-communication distributed mask localization algorithm using a clip-shift-max transformation; (3) a hierarchical sparsity-aware load-balancing scheduler (HCC-IPO); and (4) a mask-aware communication overlap mechanism that combines communication pruning with hierarchical all-gather. The authors evaluate the proposed method on H100 GPUs using twelve structured attention mask patterns, comparing it against FlashMask, FlexAttention, MagiAttention, and Megatron-Core context parallelism. The reported results demonstrate substantial improvements in both single-GPU throughput and distributed scaling performance.

Strengths and weaknesses

Strengths:

  • Unlike many prior works that optimize either FlashAttention kernels or communication in isolation, this work jointly optimizes kernel execution, distributed mask handling, load balancing, and communication overlap. The overall system design is coherent and well integrated.
  • The integration of TMA, WGMMA, warp specialization, and persistent scheduling is technically sophisticated and demonstrates a strong understanding of Hopper GPU architecture.
  • The reported performance gains are substantial, including up to 141% improvement over FlashMask, up to 71% over FlexAttention, and consistent distributed performance improvements over Megatron-Core and MagiAttention. If these results are reproducible, they represent meaningful practical advances.

Weaknesses:

  • Many of the proposed contributions are engineering integrations rather than fundamentally new algorithms. While the zero-communication mask localization theorem appears to be a novel contribution, the remainder of the system primarily consists of a careful integration of existing optimization techniques.
  • Several important evaluations are missing, including end-to-end training throughput (e.g., tokens/s), overall training performance, convergence behavior, downstream model quality, and training cost. Demonstrating kernel-level improvements alone is generally insufficient for a systems paper unless they are accompanied by compelling end-to-end results that validate their impact on overall training performance.
  • The paper provides limited theoretical analysis of communication complexity, scheduler optimality, overlap efficiency, scalability, and the approximation quality of HCC-IPO. Moreover, the scheduling algorithm appears to be largely heuristic, with little theoretical justification for its design or performance guarantees.
  • The reported communication reduction relies heavily on structured attention masks that produce fully masked KV chunks. It remains unclear how much of the proposed approach's benefit would carry over to dense attention, randomly sparse attention, learned sparse masks, or adaptive masking methods.
Questions
  • Can the proposed distributed mask localization algorithm be generalized beyond FlashMask's column-wise sparse representation?
  • How does FlashMask-3 affect end-to-end LLM pretraining throughput (e.g., tokens/s), rather than only attention kernel TFLOPS?
  • What fraction of the total training time is spent executing the optimized attention kernels?
  • How does HCC-IPO compare with more advanced graph partitioning or load-balancing algorithms?
  • How sensitive is the performance to the chunk size, segmentation strategy, and communication overlap configuration?
Limitations

Constructive improvements would include a more thorough discussion of the method's dependence on Hopper-specific hardware features, the absence of end-to-end LLM pretraining experiments, its reliance on structured attention masks, scalability beyond 32 GPUs, portability to heterogeneous clusters, applicability to adaptive or learned masking schemes, the heuristic nature of the scheduler, and the GPU memory overhead associated with the additional distributed metadata.

Formatting concerns

Some figures, particularly the overview diagrams, are visually crowded and could be simplified to improve readability.

2 comments
Authors · CommentOpenReview ↗

Response to Reviewer wuBV

We thank the reviewer for the positive assessment. Responses to the five questions below.

Q1. Can the distributed mask localization generalize beyond FlashMask's column-wise sparse representation?

As stated in the first sentence of our Limitations, the mask localization algorithm is strongly tied to FlashMask's column-wise sparse representation, and its zero-communication property comes from the structural fact that the query-axis interval boundaries are stored along the key dimension. In principle it therefore generalizes to any method that expresses a mask through column-wise interval boundaries, but it does not apply to masks that FlashMask cannot represent, such as randomly sparse masks, for which there are no interval boundaries for clip-shift-max to act on.

Q2. End-to-end LLM pretraining throughput (tokens/s), not only attention kernel TFLOPS.

Please see Answer #1 in our response to the Meta Review, which reports end-to-end MoE pretraining throughput in tokens/s/GPU together with the exactness argument and the loss convergence check.

Q3. What fraction of total training time is spent in the optimized attention kernels?

Please see Answer #1 in our response to the Meta Review, where we report the attention forward plus backward fraction of per-step time, which puts the kernel-level gains in context.

Q4. How does HCC-IPO compare with more advanced graph partitioning / load-balancing algorithms?

We have not yet compared against more advanced load-balancing algorithms. In the main text we do compare Original, DualChunk, LPT, and IPO in Figure 7(b), and more advanced graph partitioning is a natural direction for future work. We will note this in the Limitations.

Q5. Sensitivity to chunk size, segmentation strategy, and communication overlap configuration.

We ran a chunk-size ablation under S/P = 8192 and P = 32.

Layout Operation Time (ms) Total TFLOPs/s
DualChunk Causal Document 58.10 ± 8.50 300.96 ± 17.92
DualChunk Document 82.95 ± 10.80 418.71 ± 4.31
DualChunk Prefix LM Document 58.66 ± 8.49 309.04 ± 16.65
chunk=1024 Causal Document 37.14 ± 4.73 468.95 ± 8.28
chunk=1024 Document 68.72 ± 8.04 504.56 ± 7.49
chunk=1024 Prefix LM Document 37.75 ± 5.11 479.09 ± 6.22
chunk=2048 Causal Document 35.08 ± 4.18 496.09 ± 9.60
chunk=2048 Document 67.44 ± 8.77 514.95 ± 8.06
chunk=2048 Prefix LM Document 35.84 ± 4.28 503.65 ± 8.01
chunk=4096 Causal Document 56.41 ± 9.27 311.22 ± 22.95
chunk=4096 Document 72.00 ± 8.93 482.21 ± 20.99
chunk=4096 Prefix LM Document 56.78 ± 9.30 320.55 ± 22.05

All fixed chunk configurations beat the DualChunk baseline. Throughput is unimodal in chunk size: chunk=2048, which is our default, is the optimum and chunk=1024 is close to it, while chunk=4096 degrades clearly and throughput falls back near the baseline level. This shows that too large a chunk makes the scheduling granularity too coarse to reach a good load-balancing result.

For the segmentation strategy and communication overlap configuration, please see the ablation in Answer #1 of our response to the Meta Review.

If our rebuttal has addressed your concerns satisfactorily, we would appreciate it if you could reflect this in your final score.

Authors · CommentOpenReview ↗

Dear wuBV,

I hope you’re doing well. I wanted to follow up on my rebuttal, where I’ve addressed your questions and comments. I sincerely appreciate your time and constructive feedback.

If there’s anything else you’d like me to clarify or expand on, please let me know. Your insights are invaluable in improving my submission.

Thank you again for your thoughtful review. I look forward to your response.

Best regards,

The Authors

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…