Skip to content

Conversation

@hl475
Copy link
Contributor

@hl475 hl475 commented Sep 30, 2025

Purpose

#24683 removed the helper function _query_start_loc_to_chunk_indices_offsets and breaks the tests/kernels/mamba/test_mamba_ssm_ssd.py (sample job https://buildkite.com/vllm/ci/builds/32891/steps/canvas?sid=019998c8-1682-4e2d-8161-55a772c16cde) from v1.attention.backends.mamba2_attn as part of the chunk‑aligned Mamba2 changes. This made tests/kernels/mamba/test_mamba_ssm_ssd.py fail at import time. This patch removes the import and computes the small piece of chunk metadata directly in the test, also providing cu_chunk_seqlens and last_chunk_indices expected by the new kernels. No runtime changes.

This PR

Test Plan

pytest tests/kernels/mamba/test_mamba_ssm_ssd.py -v -s

Test Result

======================================================= 348 passed, 1 warning in 823.24s (0:13:43) ========================================================

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.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@hl475 hl475 changed the title [wip] fix mamba test Fix test_mamba_ssm_ssd.py due to missing _query_start_loc_to_chunk_indices_offsets Sep 30, 2025
@hl475 hl475 marked this pull request as ready for review September 30, 2025 23:00
@tdoublep tdoublep self-requested a review October 1, 2025 06:36
Copy link
Member

@tdoublep tdoublep left a comment

Choose a reason for hiding this comment

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

Does this test not run as part of CI? Didn't realize it was broken.

chunk_lens.append(int(take))
seq_idx_chunks.append(b)
last_chunk_indices[b] = len(chunk_lens) - 1
pos += take
Copy link
Member

Choose a reason for hiding this comment

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

Rather than re-implementing this logic - I think it could be better to refactor the logic into a util function in the meta-data builder and import it (e.g., similarly to how we were doing it for _query_start_loc_to_chunk_indices_offsets).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @tdoublep !

I moved this helper function to vllm/v1/attention/backends/mamba2_attn.py . Let me know what you think!

Signed-off-by: Huamin Li <3ericli@gmail.com>
@hl475 hl475 requested a review from LucasWilkinson as a code owner October 1, 2025 07:27
@mergify mergify bot added the v1 label Oct 1, 2025
@hl475
Copy link
Contributor Author

hl475 commented Oct 1, 2025

@tdoublep

Does this test not run as part of CI? Didn't realize it was broken.

Regarding this, from https://github.com/vllm-project/vllm/blob/main/.buildkite/test-pipeline.yaml#L473C10-L480 , my guess is it will run only if changes touch

  source_file_dependencies:
  - csrc/mamba/
  - tests/kernels/mamba

Your PR didn't touch those directories so it didn't get triggered. Let me know if you want to change that, and I am happy to add vllm/v1/attention/backends/mamba2_attn.py into the list!

Copy link
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

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

Looks reasonable and would like to merge to unblock CI, thank you

@mgoin mgoin added the ci-failure Issue about an unexpected test failure in CI label Oct 1, 2025
@mgoin mgoin enabled auto-merge (squash) October 1, 2025 16:32
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 1, 2025
@mgoin mgoin merged commit c36f0aa into vllm-project:main Oct 1, 2025
51 checks passed
pdasigi pushed a commit to pdasigi/vllm that referenced this pull request Oct 2, 2025
…dices_offsets (vllm-project#25995)

Signed-off-by: Huamin Li <3ericli@gmail.com>
yewentao256 pushed a commit that referenced this pull request Oct 3, 2025
…dices_offsets (#25995)

Signed-off-by: Huamin Li <3ericli@gmail.com>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
tomeras91 pushed a commit to tomeras91/vllm that referenced this pull request Oct 6, 2025
…dices_offsets (vllm-project#25995)

Signed-off-by: Huamin Li <3ericli@gmail.com>
Signed-off-by: Tomer Asida <57313761+tomeras91@users.noreply.github.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 10, 2025
…dices_offsets (vllm-project#25995)

Signed-off-by: Huamin Li <3ericli@gmail.com>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
lywa1998 pushed a commit to lywa1998/vllm that referenced this pull request Oct 20, 2025
…dices_offsets (vllm-project#25995)

Signed-off-by: Huamin Li <3ericli@gmail.com>
alhridoy pushed a commit to alhridoy/vllm that referenced this pull request Oct 24, 2025
…dices_offsets (vllm-project#25995)

Signed-off-by: Huamin Li <3ericli@gmail.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
…dices_offsets (vllm-project#25995)

Signed-off-by: Huamin Li <3ericli@gmail.com>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-failure Issue about an unexpected test failure in CI ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants