Skip to content

Conversation

seemethere
Copy link
Contributor

@seemethere seemethere commented Jun 25, 2025

Essential Elements of an Effective PR Description Checklist

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Purpose

This dependency wasn't actually getting used in the original PR (#14323) since most of the code was just lifted and shifted from the mamba repository and is now causing issues once we updated torch to 2.7.0.

Related issues / PRs:

There was even a workaround PR where we have to install this from source using --no-build-isolation here:

Test Plan

CI

Test Result

(Optional) Documentation Update

This dependency wasn't actually getting used and caused issues once we
updated torch to 2.7.0.

Signed-off-by: Eli Uriegas <eliuriegas@meta.com>
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @seemethere, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on streamlining the test environment by removing an unnecessary and problematic dependency. The mamba_ssm package, which was not actively used and caused conflicts with updated PyTorch versions, has been entirely removed from the test requirements, leading to a cleaner and more stable dependency tree for testing purposes.

Highlights

  • Dependency Removal: I've removed the mamba_ssm dependency from requirements/test.in. This dependency was identified as unused in a previous PR and was causing issues with torch==2.7.0, necessitating its removal to resolve build conflicts.
  • Transitive Dependency Cleanup: As a direct result of removing mamba_ssm from requirements/test.in, the generated requirements/test.txt has been automatically cleaned up. This includes the removal of mamba-ssm itself, its associated comments, and its transitive dependency ninja.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify mergify bot added the ci/build label Jun 25, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the mamba_ssm dependency, which is reported as unused and is causing build issues with newer versions of torch. The changes are confined to the requirements files (test.in and the auto-generated test.txt), correctly removing the package and its transitive dependencies.

The change is clean and well-justified by the PR description. The test plan relies on CI, which is appropriate for this type of change. Assuming CI passes, this is a good cleanup and ready to merge.

Signed-off-by: Eli Uriegas <eliuriegas@meta.com>
@seemethere
Copy link
Contributor Author

cc @Alnusjaponica for a review since you originally added it and to sanity check my assumption that this dependency is not used.

@mgoin
Copy link
Member

mgoin commented Jun 25, 2025

cc @tlrmchlsmth

@aarnphm
Copy link
Collaborator

aarnphm commented Jun 25, 2025

we vendored the mamba_ssm kernel onto vllm, so probably safe to remove this.

On a side note, do you know the timeline for supporting mamba in v1 🤔?

@tdoublep
Copy link
Member

This requirement is there to support the plamo2 model:

mamba_ssm # required for plamo2 test

This model has not yet been rebased against the Mamba2 implementation that is vendored within vLLM:

class Plamo2MambaMixer(nn.Module):
# TODO(Shinichi): Rebase on Mamba2 implementation.

There is a test that runs, optionally, in the CI:


which will may no longer work if we remove the mamba_ssm package. Although I think transformers has a "slow" path that runs without installing this package, so the test could still work actually.

If we remove the mamba_ssm dependency, we should also remove the installation of causal_conv1d which is related to the same model.

# NOTE: Running Plamo2 in transformers implementation requires to install
# causal-conv1d package, which is not listed as a test dependency as it's
# not compatible with pip-compile.
"pfnet/plamo-2-1b",

The causal_conv1d is installed in the CI pipeline (rather than being an explicit dependency):
# Install causal-conv1d for plamo2 models here, as it is not compatible with pip-compile.
- pip install 'git+https://github.com/Dao-AILab/causal-conv1d@v1.5.0.post8'

Another option could be to install the mamba_ssm package in the CI pipeline in the same way that causal_conv1d is installed. That way it doesn't mess up local installations for people, but the model can still be tested?

It would be good to run the "Language Models Test (Extended Generation)" test in Buildkite to see if this change breaks anything. It would also be good to get the team who contributed the model to weigh in here cc @Alnusjaponica

@seemethere
Copy link
Contributor Author

Yeah I think in particular I don't want to land this PR until we have a full CI run.

My main takeaway from grepping through the code is that we never directly import mamba_ssm hence the PR here.

@aarnphm aarnphm added the ready ONLY add when PR is ready to merge/full CI is needed label Jun 25, 2025
@aarnphm
Copy link
Collaborator

aarnphm commented Jun 25, 2025

Let me enable full CI run to see if there are any failure, but probably echo Thomas comment here.

@tdoublep
Copy link
Member

It turns out that transformers has a hard dependency on this package when running Nemotron-H models. If you don't have it installed it throws:

    try:
        #from mamba_ssm.ops.triton.layernorm_gated import RMSNorm as RMSNormGated
>       from mamba_ssm.ops.triton.layernorm_gated import rmsnorm_fn
E       ModuleNotFoundError: No module named 'mamba_ssm'

../.cache/huggingface/modules/transformers_modules/nvidia/Nemotron-H-8B-Base-8K/281935db305672111f043428fe4982969876613c/modeling_nemotron_h.py:63: ModuleNotFoundError

While we don't have any tests that run for Nemotron-H yet, perhaps we might want to add some?

I think I would advocate for removing the package from the explicit dependencies but installing it inside the CI job (similar to how we handle causal_conv1d right now).

@seemethere
Copy link
Contributor Author

It turns out that transformers has a hard dependency on this package when running Nemotron-H models. If you don't have it installed it throws:

    try:
        #from mamba_ssm.ops.triton.layernorm_gated import RMSNorm as RMSNormGated
>       from mamba_ssm.ops.triton.layernorm_gated import rmsnorm_fn
E       ModuleNotFoundError: No module named 'mamba_ssm'

../.cache/huggingface/modules/transformers_modules/nvidia/Nemotron-H-8B-Base-8K/281935db305672111f043428fe4982969876613c/modeling_nemotron_h.py:63: ModuleNotFoundError

While we don't have any tests that run for Nemotron-H yet, perhaps we might want to add some?

I think I would advocate for removing the package from the explicit dependencies but installing it inside the CI job (similar to how we handle causal_conv1d right now).

Okay sounds good! I'll update this PR to install it for CI similar to what we do for causal_conv1d

@Alnusjaponica
Copy link
Contributor

Sorry for my delayed reply and any confusion.

Based on my understanding, mamba_ssm and causal_conv1d are dependencies only for unit tests, as shown here. The original transformers implementation also relies on these libraries.
I do not fully understand why mamba-ssm is included in the Docker image by #17070, but as long as the unit tests are not run with the plain image, they are unnecessary. In that context, we would appreciate it if you could maintain the unit tests by moving the installation step to the CI pipeline, as mentioned in this comment. If that doesn’t work, one possible workaround is to hard-code the expected inference results in the unit test instead of running the transformers implementation.

@DarkLight1337
Copy link
Member

Closing as superseded by #21421

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/build ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants