Triton RMSNorm example uses epsilon 1e-6 but definition requires 1e-5
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- python
調査の方向性
examples/triton/rmsnorm/definition.json から始め、そこに固定されている epsilon と examples/triton/rmsnorm/kernel.py の launch を比較します。examples/triton/rmsnorm/solution_triton.json の launch と埋め込まれたソースを更新し、その後、小さい値の BF16 正確性ケースを追加します。完了の条件は、バンドルされた例が有効な BF16 入力に対してリファレンスと一致することです。
索引モデルが issue の本文から書いたものです。
説明
Summary
The Triton RMSNorm example does not implement its own problem definition.
Observed mismatch for x = BF16(1e-3) and weight = 1: expected 0.30078125 vs. candidate output 0.70703125.
definition.jsonfixesEPS = 1e-5in the reference and says “Epsilon is fixed at 1e-5.”kernel.pylaunches_rmsnorm_fwd_kernelwith1e-6.- The embedded
kernel.pycontent insolution_triton.jsonalso contains1e-6.
This is present on current main at commit a9fa0804c793d438e70850c33fe34426e66d53dd.
Minimal reproducer
Use a valid official-shape BF16 row with small finite values and unit weights:
import torch
x = torch.full((1, 4096), 1e-3, dtype=torch.bfloat16, device="cuda")
weight = torch.ones(4096, dtype=torch.bfloat16, device="cuda")
def rmsnorm(x, eps):
x32 = x.float()
return (
x32 * torch.rsqrt(x32.square().mean(-1, keepdim=True) + eps)
* weight.float()
).bfloat16()
print(x[0, 0].item())
print(rmsnorm(x, 1e-5)[0, 0].item())
print(rmsnorm(x, 1e-6)[0, 0].item())
Input: 0.00099945068359375
Expected (reference, epsilon = 1e-5): 0.30078125
Observed (Triton candidate, epsilon = 1e-6): 0.70703125
So the concise comparison is: expected 0.30078125 vs. observed 0.70703125.
A randomized (randn * 1e-3).bfloat16() input with batch size 7 produced 26,631 mismatching elements out of 28,672.
This is not reduction-order noise: for a constant row, the output is analytically x / sqrt(x² + eps), and the observed ratio agrees with changing epsilon from 1e-5 to 1e-6.
Expected behavior
The bundled example solution should use the epsilon required by rmsnorm_h4096 for all valid BF16 inputs.
Suggested fix
- Change the launch argument in
examples/triton/rmsnorm/kernel.pyfrom1e-6to1e-5. - Make the same change in the embedded source inside
examples/triton/rmsnorm/solution_triton.json. - Add a small-magnitude BF16 correctness case; unit-scale inputs make epsilon comparatively negligible and can hide this mismatch.
- 主要言語
- Python
- スター
- 340
- フォーク
- 37
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/SOL-ExecBench のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NVIDIA/SOL-ExecBench#27 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
NVIDIA/SOL-ExecBench#31 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
NVIDIA/SOL-ExecBench#29 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 64/100
NVIDIA/SOL-ExecBench#25 · コメント 1 件 ·
NVIDIA/SOL-ExecBench の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
vllm-project/vllm#70030 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TigreGotico/tugaphone#408 ·
メンテナーはふだん 1 日以内に返信
-
t: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
needs-triage
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
Azure/azure-sdk-for-python#50155 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信