-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Feat] Refactor rejection sampler #4975
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
Merged
wangxiyuan
merged 19 commits into
vllm-project:main
from
realliujiaxu:refactor-rejection-sampler-rebase
Dec 16, 2025
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
dd08323
extract _sample
realliujiaxu ba3360b
extract _bookkeeping_sync
realliujiaxu e95e7fb
refactor rejection sampler
realliujiaxu a54e195
fix lint
realliujiaxu c8a92e3
delete AscendRejectionSampler
realliujiaxu 876ee5c
fix eagle proposer
realliujiaxu 5cba4c7
delete _bookkeeping_sync
realliujiaxu 44b4582
update bookkeeping
realliujiaxu ad659f1
fix async scheduling
realliujiaxu 8882134
fix lint
realliujiaxu 9b1b816
Merge remote-tracking branch 'origin/main' into refactor-rejection-sa…
realliujiaxu 8cddedb
Merge branch 'main' into refactor-rejection-sampler-rebase
realliujiaxu 8886f90
Merge branch 'main' into refactor-rejection-sampler-rebase
realliujiaxu 4369d54
Merge remote-tracking branch 'origin/main' into refactor-rejection-sa…
realliujiaxu 0b9ad8b
fix bookkeeping
realliujiaxu 5c61b3e
rm unused `prev_sampled_token_ids_invalid_indices`
realliujiaxu ee2ea15
add comment and e2e UT
realliujiaxu 6a36ee8
Merge branch 'main' into refactor-rejection-sampler-rebase
realliujiaxu 2b85726
Merge branch 'main' into refactor-rejection-sampler-rebase
realliujiaxu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import vllm.v1.sample.rejection_sampler as rs | ||
|
|
||
| from vllm_ascend.sample.rejection_sampler import (apply_sampling_constraints, | ||
| expand_batch_to_tokens, | ||
| rejection_sample) | ||
|
|
||
| # TODO: delete this patch after apply_sampling_constraints and rejection_sample | ||
| # are extracted to as class func of RejectionSampler | ||
| rs.apply_sampling_constraints = apply_sampling_constraints | ||
| rs.rejection_sample = rejection_sample | ||
| rs.expand_batch_to_tokens = expand_batch_to_tokens |
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
update this file please https://github.com/vllm-project/vllm-ascend/blob/main/vllm_ascend/patch/__init__.py