Instructions to use dynatrace-oss/chunkable-mamba2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dynatrace-oss/chunkable-mamba2 with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("dynatrace-oss/chunkable-mamba2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
chore: remove pinned kernel versions
Browse files
chunkable_ssd_combined.py
CHANGED
|
@@ -12,16 +12,16 @@ import triton.language as tl
|
|
| 12 |
|
| 13 |
from einops import rearrange
|
| 14 |
|
| 15 |
-
from transformers.integrations.hub_kernels import
|
| 16 |
|
| 17 |
|
| 18 |
-
|
| 19 |
-
causal_conv1d
|
| 20 |
-
mamba_ssm = get_kernel("kernels-community/mamba-ssm", revision="00b2ecd499379f9bcf969b6796e53bc867f4ad38")
|
| 21 |
-
|
| 22 |
causal_conv1d_fwd_function = causal_conv1d.cpp_functions.causal_conv1d_fwd_function
|
| 23 |
causal_conv1d_bwd_function = causal_conv1d.cpp_functions.causal_conv1d_bwd_function
|
| 24 |
|
|
|
|
|
|
|
| 25 |
custom_fwd = mamba_ssm.utils.torch.custom_fwd
|
| 26 |
custom_bwd = mamba_ssm.utils.torch.custom_bwd
|
| 27 |
_layer_norm_bwd = mamba_ssm.ops.triton.layernorm_gated._layer_norm_bwd
|
|
|
|
| 12 |
|
| 13 |
from einops import rearrange
|
| 14 |
|
| 15 |
+
from transformers.integrations.hub_kernels import lazy_load_kernel
|
| 16 |
|
| 17 |
|
| 18 |
+
causal_conv1d = lazy_load_kernel("causal-conv1d")
|
| 19 |
+
assert causal_conv1d is not None, "Failed to load causal-conv1d kernel. Make sure all requirements are fulfilled: https://huggingface.co/kernels-community/causal-conv1d"
|
|
|
|
|
|
|
| 20 |
causal_conv1d_fwd_function = causal_conv1d.cpp_functions.causal_conv1d_fwd_function
|
| 21 |
causal_conv1d_bwd_function = causal_conv1d.cpp_functions.causal_conv1d_bwd_function
|
| 22 |
|
| 23 |
+
mamba_ssm = lazy_load_kernel("mamba-ssm")
|
| 24 |
+
assert mamba_ssm is not None, "Failed to load mamba-ssm kernel. Make sure all requirements are fulfilled: https://huggingface.co/kernels-community/mamba-ssm"
|
| 25 |
custom_fwd = mamba_ssm.utils.torch.custom_fwd
|
| 26 |
custom_bwd = mamba_ssm.utils.torch.custom_bwd
|
| 27 |
_layer_norm_bwd = mamba_ssm.ops.triton.layernorm_gated._layer_norm_bwd
|