Skip to content

[RFC]: Native support for Mamba, SSM, and hybrid transformer models in vLLM V1 #17140

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

Open
4 of 9 tasks
tlrmchlsmth opened this issue Apr 24, 2025 · 3 comments
Open
4 of 9 tasks
Labels

Comments

@tlrmchlsmth
Copy link
Collaborator

tlrmchlsmth commented Apr 24, 2025

Motivation.

Mamba, SSM, and hybrid transformer models are an important path forward towards models that scale linearly with sequence length. vLLM currently supports many models of this class (Jamba, Mamba, Codestral Mamba, Falcon Mamba, Bamba, Zamba2, MinimaxText01, Plamo2), and should continue to maintain excellent support for these models.

The Problem
SSM model generally are less-well supported than transformers in vLLM, and have several deficiencies.
This RFC proposes several improvements (some already in progress) to SSM models, and additionally will serve as an issue tracker.

The major issue is that SSM models not supported in vLLM V1, and should be supported before V0 is deprecated.
In addition:

  • SSM state management is a little hacky and is managed by the model definition.
  • Since the SSM state is not managed by the block manager, SSM models are incompatible with prefix caching, KV cache offloading, and prefill-decode disaggregation.
  • There are major performance issues with chunked prefill.

Proposed Change.

Blockers for SSM and hybrid model support vLLM V1

  • Hybrid Allocator: [RFC]: Hybrid Memory Allocator #11382 (initial work is targeted towards sliding-window attention)
  • Once the hybrid allocator is landed, extend it to support SSM and hybrid models
  • torch.compile support (needed for piecewise CUDA graphs)

Other improvements

Feedback Period.

No response

CC List.

@fabianlim @cyang49 @mzusman @yury-tokpanov

Any Other Things.

No response

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
@cyang49
Copy link
Contributor

cyang49 commented Apr 25, 2025

Added the draft PR #17146 for the causal_conv1d refactor mentioned by @tlrmchlsmth

@thoangtrvn
Copy link

thoangtrvn commented Apr 25, 2025

We're testing the two implemented Triton kernels for causal-conv-1d for decode-only and prefix-decode mode of input to extend the supports of Mamba-based models beyond CUDA GPUs. I am working with @cyang49 and @fabianlim to test this integration.

@thoangtrvn
Copy link

We have raised a PR on Triton-only backends at issue #18218

We have showed that Triton-only backends on Bamba achieved high performant. It is also one step closer to comply with vLLM v1 design where we don't treat prefill requests and decode requests separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants