Commit 4a5280a
committed
fix(path-c): materialize contiguous tvm-ffi inputs for mamba3 (DLPack non-contiguous)
RULE #1 surfaced this: mamba3 Path C passed caller MLX arrays straight across the tvm-ffi boundary
where dlpack_to_tvm_tensor rejects non-contiguous layouts (FromDLPack: Tensor is not contiguous).
Root cause: x,B,C,z arrive non-contiguous from the producer (reshape of a strided _split_by_sizes
slice; mean + RoPE-state-dim-transpose + group->head-broadcast); A/dt/D/h0 contiguous.
Fix at the Path C ABI source (no fallback): _materialize_contiguous_inputs runs mx.contiguous on
each tvm-ffi input (layout-only, dtype-preserving -- unsupported dtypes still raise; no-op on
already-contiguous) at all 3 dispatch entries (fwd, fwd_with_snapshots, bwd Metal entry).
Metal: all 5 DLPack-contiguity failures cleared; +regression test (passes here, fails on pristine).
NOTE: the remaining 44 mamba3 Path C failures are the SAME ffi-NULL (ffi.Function returned NULL)
common blocker as GDN/KDA Path C + #13 -- the tvm-ffi launch-recovery covers only the 5-param fp8
signature, not the mamba3/GDN/KDA/#13 kernel signatures. That is the next (highest-leverage) fix.1 parent d2b2703 commit 4a5280a
2 files changed
Lines changed: 127 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2356 | 2356 | | |
2357 | 2357 | | |
2358 | 2358 | | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
2359 | 2387 | | |
2360 | 2388 | | |
2361 | 2389 | | |
| |||
2770 | 2798 | | |
2771 | 2799 | | |
2772 | 2800 | | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
2773 | 2816 | | |
2774 | 2817 | | |
2775 | 2818 | | |
| |||
2878 | 2921 | | |
2879 | 2922 | | |
2880 | 2923 | | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
2881 | 2938 | | |
2882 | 2939 | | |
2883 | 2940 | | |
| |||
3860 | 3917 | | |
3861 | 3918 | | |
3862 | 3919 | | |
| 3920 | + | |
| 3921 | + | |
| 3922 | + | |
| 3923 | + | |
| 3924 | + | |
| 3925 | + | |
| 3926 | + | |
| 3927 | + | |
| 3928 | + | |
| 3929 | + | |
| 3930 | + | |
| 3931 | + | |
| 3932 | + | |
| 3933 | + | |
| 3934 | + | |
| 3935 | + | |
| 3936 | + | |
3863 | 3937 | | |
3864 | 3938 | | |
3865 | 3939 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
205 | 258 | | |
206 | 259 | | |
207 | 260 | | |
| |||
0 commit comments