[TLE][NVIDIA] Add SMEM subslices and multi-writer TMA pipes - #1079
Open
Zhang-kg wants to merge 2 commits into
Open
[TLE][NVIDIA] Add SMEM subslices and multi-writer TMA pipes#1079Zhang-kg wants to merge 2 commits into
Zhang-kg wants to merge 2 commits into
Conversation
Expose a rank-preserving buffered_tensor.subslice operation for static shared-memory views. Preserve the parent layout and allocation shape, register the primitive with the NVIDIA backend, and cover frontend validation and primitive discovery.
Allow opt-in independent pure-TMA producer tasks to populate disjoint fields of one pipe stage. Infer the full-barrier arrival count from the writer set, honor explicit TMA token full counts during NVIDIA lowering, and reject incomplete, overlapping, mixed-transport, or unbalanced writer configurations.
|
|
Zhang-kg
marked this pull request as ready for review
September 2, 2026 11:20
Zhang-kg
requested review from
Galaxy1458,
i3wanna2,
menchunlei,
sunnycase and
zhzhcookie
as code owners
September 2, 2026 11:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
PR837 实现的 TLE pipe lowering 当前默认一个 pipe 只能对应一个 writer task。
MegaMoE 的 warp-specialized pipeline 需要两个独立的 TMA producer 分别加载不同 operand,并共同填充同一个 pipeline stage。同时,math task 需要在不改变 rank 和 shared-memory layout 的前提下,对已经分配的 SMEM tile 创建静态子视图。
因此,本 PR 在 PR837 基础上补充以下两项能力:
buffered_tensor的 SMEM subslice;修改内容
1. 增加
buffered_tensor.subslice新增接口:
该接口:
start、length和dim必须为编译期常量;alloc_shape;同时将
buffered_tensor.slot和buffered_tensor.subslice注册到 NVIDIA backend 的 TLE capability 列表中。2. 支持多个 TMA writer 共享一个 pipe
通过以下环境变量显式启用:
启用后,多个独立 writer task 可以分别向同一个 pipe stage 的不同字段发射 TMA copy。
Lowering 会:
full_count;该功能目前仅允许满足以下条件的配置:
不满足约束的配置会在编译期给出明确诊断。
兼容性
多 writer 支持默认关闭。
未设置
TLE_MULTI_TMA_WRITERS=1时,保持 PR837 原有的单 writer pipe 行为,不改变现有 kernel 的 lowering 结果。