[Feature] Fuse the post-attention residual RMSNorm with tensor-parallel reduction in dense Qwen3

未关闭
#23,073 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@laikhtewari 已经在做这个了。

开始于 2026年11月30日。

  • #23074 来自 @HaoyangPing0324 —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

feature request Pytorch
🚀 The feature, motivation and pitch

Motivation

In the PyTorch backend, each dense Qwen3 block reduces the attention output projection across tensor-parallel ranks and then calls post_attention_layernorm with the residual. The row projection already accepts AllReduceParams and the collective supports returning the normalized activation and updated residual together. Dense Qwen3 currently leaves this epilogue unused. This path runs once per decoder layer per forward pass. The previous Qwen3 fusion in #4304 changed the MoE implementation. Dense decoder

Proposed scope

Use the existing RESIDUAL_RMS_NORM epilogue for unquantized BF16 dense Qwen3 text generation with ordinary MPI tensor parallelism and the automatic all-reduce strategy. Keep the existing small-hidden-size accuracy guard used in Llama and the Qwen3 eager-fusion switch. Attention DP, context parallelism, sparse hooks and compilation can continue to use the current path.

For Qwen/Qwen3-14B on two H20s, streaming 128-token prompts with 24 generated tokens at concurrency four, median first-token latency measured 96.13 to 92.64 ms and 95.45 to 91.45 ms in two runs with reversed launch order. The measured benefit was smaller at high concurrency.

Alternatives

No response

Additional context

No response

Before submitting a new issue...
  • Make sure you already searched for relevant issues, and checked the documentation and examples for answers to frequently asked questions.
主要语言
Python
星标
15.2k
派生
3k
平均合并
2 天 21 小时
30 天内合并 PR
477

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/TensorRT-LLM 的其他 Issue

查看 NVIDIA/TensorRT-LLM 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。