-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Add mamba-ssm #29888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mamba-ssm #29888
Conversation
Mamba state-space model! Repo at https://github.com/state-spaces/mamba
|
Hi! This is the staged-recipes linter and your PR looks excellent! 🚀 |
Fixes `NameError: name 'bare_metal_version' is not defined` on platforms without CUDA, xref state-spaces/mamba#602
|
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipes/mamba-ssm/recipe.yaml:
This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/14747268959. Examine the logs at this URL for more detail. |
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
|
There's an RuntimeError on the Installing test environment
✔ Successfully updated the test environment
+ python $SRC_DIR/conda_build_script.py
Traceback (most recent call last):
File "$SRC_DIR/conda_build_script.py", line 1, in <module>
import mamba_ssm
File "$PREFIX/lib/python3.12/site-packages/mamba_ssm/__init__.py", line 3, in <module>
from mamba_ssm.ops.selective_scan_interface import selective_scan_fn, mamba_inner_fn
File "$PREFIX/lib/python3.12/site-packages/mamba_ssm/ops/selective_scan_interface.py", line 16, in <module>
from mamba_ssm.ops.triton.layer_norm import _layer_norm_fwd
File "$PREFIX/lib/python3.12/site-packages/mamba_ssm/ops/triton/layer_norm.py", line 169, in <module>
@triton.autotune(
^^^^^^^^^^^^^^^^
File "$PREFIX/lib/python3.12/site-packages/triton/runtime/autotuner.py", line 352, in decorator
return Autotuner(fn, fn.arg_names, configs, key, reset_to_zero, restore_value, pre_hook=pre_hook,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "$PREFIX/lib/python3.12/site-packages/triton/runtime/autotuner.py", line 127, in __init__
self.do_bench = driver.active.get_benchmarker()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "$PREFIX/lib/python3.12/site-packages/triton/runtime/driver.py", line 23, in __getattr__
self._initialize_obj()
File "$PREFIX/lib/python3.12/site-packages/triton/runtime/driver.py", line 20, in _initialize_obj
self._obj = self._init_fn()
^^^^^^^^^^^^^^^
File "$PREFIX/lib/python3.12/site-packages/triton/runtime/driver.py", line 8, in _create_driver
raise RuntimeError(f"{len(actives)} active drivers ({actives}). There should only be one.")
RuntimeError: 0 active drivers ([]). There should only be one.
× error Script failed with status 1
× error Work directory: '/tmp/.tmpKdXIy2'
× error To debug the build, run it manually in the work directory (execute the `./conda_build.sh` or `conda_build.bat` script)Should have been fixed in triton-lang/triton#6570 (see also triton-lang/triton#6150). |
This reverts commit 00b51cd.
Until patch triton-lang/triton#6570 is available in a new triton release.
|
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipes/mamba-ssm/recipe.yaml:
This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/14764654406. Examine the logs at this URL for more detail. |
Will revert back to the proper `pip_check` when triton>3.3.0 comes out.
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
Because we need to match triton=3.1.0 with pytorch 2.5 cuda*, cannot pull in pytorch 2.6 yet. The `import mamba_ssm` check should now work, but still need to disable pip_check because of ninja import, xref conda-forge/ninja-feedstock#26
|
@conda-forge/help-python, ready for review! |
|
Gentle ping again @conda-forge/help-python to see if this can be reviewed and merged 🙏 |
recipes/mamba-ssm/recipe.yaml
Outdated
| skip: | ||
| # mamba-ssm requires CUDA (or ROCm) GPU | ||
| - cuda_compiler_version == "None" | ||
| # CUDA < 12 not supported by pytorch anymore | ||
| - cuda_compiler_version == "11.8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a pytorch cuda user, but can't this be noarch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this CUDA-dependent package is Linux only. And actually, the reason I'm packaging this is to get builds working on arm64 which aren't available on the release page at https://github.com/state-spaces/mamba/releases/tag/v2.2.4, so it's probably not a noarch package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you need compilers then? @jakirkham or @isuruf you have more experience with cuda recipes. Can you chime in and help us?
danielnachun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some suggestions for what I think are the basic CUDA requirements but there will probably be more needed.
Since patch from triton-lang/triton#6570 is out in triton=3.4.0 on conda-forge now.
Avoid `$PREFIX/lib/python3.9/site-packages/torch/utils/cpp_extension.py:480: UserWarning: The detected CUDA version (12.6) has a minor version mismatch with the version that was used to compile PyTorch (12.9). Most likely this shouldn't be a problem`.
This reverts commit 98e0ed1. Updated note to say that pin can be remove when pytorch builds with triton>=3.4.0.
| # disabled pip check because ninja is not available | ||
| # see https://github.com/conda-forge/ninja-feedstock/issues/26 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add ninja as a test-only dependency here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think there's a way to add test-only dependencies with v1 recipes for python tests - https://rattler.build/latest/reference/recipe_file/#python-tests, only able to set the python-version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gentle nudge again @danielnachun, are you ok with me keeping pip check disabled, or would you prefer another solution from conda-forge/ninja-feedstock#26?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point you can probably just patch out ninja from the pyproject.toml - if pip check doesn't work for this package, it also won't work for any Python package that ever depends on this, which is more of a concern. A simple sed -i 's/"ninja",//g' pyproject.toml should hopefully let pip check pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've added the patch, and Python 3.10 build's pip check seems to have passed. Just need to wait for the other matrix CI builds to finish.
|
Linter error seems to be due to #30936, and windows build error can be ignored since this recipe is for CUDA-enabled Linux builds only. |
| skip: | ||
| # mamba-ssm requires CUDA (or ROCm) GPU | ||
| - cuda_compiler_version == "None" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| skip: | |
| # mamba-ssm requires CUDA (or ROCm) GPU | |
| - cuda_compiler_version == "None" | |
| skip: | |
| # mamba-ssm requires CUDA (or ROCm) GPU | |
| - cuda_compiler_version == "None" | |
| - not linux |
I think we should also just be skipping macOS and Windows altogether here since this requires a CUDA compiler.
That does appear to be unrelated, but let's give the upstream team a chance to respond since that issue so new just to make sure there isn't some weird cryptic issue with the recipe itself here. |
|
My apologies but it appears a separate PR for this was already merged: #30861. In that case we'll have to close this, but please feel free to add yourself as a maintainer to the feedstock at https://github.com/conda-forge/mamba-ssm-feedstock. |
|
Oh great, I'll try and bring the changes from here into https://github.com/conda-forge/mamba-ssm-feedstock then. Thanks again for your time. |
Mamba state-space model! Repo at https://github.com/state-spaces/mamba
Checklist
url) rather than a repo (e.g.git_url) is used in your recipe (see here for more details).