[UT][XPU] fix test_parallel_sampling due to global random state#42388
Merged
Conversation
Signed-off-by: zhenwei-intel <zhenwei.liu@intel.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the _get_test_sampling_params function in tests/v1/engine/test_llm_engine.py to use a local random number generator instance initialized with a seed, ensuring deterministic sampling parameter generation. I have no feedback to provide as there were no review comments to evaluate.
Contributor
Author
|
@jikunshang PTAL |
jikunshang
approved these changes
May 12, 2026
jikunshang
approved these changes
May 12, 2026
weifang231
pushed a commit
to weifang231/eb-vllm
that referenced
this pull request
May 13, 2026
…-project#42388) Signed-off-by: zhenwei-intel <zhenwei.liu@intel.com>
mfylcek
pushed a commit
to mfylcek/vllm
that referenced
this pull request
May 19, 2026
…-project#42388) Signed-off-by: zhenwei-intel <zhenwei.liu@intel.com>
jhu960213
pushed a commit
to jhu960213/vllm
that referenced
this pull request
May 20, 2026
…-project#42388) Signed-off-by: zhenwei-intel <zhenwei.liu@intel.com>
h1t35h
pushed a commit
to h1t35h/vllm
that referenced
this pull request
May 21, 2026
…-project#42388) Signed-off-by: zhenwei-intel <zhenwei.liu@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Problem:
_get_test_sampling_paramsuses the global random module. When run together with other test files in the same pytest session, the global random state is polluted, causing the generated n values to be larger than expected and increasing the probability of duplicate completions.Fix: Replace the global random with a local random.Random(seed) instance to ensure
n_listis deterministic regardless of test execution order.Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.