Commit Graph

700 Commits

Author SHA1 Message Date
fd6b1e82d8 TMA shape diag: pure Python, no JIT 2026-05-22 21:55:03 +00:00
2f670e33d1 TMA shape diagnostic: exact setup from example9 + shape prints 2026-05-22 21:54:22 +00:00
b64227e5b6 Fix group_modes range in TMA shape diag 2026-05-22 21:53:22 +00:00
be27720cb2 Add TMA shape diagnostic 2026-05-22 21:52:51 +00:00
845ad98b22 Fix TMA indexing: 4-mode tensors, kt at mode 2 (GMEM tile dim) 2026-05-22 21:51:33 +00:00
61b0501a8b Fix test_fmha_v3_stage_c.py: 8-mode TMA indexing + O rescale (from example9) 2026-05-22 21:50:35 +00:00
0996ffc1ba Add fmha_v3_stage_c_example10: 8-mode TMA + O rescale + paired-atom epilogue 2026-05-22 21:43:11 +00:00
328f9b0080 Test n=384 2026-05-22 21:36:22 +00:00
2da0a452d1 Quick test n=128,256 2026-05-22 21:36:00 +00:00
0d3caced47 Add: O rescale (correction_rescale) in softmax loop + remove pk from TMA/MMA 2026-05-22 21:35:39 +00:00
c47d229e6a Sweep test 2026-05-22 21:32:18 +00:00
a751b3baf7 Sweep test: n=128,256,384,512,1024 2026-05-22 21:31:15 +00:00
beaf60db5c DOCUMENT: TMA 8-mode indexing — the bug that cost us a full day. README + inline comments. 2026-05-22 21:28:58 +00:00
27116110ab Fix identity diag: same 8D TMA indexing fix 2026-05-22 21:21:52 +00:00
bb92af5b0c FIX: Use full 8D indexing for tBgK/tVgV — mode 4 is the GMEM tile dim 2026-05-22 21:21:23 +00:00
2a9f764f8b Diagnostic: check tBgK/tVgV layout strides for degenerate dims 2026-05-22 21:20:46 +00:00
ae173d3963 Test identity diag multi-tile 2026-05-22 21:14:42 +00:00
a35fb1b077 Minimal reference FMHA test: n=256 only 2026-05-22 21:13:37 +00:00
4fc264e034 Test reference FMHA with proper API 2026-05-22 21:12:49 +00:00
a800a83d5c Test: CUTLASS reference FMHA on B200 multi-tile 2026-05-22 21:11:58 +00:00
2a14c2dd18 REVERT to working baseline (n=128 cos 0.999998). Multi-tile TMA is a CuTeDSL JIT limitation. 2026-05-22 20:37:21 +00:00
1ab326f2d2 Test: use kvh.index (pipeline state) as TMA GMEM coordinate 2026-05-22 20:36:21 +00:00
7b8b022e23 SMEM counter: separate allocate_tensor instead of struct field 2026-05-22 20:35:42 +00:00
462778efcf Fix SMEM counter type: cutlass.Int32 for MemRange 2026-05-22 20:35:17 +00:00
f5c827d0b9 SMEM-backed kv_coord counter — JIT can't constant-fold SMEM reads 2026-05-22 20:34:52 +00:00
215282971c DEBUG: hardcoded Int32(1) to test if TMA can read tile 1 2026-05-22 20:34:21 +00:00
79ebe20a39 DEBUG: use Int32(kt) directly to test if coordinate matters 2026-05-22 20:34:03 +00:00
b3778896b9 Test: kv_coord = warp_idx() * 0 — force SSA from runtime value 2026-05-22 20:33:40 +00:00
1de848c5ca DEBUG: add cute.printf for kv_coord runtime value 2026-05-22 20:33:03 +00:00
587c16679c Test: Python range() instead of cutlass.range() for TMA loop 2026-05-22 20:32:44 +00:00
91230fe5e6 Test example9: drop try_acquire/pk, single loop-carried kv_coord 2026-05-22 20:32:25 +00:00
3c0451a3e5 REVERT to working example7 (n=128 cos 0.999998). Example8 TMA fix didn't work. 2026-05-22 20:28:15 +00:00
880bd9ef81 Update stage_c test to example8: SSA kv_coord + per-tile O rescale 2026-05-22 20:27:58 +00:00
c395b279d2 Clean up tests: archive superseded files, keep only essential unit tests
Kept in tests/unit/:
- test_fmha_v3.py (stages A+B)
- test_fmha_v3_diag.py (identity softmax, n=128+256)
- test_fmha_v3_stage_c.py (real softmax, n=128 cos 0.999998)
- layertest.py + cudagraph_test.py (required for every change)
- infrastructure: cache, custom_op, cutedsl, router, fp4, fused, interleave

Archived: 19 superseded unit tests + 10 root-level scratch files
Root level: only fmha_v3_stage_c_example7.py remains (now in unit/)
2026-05-22 20:25:27 +00:00
a54a241052 Revert TMA to kt pattern (n=128 works), multi-tile TMA is separate bug 2026-05-22 20:10:35 +00:00
956ca1ecfd TMA: use self.n_kv_tiles + kv_coord pattern from working diag test 2026-05-22 20:08:07 +00:00
242ffebcd9 REVERT to 0bdcdc0 — the version that passed n=128 cos 0.999998 2026-05-22 20:07:18 +00:00
3814838107 DEBUG: disable O rescale + normalize, test if corr setup alone causes regression 2026-05-22 19:57:53 +00:00
2c51f82382 Shared corr tensors for O rescale + final normalize, fix softmax loop 2026-05-22 19:55:06 +00:00
f165257c50 Add O rescale with correction_rescale pattern + fix TMA to working diag pattern 2026-05-22 19:51:53 +00:00
0bdcdc0efd O normalize: exact CUTLASS correction_rescale pattern with 2D reg tensor 2026-05-22 19:50:37 +00:00
009cf9f80d O normalize: TMEM round-trip with paired Ld/St atoms + standard epilogue_tma_store 2026-05-22 19:49:51 +00:00
f821dd00fe Fix: use NamedBarrier instead of mbarrier_arrive/wait 2026-05-22 19:49:07 +00:00
3bd406e925 Fix: barrier_wait → mbarrier_wait, barrier_arrive → mbarrier_arrive 2026-05-22 19:48:31 +00:00
544f0ca52b Fix epilogue: corr_tile_size=16, proper epi_subtile tuple, match CUTLASS reference 2026-05-22 19:47:57 +00:00
d526aa04fb Fix example7: K slice (None,None,0,0) and softmax scale_log2 double-bug 2026-05-22 19:45:59 +00:00
558aac0581 Fix: fence_async_shared -> fence_view_async_shared 2026-05-22 19:25:05 +00:00
d62e6fc9ca Clean v2: real softmax P, no O TMEM modify, standard epilogue. Baseline for custom epilogue work. 2026-05-22 19:24:25 +00:00
183292d919 O normalize using tmem_ptr base (same as epilogue) + CUTLASS sub-tile pattern 2026-05-22 19:18:16 +00:00
365e8f53af O normalize with full layout (no sub-tiling), Repetition(64) 2026-05-22 19:17:03 +00:00