D2: add flat_divide shape print, try different coordinate order

This commit is contained in:
2026-05-24 23:42:04 +00:00
parent 7007a9db79
commit 6f371d6b31

View File

@@ -199,10 +199,13 @@ class FmhaKernel:
# and the rest dims become outer modes. Then we index the outer modes with block_idx.
q_tiler = cute.slice_(self.qk_mma_tiler, (None, 0, None)) # (128, hd)
tC_gQ = cute.flat_divide(mQ, q_tiler)
gQ = tC_gQ[head_cta_idx, None, None] # index head dim, take first M/K tile
print(f"D2 DEBUG: tC_gQ shape={cute.shape(tC_gQ)}")
# tC_gQ has modes: (128, hd, rest...). Rest modes include n_h and trailing dims.
# Need to figure out correct coordinate for head indexing.
gQ = tC_gQ[None, None, head_cta_idx, None] # try different coordinate order
c_tiler = cute.slice_(self.pv_mma_tiler, (None, None, 0)) # (128, hd)
tC_gC = cute.flat_divide(mC, c_tiler)
gC = tC_gC[head_cta_idx, None, None]
gC = tC_gC[None, None, head_cta_idx, None]
else:
gQ = cute.local_tile(mQ,cute.slice_(self.qk_mma_tiler,(None,0,None)),(None,None,None))
gC = cute.local_tile(mC,cute.slice_(self.pv_mma_tiler,(None,None,0)),(None,None,None))