Commit 9fb1ee6
committed
fix(v4-path-d): correct kkt BT/BC contract + with_state BV tiling (3/8 cells green; ffi-NULL unblocked)
The ffi-NULL fix (tilelang 168877b0) took Path D from 0/8 launched -> 8/8 launched, exposing two
cppmega-side launch-config bugs (RULE #1 surfaced them; no fallback):
- kkt_solve was launched BT=32,BC=16 but the FLA kkt kernel hard-codes a 4-sub-block decomposition
requiring BT==4*BC -> wrong/NaN. Fixed BC=GDN_RUNTIME_BT//4=8 + pinned _NUM_WARPS=1 for the [8,8]
GEMM (plumbed _NUM_WARPS through the lowering driver into from_ttir(num_warps=...)).
- with_state initial-state chunk_h exceeded Apple's compute-function stack -> lowered
GDN_CHUNK_H_METAL_SAFE_BV 16->8 (the predicted recompute_w_u-style BV tiling).
Result: 3/8 cells green in isolation (fixed_k64_v32 0.018, custom_scale 0.009, with_state 0.019 --
named residual solved; kkt fix dropped fixed_k64 0.137->0.018). No fallback added; unsupported
shapes still RAISE PathDRuntimeUnavailable.
REMAINING (tilelang-side, separate fix): cells with chunks/seq>=3 or multi-head HV>=2 still NaN/wrong
due to the TVM-FFI Metal bridge lazy-multi-launch buffer/producer-registry id()-reuse hazard (same
metal_graph_sync issue) -- needs a tilelang bridge fix, not cppmega.1 parent 24be790 commit 9fb1ee6
2 files changed
Lines changed: 45 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
879 | 891 | | |
880 | 892 | | |
881 | 893 | | |
| |||
887 | 899 | | |
888 | 900 | | |
889 | 901 | | |
| 902 | + | |
890 | 903 | | |
891 | 904 | | |
892 | 905 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
| |||
1926 | 1936 | | |
1927 | 1937 | | |
1928 | 1938 | | |
1929 | | - | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
1930 | 1960 | | |
1931 | 1961 | | |
1932 | 1962 | | |
| |||
0 commit comments