[Kernel] Triton implementation of causal-conv1d for Mamba-based models (#18218)
Signed-off-by: Tuan M. Hoang-Trong <tmhoangt@us.ibm.com> Co-authored-by: Tuan M. Hoang-Trong <tmhoangt@us.ibm.com> Co-authored-by: Tyler Michael Smith <tysmith@redhat.com> Co-authored-by: Tyler Michael Smith <tyler@neuralmagic.com>
This commit is contained in:
co-authored by
Tuan M. Hoang-Trong
Tyler Michael Smith
Tyler Michael Smith
parent
31b96d1c64
commit
47043eb678
@@ -36,10 +36,12 @@ class MambaCacheManager(ConstantSizeCache):
|
||||
# Initialize parent class
|
||||
super().__init__(max_batch_size)
|
||||
|
||||
# assume conv_state = (dim, state_len)
|
||||
assert conv_state_shape[0] > conv_state_shape[1]
|
||||
conv_state = torch.empty(size=(num_mamba_layers, max_batch_size) +
|
||||
conv_state_shape,
|
||||
(conv_state_shape[1], conv_state_shape[0]),
|
||||
dtype=dtype,
|
||||
device="cuda")
|
||||
device="cuda").transpose(-1, -2)
|
||||
temporal_state = torch.empty(size=(num_mamba_layers, max_batch_size) +
|
||||
temporal_state_shape,
|
||||
dtype=dtype,
|
||||
|
||||
Reference in New Issue
Block a user