Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ def __init__(
self.num_regs_other = 32
self.buffer_align_bytes = 1024
self.arch = BaseDSL._get_dsl().get_arch_enum()
# SM101 (e.g. Thor) shares the SM100 TMEM load path; other arches use LdRed.
self.uses_sm100_softmax_tmem_load = (
(self.arch >= Arch.sm_100 and self.arch <= Arch.sm_100f)
or (self.arch >= Arch.sm_101 and self.arch <= Arch.sm_101f)
)

if self.arch >= Arch.sm_103:
assert self.enable_ex2_emulation == False, (
Expand Down Expand Up @@ -2260,9 +2265,7 @@ def softmax_step(
old_row_max = row_max
skip_softmax = cutlass.Boolean(False)
if whether_apply_mask:
if cutlass.const_expr(
self.arch >= Arch.sm_100 and self.arch <= Arch.sm_100f
):
if cutlass.const_expr(self.uses_sm100_softmax_tmem_load):
cute.copy(tiled_tmem_load, tTMEM_LOADtS, tTMEM_LOADrS)
else:
tTMEM_LOADrMax = cute.make_rmem_tensor(
Expand Down Expand Up @@ -2308,9 +2311,7 @@ def softmax_step(
inplace_producer.commit()
inplace_producer.advance()
else:
if cutlass.const_expr(
self.arch >= Arch.sm_100 and self.arch <= Arch.sm_100f
):
if cutlass.const_expr(self.uses_sm100_softmax_tmem_load):
cute.copy(
tiled_tmem_load,
tTMEM_LOADtS[None, 0, None, None],
Expand Down Expand Up @@ -2731,7 +2732,7 @@ def softmax(
)
tmem_p_offset = self.tmem_p0_offset if stage == 0 else self.tmem_p1_offset
tStS_P = cute.make_tensor(tStS.iterator + tmem_p_offset, tStS_P_layout)
if cutlass.const_expr(self.arch >= Arch.sm_100 and self.arch <= Arch.sm_100f):
if cutlass.const_expr(self.uses_sm100_softmax_tmem_load):
tmem_load_atom = cute.make_copy_atom(
tcgen05.copy.Ld32x32bOp(tcgen05.copy.Repetition(32)),
self.qk_acc_dtype,
Expand Down