@@ -1308,8 +1308,9 @@ def _target_ops() -> List[TargetOp]:
13081308 source_file = _ARITH_FILE ,
13091309 input_specs = {"x" : 1 },
13101310 build_graph = lambda nodes : mod_const (nodes ["x" ], divisor = 7 , max_value = 100 ),
1311- reference_fn = lambda inputs : inputs ["x" ]
1312- - 7.0 * torch .floor (inputs ["x" ] / 7.0 ),
1311+ reference_fn = lambda inputs : (
1312+ inputs ["x" ] - 7.0 * torch .floor (inputs ["x" ] / 7.0 )
1313+ ),
13131314 distribution_names = ("mod_integers_0_100_by7" ,),
13141315 notes = (
13151316 "Identity `x % d = x - d · thermometer_floor_div(x, d)`. "
@@ -1713,12 +1714,14 @@ def _target_ops() -> List[TargetOp]:
17131714 build_graph = lambda nodes : swiglu_ops .dynamic_extract (
17141715 nodes ["table" ], nodes ["idx" ], n_entries = 4 , d_fill = 2
17151716 ),
1716- reference_fn = lambda inputs : inputs ["table" ]
1717- .view (- 1 , 4 , 2 )[
1718- torch .arange (inputs ["table" ].shape [0 ]),
1719- inputs ["idx" ].flatten ().long (),
1720- ]
1721- .view (- 1 , 2 ),
1717+ reference_fn = lambda inputs : (
1718+ inputs ["table" ]
1719+ .view (- 1 , 4 , 2 )[
1720+ torch .arange (inputs ["table" ].shape [0 ]),
1721+ inputs ["idx" ].flatten ().long (),
1722+ ]
1723+ .view (- 1 , 2 )
1724+ ),
17221725 distribution_names = ("dynamic_extract_int_idx_4x2" ,),
17231726 notes = (
17241727 "in_range one-hot → broadcast_select (zero-literal false "
@@ -1893,8 +1896,9 @@ def _target_ops() -> List[TargetOp]:
18931896 build_graph = lambda nodes : swiglu_ops .mod_const (
18941897 nodes ["x" ], divisor = 7 , max_value = 100
18951898 ),
1896- reference_fn = lambda inputs : inputs ["x" ]
1897- - 7.0 * torch .floor (inputs ["x" ] / 7.0 ),
1899+ reference_fn = lambda inputs : (
1900+ inputs ["x" ] - 7.0 * torch .floor (inputs ["x" ] / 7.0 )
1901+ ),
18981902 distribution_names = ("mod_integers_0_100_by7" ,),
18991903 notes = (
19001904 "x − d·thermometer_floor_div(x, d) — linear hardware plus "
@@ -2150,8 +2154,7 @@ def render_markdown(data: Dict) -> str:
21502154 lines .append ("## Summary" )
21512155 lines .append ("" )
21522156 lines .append (
2153- "| Op | Machine | Module | Max abs error | Max rel error "
2154- "| Worst distribution |"
2157+ "| Op | Machine | Module | Max abs error | Max rel error | Worst distribution |"
21552158 )
21562159 lines .append ("| --- | --- | --- | --- | --- | --- |" )
21572160 for op in data ["ops" ]:
0 commit comments