Repository navigation
[Triton/Gluon] Accept strided leading dimensions in GDN L2Norm - #5624
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified; one non-blocking test-structure nit remains.
Pull request overview
Updates GDN L2 normalization to support valid strided leading dimensions using reshape(), with BF16 correctness coverage.
Changes:
- Preserve compatible views while safely materializing incompatible layouts.
- Add transposed-input tests against an FP32 reference.
File summaries
| File | Summary |
|---|---|
op_tests/triton_tests/normalization/test_gdn_l2norm.py |
Adds strided-input correctness tests. |
aiter/ops/triton/_triton_kernels/gated_delta_rule/utils/l2norm.py |
Uses reshape() to support non-contiguous leading dimensions. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
8babab8 to
6f7037f
Compare
|
@vorapolsiloai can you rebase and resolve conflicts |
|
@amd-jrosas @azaidy Thanks for reviewing this. I realized the PR description omitted the related downstream context. This change was created while the strided GDN Q/K integration was evolving in SGLang #38806 and SGLang #39595. Both SGLang branches have since evolved. SGLang #38806 now handles the strided packed input in its fused prefill preparation, writes normalized contiguous Q/K, and disables downstream Q/K normalization. SGLang #39595 creates contiguous Q/K before calling AITER L2Norm. Therefore, neither current path depends on this AITER change, and I have not found another active caller that requires it. This PR now appears to provide only general support for hypothetical strided callers, while |
@vorapolsiloai do you see any future need for strided callers? Is there a performance hit to having the reshape - I assume not but confirming? My take is the contribution solidifies the kernel so unless there are other issues lets rebase and try to get it merged into aiter. |
Qwen3.8 TP1 can pass Q/K views whose leading dimensions cannot be flattened with `view()`. Use `reshape()` so contiguous inputs retain the zero-copy path while valid strided inputs materialize safely. - Cover strided Q/K parity through the public GDN wrapper
6f7037f to
e2c361f
Compare
|
I couldn't find a current strided caller. SGLang and vLLM disable AITER-side Q/K normalization because they already normalize Q/K during fused preparation, not because this path is broken. I see this mainly as defensive hardening for a future caller that enables AITER-side normalization and passes tensor views. I checked on MI355X: for contiguous inputs, I've rebased the PR, and the regression test passes (2 tests). |
Summary
view()withreshape()when flattening leading dimensions for the Triton GDN L2Norm wrapper.Context
Qwen3.8 TP1 can pass Q/K tensors whose last dimension is contiguous but whose leading dimensions cannot be flattened with
view(). The kernel supports this layout after flattening; the wrapper currently rejects it before launch.This is a correctness and integration-enabling change. It does not claim an independent serving-throughput uplift.
Test plan
rstdinference contract.