You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make CUDA selective scan install explicit opt-in (#977)
* Made CUDA selective scan optional w/ MAMBA_KEEP_CUDA_BUILD
* Bumped python requirement from >=3.9 to >=3.10
---------
Co-authored-by: Caitlin Wang <123908556+caitWW@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+34-11Lines changed: 34 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,19 +25,42 @@ with an efficient hardware-aware design and implementation in the spirit of [Fla
25
25
26
26
## Installation
27
27
28
-
Install PyTorch first, then:
29
-
-[Option]`pip install causal-conv1d>=1.4.0 --no-build-isolation`: an efficient implementation of a simple causal Conv1d layer used inside the Mamba block.
30
-
-`pip install mamba-ssm --no-build-isolation`: the core Mamba package.
31
-
-`pip install mamba-ssm[causal-conv1d] --no-build-isolation`: To install core Mamba package and causal-conv1d.
32
-
33
-
`--no-build-isolation` is required so that pip uses your existing CUDA-enabled PyTorch instead of installing torch-cpu in an isolated build environment.
34
-
35
-
NOTE: To use Mamba-3, please install from source `MAMBA_FORCE_BUILD=TRUE pip install --no-cache-dir --force-reinstall git+https://github.com/state-spaces/mamba.git --no-build-isolation`.
36
-
37
-
Other requirements:
28
+
Install PyTorch first. By default, `mamba-ssm` installs the core package without compiling the
29
+
`selective_scan_cuda` extension and without downloading cached CUDA-enabled wheels.
30
+
31
+
| Install mode | Command | Behavior |
32
+
| --- | --- | --- |
33
+
| Core package |`pip install mamba-ssm --no-build-isolation`| Installs `mamba-ssm` without `selective_scan_cuda` and does not compile CUDA extensions. |
34
+
| Core package plus causal-conv1d |`pip install "mamba-ssm[causal-conv1d]" --no-build-isolation`| Installs the core package and the `causal-conv1d` extra, still without `selective_scan_cuda`. |
35
+
| Force local core package build |`MAMBA_FORCE_BUILD=TRUE pip install mamba-ssm --no-build-isolation`| Builds the default pure Python wheel locally, still without `selective_scan_cuda`. |
36
+
| CUDA selective scan opt-in |`MAMBA_KEEP_CUDA_BUILD=TRUE pip install mamba-ssm --no-build-isolation`| Installs `selective_scan_cuda`; pip first tries a matching prebuilt CUDA/HIP wheel, then compiles locally if no wheel is available. |
37
+
| Force local CUDA selective scan build |`MAMBA_FORCE_BUILD=TRUE MAMBA_KEEP_CUDA_BUILD=TRUE pip install mamba-ssm --no-build-isolation`| Skips cached wheels and compiles `selective_scan_cuda` locally. |
38
+
39
+
`--no-build-isolation` is required for CUDA builds so that pip uses your existing CUDA-enabled
40
+
PyTorch instead of installing torch-cpu in an isolated build environment.
41
+
42
+
Source installs use the same defaults and opt-in flags:
43
+
44
+
| Install mode | Command |
45
+
| --- | --- |
46
+
| Source default, no `selective_scan_cuda`|`pip install . --no-build-isolation`|
47
+
| Source default from GitHub, no `selective_scan_cuda`|`pip install git+https://github.com/state-spaces/mamba.git --no-build-isolation`|
48
+
| Source forced local core build, no `selective_scan_cuda`|`MAMBA_FORCE_BUILD=TRUE pip install . --no-build-isolation`|
0 commit comments