Skip to content

Conversation

@heheda12345
Copy link
Collaborator

@heheda12345 heheda12345 commented Sep 11, 2025

Purpose

key is default_stride = list(range(5)) to default_stride = tuple(range(5))
Also improve the test coverage by testing both contiguous and uncontiguous

Test Plan

Test Result


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.

Signed-off-by: Chen Zhang <zhangch99@outlook.com>
@mergify mergify bot added the v1 label Sep 11, 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 addresses a flaky test, test_kv_cache_stride_order, by replacing the random generation of stride permutations with a deterministic loop over two specific stride orders. This change ensures that both a non-contiguous and a contiguous memory layout are tested consistently, improving the reliability of the test. The conversion of default_stride from a list to a tuple is also a correct fix for the comparison logic. The changes are sound and effectively resolve the flakiness issue.

]
# TODO mla test
default_stride = list(range(5))
default_stride = tuple(range(5))
Copy link
Member

Choose a reason for hiding this comment

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

Why does using list cause it to be flaky (just out of interest)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if default_stride == test_stride: is always false if comparing tuple with list

Copy link
Member

Choose a reason for hiding this comment

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

OK, so it always tries to assert:

assert all(not kv.is_contiguous() for kv in model_runner.kv_caches)

and will will sometimes be True and sometime False depending on the rnd_stride

@tdoublep tdoublep enabled auto-merge (squash) September 11, 2025 07:30
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 11, 2025
Signed-off-by: Chen Zhang <zhangch99@outlook.com>
@tdoublep tdoublep merged commit 561a0ba into vllm-project:main Sep 12, 2025
19 checks passed
skyloevil pushed a commit to skyloevil/vllm that referenced this pull request Sep 13, 2025
…_stride_order (vllm-project#24640)

Signed-off-by: Chen Zhang <zhangch99@outlook.com>
dsxsteven pushed a commit to dsxsteven/vllm_splitPR that referenced this pull request Sep 15, 2025
…_stride_order (vllm-project#24640)

Signed-off-by: Chen Zhang <zhangch99@outlook.com>
FeiDaLI pushed a commit to FeiDaLI/vllm that referenced this pull request Sep 25, 2025
…_stride_order (vllm-project#24640)

Signed-off-by: Chen Zhang <zhangch99@outlook.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 10, 2025
…_stride_order (vllm-project#24640)

Signed-off-by: Chen Zhang <zhangch99@outlook.com>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
choprahetarth pushed a commit to Tandemn-Labs/vllm that referenced this pull request Oct 11, 2025
…_stride_order (vllm-project#24640)

Signed-off-by: Chen Zhang <zhangch99@outlook.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
…_stride_order (vllm-project#24640)

Signed-off-by: Chen Zhang <zhangch99@outlook.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

ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants