|
38 | 38 |
|
39 | 39 | import torchwright.ops.swiglu.map_select as _map_select |
40 | 40 | import torchwright.ops.swiglu.onehot_table as _onehot_table |
| 41 | +from torchwright.graph import Node |
41 | 42 | from torchwright.graph.node import suppress_checks |
42 | 43 | from torchwright.ops._math import _lookup_numeric_slack |
43 | 44 | from torchwright.ops.inout_nodes import create_input |
@@ -76,7 +77,7 @@ def __exit__(self, *exc): |
76 | 77 | return _Ctx() |
77 | 78 |
|
78 | 79 |
|
79 | | -def build_carry_chain(scale_override: Optional[float]) -> Dict[str, object]: |
| 80 | +def build_carry_chain(scale_override: Optional[float]) -> Dict[str, Node]: |
80 | 81 | """total -> in_range(total, total+1, 61) -> bool_to_01 -> lookups. |
81 | 82 |
|
82 | 83 | The exact shape of calculator_simple.multiply_digit_seqs' carry sweep, |
@@ -110,7 +111,7 @@ def build_carry_chain(scale_override: Optional[float]) -> Dict[str, object]: |
110 | 111 | } |
111 | 112 |
|
112 | 113 |
|
113 | | -def build_times_table(scale_override: Optional[float]) -> Dict[str, object]: |
| 114 | +def build_times_table(scale_override: Optional[float]) -> Dict[str, Node]: |
114 | 115 | """Two machine-built one-hot digits -> two-block times-table lookup. |
115 | 116 |
|
116 | 117 | The multi-block (swiglu-lane) path of onehot_lookup, fed by the same |
@@ -141,7 +142,7 @@ def build_times_table(scale_override: Optional[float]) -> Dict[str, object]: |
141 | 142 |
|
142 | 143 |
|
143 | 144 | def sweep_carry( |
144 | | - nodes: Dict[str, object], deltas: List[float], device: torch.device |
| 145 | + nodes: Dict[str, Node], deltas: List[float], device: torch.device |
145 | 146 | ) -> Dict[str, torch.Tensor]: |
146 | 147 | ts, dvals = [], [] |
147 | 148 | for t in range(N_SLOTS): |
@@ -180,7 +181,7 @@ def sweep_carry( |
180 | 181 |
|
181 | 182 |
|
182 | 183 | def sweep_times_table( |
183 | | - nodes: Dict[str, object], deltas: List[float], device: torch.device |
| 184 | + nodes: Dict[str, Node], deltas: List[float], device: torch.device |
184 | 185 | ) -> Dict[str, torch.Tensor]: |
185 | 186 | rows: List[Tuple[int, int, float]] = [] |
186 | 187 | for da in range(10): |
|
0 commit comments