-
-
Couldn't load subscription status.
- Fork 10.8k
[CI] Fix flaky test v1/worker/test_gpu_model_runner.py::test_kv_cache_stride_order #24640
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
[CI] Fix flaky test v1/worker/test_gpu_model_runner.py::test_kv_cache_stride_order #24640
Conversation
Signed-off-by: Chen Zhang <zhangch99@outlook.com>
There was a problem hiding this 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)) |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Signed-off-by: Chen Zhang <zhangch99@outlook.com>
…_stride_order (vllm-project#24640) Signed-off-by: Chen Zhang <zhangch99@outlook.com>
…_stride_order (vllm-project#24640) Signed-off-by: Chen Zhang <zhangch99@outlook.com>
…_stride_order (vllm-project#24640) Signed-off-by: Chen Zhang <zhangch99@outlook.com>
…_stride_order (vllm-project#24640) Signed-off-by: Chen Zhang <zhangch99@outlook.com> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
…_stride_order (vllm-project#24640) Signed-off-by: Chen Zhang <zhangch99@outlook.com>
…_stride_order (vllm-project#24640) Signed-off-by: Chen Zhang <zhangch99@outlook.com> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Purpose
key is
default_stride = list(range(5))todefault_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
supported_models.mdandexamplesfor a new model.