Skip to content

Commit 05d42ec

Browse files
yf225claude
andauthored
Tighten rtol/atol from 1e-2 to 1e-3 for Helion kernels (#132)
All four Helion kernels (causal_conv1d, gated_deltanet_chunk_fwd_h, chunk_fwd_o, recompute_w_u) operate in float32 but used overly loose tolerances of rtol=1e-2, atol=1e-2. Tighten to 1e-3 to better catch numerical bugs while still allowing for accumulation chain error. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ec71b91 commit 05d42ec

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

problems/helion/causal_conv1d_py/reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ def ref_kernel(data: input_t) -> output_t:
3232
return output
3333

3434

35-
check_implementation = make_match_reference(ref_kernel, rtol=1e-2, atol=1e-2)
35+
check_implementation = make_match_reference(ref_kernel, rtol=1e-3, atol=1e-3)

problems/helion/gated_deltanet_chunk_fwd_h_py/reference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ def check_implementation(data, output):
9696
exp_h, exp_v = expected
9797
got_h, got_v = output
9898

99-
reasons_h = verbose_allclose(got_h.float(), exp_h.float(), rtol=1e-2, atol=1e-2)
100-
reasons_v = verbose_allclose(got_v.float(), exp_v.float(), rtol=1e-2, atol=1e-2)
99+
reasons_h = verbose_allclose(got_h.float(), exp_h.float(), rtol=1e-3, atol=1e-3)
100+
reasons_v = verbose_allclose(got_v.float(), exp_v.float(), rtol=1e-3, atol=1e-3)
101101

102102
reasons = []
103103
if reasons_h:

problems/helion/gated_deltanet_chunk_fwd_o_py/reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,4 @@ def ref_kernel(data: input_t) -> output_t:
112112
return o.permute(0, 1, 3, 2, 4).reshape(B, T, H, V).to(q.dtype)
113113

114114

115-
check_implementation = make_match_reference(ref_kernel, rtol=1e-2, atol=1e-2)
115+
check_implementation = make_match_reference(ref_kernel, rtol=1e-3, atol=1e-3)

problems/helion/gated_deltanet_recompute_w_u_py/reference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def check_implementation(data, output):
7272
exp_w, exp_u = expected
7373
got_w, got_u = output
7474

75-
reasons_w = verbose_allclose(got_w, exp_w, rtol=1e-2, atol=1e-2)
76-
reasons_u = verbose_allclose(got_u, exp_u, rtol=1e-2, atol=1e-2)
75+
reasons_w = verbose_allclose(got_w, exp_w, rtol=1e-3, atol=1e-3)
76+
reasons_u = verbose_allclose(got_u, exp_u, rtol=1e-3, atol=1e-3)
7777

7878
reasons = []
7979
if reasons_w:

0 commit comments

Comments
 (0)