Commit b18f415
committed
fix(path-c): clear Metal mamba3_mimo_bwd watchdog gate via per-op time-chunk window
The mamba3 reverse-time-scan backward segment tripped the macOS GPU watchdog
(kIOGPUCommandBufferCallbackErrorTimeout) on its FIRST time-chunk launch even
when time-chunked: the shared launcher window of 8 reverse time-steps/command
buffer is too big for mamba3, whose reverse-scan state (1.75MB/step x4) is pooled
to GLOBAL device memory (b330bdb) making each step expensive.
Add a PER-OP time-chunk window override so mamba3_mimo_bwd uses a smaller
rows_per_kernel_launch than the other launcher-chunked backward ops (which keep
the watchdog-safe shared default of 8). _target_with_max_rows_per_launch now
threads rows_per_kernel_launch into the generated schedule template (the window
lives only in the compiled PrimFunc attrs, so a non-default window always
re-generates the kernel -- no silent keep of the 8-step kernel).
Isolation sweep at full local_gb10_quarter scale (depth=13 hidden=3584
max_seq=4096) via scripts/_bwdgate_mamba3_window_sweep.py, first 4 launches:
window total launches first launch steady/launch first-launch fits?
8 512 (timeout) -- NO (kIOGPU timeout)
4 1024 3.63s 2.42s yes (~1.4s margin)
2 2048 2.52s 1.19s yes (~2.5s margin)
1 4096 1.65s 0.68s yes (~3.3s margin)
Per-step cost is ~linear so total mamba3 backward wall is window-independent
(~40-46 min). 4 is the LARGEST watchdog-safe window; committed default is 2 for
~50% margin during the ~61-min end-to-end run. Metal-only; CUDA keeps the shared
default (no per-command-buffer watchdog).
Only the mamba3 segment changes (rows_per_kernel_launch 8->2 -> 2048 launches);
sparse_mla_fp8_apply_bwd / attention_qkv_projection_bwd / m2rnn_bwd keep window 8.
All 119 tests/test_path_c_fusion_ir.py pass.1 parent 9f74055 commit b18f415
2 files changed
Lines changed: 278 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
281 | 312 | | |
282 | 313 | | |
283 | 314 | | |
| |||
707 | 738 | | |
708 | 739 | | |
709 | 740 | | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
710 | 762 | | |
711 | 763 | | |
712 | 764 | | |
| |||
14817 | 14869 | | |
14818 | 14870 | | |
14819 | 14871 | | |
| 14872 | + | |
| 14873 | + | |
| 14874 | + | |
| 14875 | + | |
| 14876 | + | |
| 14877 | + | |
| 14878 | + | |
14820 | 14879 | | |
14821 | 14880 | | |
14822 | 14881 | | |
14823 | 14882 | | |
14824 | 14883 | | |
| 14884 | + | |
| 14885 | + | |
| 14886 | + | |
| 14887 | + | |
| 14888 | + | |
14825 | 14889 | | |
14826 | 14890 | | |
14827 | 14891 | | |
| |||
15092 | 15156 | | |
15093 | 15157 | | |
15094 | 15158 | | |
| 15159 | + | |
15095 | 15160 | | |
15096 | 15161 | | |
15097 | 15162 | | |
| 15163 | + | |
| 15164 | + | |
| 15165 | + | |
| 15166 | + | |
| 15167 | + | |
| 15168 | + | |
| 15169 | + | |
| 15170 | + | |
| 15171 | + | |
| 15172 | + | |
| 15173 | + | |
15098 | 15174 | | |
15099 | 15175 | | |
15100 | 15176 | | |
| 15177 | + | |
15101 | 15178 | | |
15102 | 15179 | | |
15103 | 15180 | | |
| |||
15114 | 15191 | | |
15115 | 15192 | | |
15116 | 15193 | | |
| 15194 | + | |
15117 | 15195 | | |
15118 | 15196 | | |
15119 | 15197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
0 commit comments