Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion mamba-ssm/build.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[general]
name = "mamba_ssm"
universal = false
backends = ["cuda"]
python-depends = ["einops"]

[torch]
src = [
Expand Down
99 changes: 13 additions & 86 deletions mamba-ssm/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions mamba-ssm/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
kernel-builder.lib.genFlakeOutputs {
inherit self;
path = ./.;

# Has many external dependencies, see README.md, this kernel should
# probably be more lean.
doGetKernelCheck = false;
Expand All @@ -24,4 +25,5 @@
transformers
];
};

}
14 changes: 6 additions & 8 deletions mamba-ssm/torch-ext/mamba_ssm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
__version__ = "2.2.4"

from .ops import selective_state_update, mamba_chunk_scan_combined, mamba_split_conv1d_scan_combined
from .ops.selective_scan_interface import selective_scan_fn, mamba_inner_fn
from .modules.mamba_simple import Mamba
from .modules.mamba2 import Mamba2
from .models.mixer_seq_simple import MambaLMHeadModel
from .modules import Mamba, Mamba2
from .models import MambaLMHeadModel

falcon_mamba_inner_fn = mamba_inner_fn
__all__ = [
"selective_scan_fn",
"mamba_inner_fn",
"Mamba",
"Mamba2",
"MambaLMHeadModel",
"selective_scan_fn", "mamba_inner_fn", "falcon_mamba_inner_fn", "selective_state_update", "mamba_chunk_scan_combined", "mamba_split_conv1d_scan_combined",
"Mamba", "Mamba2", "MambaLMHeadModel",
]
5 changes: 5 additions & 0 deletions mamba-ssm/torch-ext/mamba_ssm/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .mixer_seq_simple import MambaLMHeadModel

__all__ = [
"MambaLMHeadModel",
]
7 changes: 7 additions & 0 deletions mamba-ssm/torch-ext/mamba_ssm/modules/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .mamba_simple import Mamba
from .mamba2 import Mamba2

__all__ = [
"Mamba",
"Mamba2",
]
1 change: 1 addition & 0 deletions mamba-ssm/torch-ext/mamba_ssm/ops/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .triton import selective_state_update, mamba_chunk_scan_combined, mamba_split_conv1d_scan_combined
2 changes: 2 additions & 0 deletions mamba-ssm/torch-ext/mamba_ssm/ops/triton/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .selective_state_update import selective_state_update
from .ssd_combined import mamba_chunk_scan_combined, mamba_split_conv1d_scan_combined
3 changes: 1 addition & 2 deletions mamba-ssm/torch-ext/mamba_ssm/utils/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
from einops import rearrange, repeat
from torch import Tensor
from torch.profiler import ProfilerActivity, profile, record_function
from transformers.generation import GreedySearchDecoderOnlyOutput, SampleDecoderOnlyOutput, TextStreamer

from transformers.generation import GenerateDecoderOnlyOutput, TextStreamer

@dataclass
class InferenceParams:
Expand Down