Skip to content

Commit 71e5b4a

Browse files
authored
Cast loaded tensor to dout_ptr's dtype (#855)
1 parent 175d263 commit 71e5b4a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mamba_ssm/ops/triton/ssd_chunk_scan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def _chunk_scan_bwd_dstates_kernel(
497497
seq_idx_k = tl.load(seq_idx_ptrs, mask=offs_k < chunk_size_limit - k, other=-1)
498498
scale_k = tl.where(seq_idx_k == seq_idx_prev, tl.exp(dA_cs_k), 0.0)
499499
dout = (dout * scale_k).to(dout_ptr.dtype.element_ty)
500-
c = tl.load(c_ptrs, mask=(offs_k[:, None] < chunk_size_limit - k) & (offs_n[None, :] < dstate), other=0.0)
500+
c = tl.load(c_ptrs, mask=(offs_k[:, None] < chunk_size_limit - k) & (offs_n[None, :] < dstate), other=0.0).to(dout_ptr.dtype.element_ty)
501501
acc += tl.dot(dout, c)
502502
dout_ptrs += BLOCK_SIZE_K * stride_dout_seqlen
503503
c_ptrs += BLOCK_SIZE_K * stride_c_seqlen

0 commit comments

Comments
 (0)