Triton RMSNorm example uses epsilon 1e-6 but definition requires 1e-5
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- python
- Lĩnh vực
- machine-learning, testing-qa
Hướng nghiên cứu
Bắt đầu với examples/triton/rmsnorm/definition.json và so sánh epsilon cố định của nó với launch trong examples/triton/rmsnorm/kernel.py. Cập nhật launch và mã nguồn được nhúng trong examples/triton/rmsnorm/solution_triton.json, sau đó thêm một trường hợp kiểm tra tính đúng đắn BF16 với độ lớn nhỏ; hoàn tất có nghĩa là ví dụ đi kèm khớp với tham chiếu đối với các đầu vào BF16 hợp lệ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 340
- Fork
- 37
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/SOL-ExecBench
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NVIDIA/SOL-ExecBench#27 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
NVIDIA/SOL-ExecBench#31 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
NVIDIA/SOL-ExecBench#29 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 64/100
NVIDIA/SOL-ExecBench#25 · 1 bình luận ·
Tất cả issue của NVIDIA/SOL-ExecBench
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
vllm-project/vllm#70030 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TigreGotico/tugaphone#408 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
t: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Azure/azure-sdk-for-python#50155 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày