vllm - 💡(How to fix) Fix [Feature]: Make DS layout used by default

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Since DS layout shows better performance it is a good reason to use it by default in vLLM because currently is is available only using VLLM_SSM_CONV_STATE_LAYOUT =DS env var. The problem to enable it by default is that @tdoublep commented in PR #37416:

> I'd probably have a preference that we just change the layout in all cases, rather than introduce a new env variable, but it looks like the new layout doesn't yet support MTP + "align" mode prefix caching, so it's OK for now.

Code Example

================================================================================
BENCHMARK SUMMARY
================================================================================

DS:
------------------------------------------------------------
  TP |    Req/s |      Tok/s |   TTFT(ms) |   TPOT(ms)
------------------------------------------------------------
   1 |    20.61 |    4009.30 |     128.67 |      23.50
   2 |    24.15 |    4686.47 |     119.85 |      21.18
   4 |    28.48 |    5556.18 |     112.23 |      18.23

SD:
------------------------------------------------------------
  TP |    Req/s |      Tok/s |   TTFT(ms) |   TPOT(ms)
------------------------------------------------------------
   1 |    20.34 |    3954.31 |     142.86 |      23.78
   2 |    23.86 |    4681.23 |     161.49 |      20.92
   4 |    26.63 |    5182.43 |     167.71 |      19.39

================================================================================

---

> I'd probably have a preference that we just change the layout in all cases, rather than introduce a new env variable, but it looks like the new layout doesn't yet support MTP + "align" mode prefix caching, so it's OK for now.
RAW_BUFFERClick to expand / collapse

🚀 The feature, motivation and pitch

Currently vLLM uses SMM Conv state layout set as SD (state_len, dim). Recent PR [Kernel] Mamba support different layout for Conv state#37416 has created support for transposed DS layout (dim, state_len).

Based on perf numbers showed in this PR DS layout has ~1.5x better TTFT compared to SD layout (perf numbers were taken from PR #37416 description Benchmark section):

================================================================================
BENCHMARK SUMMARY
================================================================================

DS:
------------------------------------------------------------
  TP |    Req/s |      Tok/s |   TTFT(ms) |   TPOT(ms)
------------------------------------------------------------
   1 |    20.61 |    4009.30 |     128.67 |      23.50
   2 |    24.15 |    4686.47 |     119.85 |      21.18
   4 |    28.48 |    5556.18 |     112.23 |      18.23

SD:
------------------------------------------------------------
  TP |    Req/s |      Tok/s |   TTFT(ms) |   TPOT(ms)
------------------------------------------------------------
   1 |    20.34 |    3954.31 |     142.86 |      23.78
   2 |    23.86 |    4681.23 |     161.49 |      20.92
   4 |    26.63 |    5182.43 |     167.71 |      19.39

================================================================================

Since DS layout shows better performance it is a good reason to use it by default in vLLM because currently is is available only using VLLM_SSM_CONV_STATE_LAYOUT =DS env var. The problem to enable it by default is that @tdoublep commented in PR #37416:

> I'd probably have a preference that we just change the layout in all cases, rather than introduce a new env variable, but it looks like the new layout doesn't yet support MTP + "align" mode prefix caching, so it's OK for now.

So, in order to enable DS layout by default at first we need to verify if DS supports MTP + "align" mode prefix caching, and if not then add this support.

Alternatives

No response

Additional context

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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

vllm - 💡(How to fix) Fix [Feature]: Make DS layout used by default