Skip to content

[Feature][Config] Support application-directed Mamba checkpoint token and input processing - #55873

Open
nicholaskh-ai wants to merge 1 commit into
vllm-project:mainfrom
nicholaskh-ai:feat/mamba-checkpoint-token-input-processor
Open

nicholaskh-ai wants to merge 1 commit into
vllm-project:mainfrom
nicholaskh-ai:feat/mamba-checkpoint-token-input-processor

Conversation

@nicholaskh-ai

@nicholaskh-ai nicholaskh-ai commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Purpose

Implements RFC #55697.

Part 1 of 3 for Application-Directed Mamba Prefix Checkpointing.

Hybrid GDN/Mamba architectures (e.g. Qwen3.5 35B-A3B) exhibit high state memory footprint (128KB-512KB per layer) compared to pure Attention. In catalog attribute extraction, multi-candidate verification, and agent workflows where 1 common product/document prefix is shared across multiple concurrent candidate queries, heuristics cannot safely determine application semantic boundaries (such as text prompt vs multimodal image boundaries).

This PR introduces explicit application-directed checkpointing at the input layer:

  • Adds --enable-mamba-checkpoint and --mamba-checkpoint-token (defaults to <|mamba_checkpoint|>) CLI & engine options.
  • Automatically sets mamba_cache_mode = "align" when checkpointing is enabled.
  • Dynamically registers <|mamba_checkpoint|> as a special token in the HF renderer.
  • Parses and strips the checkpoint marker in InputProcessor while adjusting multimodal placeholder offsets.
  • Propagates mamba_checkpoint_position into Request.

Follow-up PRs:

  • Part 2: Scheduler coordination, checkpoint boundary chunk splitting, and unready state machine.
  • Part 3: Batched two-phase grouped prefill execution for hybrid GDN/Mamba (up to 7.6x speedup on L40S).

Duplicate-work Check

Test Plan

  • Unit tests for HF renderer tokenizer registration:
    pytest tests/renderers/test_hf.py -k "test_ensure_mamba_checkpoint_token" -v
  • Unit tests for InputProcessor marker extraction and multimodal placeholder offset shifting:
    pytest tests/v1/engine/test_input_processor_trace_replay.py -k "test_extract_mamba_checkpoint" -v
  • Unit test for Request data structure propagation:
    pytest tests/v1/test_request.py -k "test_request_copies_session_id" -v

AI assistance was used to prepare this change. The human submitter is responsible for reviewing the changed code and test results.

Generated with Devin

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Signed-off-by: nizhang1 nizhang1@coupang.com

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify

mergify Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @nicholaskh-ai.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@nicholaskh-ai

Copy link
Copy Markdown
Contributor Author

CC @mgoin @youkaichao

Hi reviewers, this is Part 1 of the implementation stack for RFC #55697. It introduces the application-directed Mamba checkpoint token and InputProcessor parsing/multimodal alignment without altering model execution.

Whenever you have a moment, we would appreciate your review and adding the ready label to kick off CI. Thanks!

@nicholaskh-ai
nicholaskh-ai force-pushed the feat/mamba-checkpoint-token-input-processor branch from 4cac14b to 56c4c64 Compare September 9, 2026 12:24
@mergify

mergify Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @nicholaskh-ai.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Sep 9, 2026
@nicholaskh-ai
nicholaskh-ai force-pushed the feat/mamba-checkpoint-token-input-processor branch from 56c4c64 to 483434d Compare September 9, 2026 12:46
@mergify mergify Bot removed the needs-rebase label Sep 9, 2026
@nicholaskh-ai
nicholaskh-ai force-pushed the feat/mamba-checkpoint-token-input-processor branch from 483434d to 370f43e Compare September 9, 2026 16:09
…rker and input processing

- Add --enable-mamba-checkpoint and --mamba-checkpoint-token CLI & engine options
- Register <|mamba_checkpoint|> token into tokenizer dynamically in HF renderer
- Parse and strip mamba checkpoint token in InputProcessor with offset adjustments
- Add unit tests for HF renderer and InputProcessor token extraction

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Signed-off-by: nizhang1 <nizhang1@coupang.com>
@nicholaskh-ai
nicholaskh-ai force-pushed the feat/mamba-checkpoint-token-input-processor branch from 370f43e to 2377a44 Compare September 10, 2026 05:52
KonnyakuMatcha added a commit to KonnyakuMatcha/vllm-HOT that referenced this pull request Sep 14, 2026
Document the exact single-session HOT design, relationship to existing
Mamba prefix-cache work (vllm-project#55697/vllm-project#55873/vllm-project#55875/vllm-project#55876, vllm-project#52959, vllm-project#45702),
TTFT evaluation, correctness status, and async-scheduling limitations.

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: KonnyakuLC <1690982212@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant