-
Notifications
You must be signed in to change notification settings - Fork 247
Add sampling support for Tinker SkyRL backend #999
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
Open
tyler-griggs
wants to merge
18
commits into
main
Choose a base branch
from
tyler/tinker-sampling-main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e251093
Implement checkpointing for Tinker SkyRL backend
tyler-griggs 4125427
Format: Consolidate function call arguments to single line
tyler-griggs 84feed7
Shorten checkpoint compression comment
tyler-griggs 92bb84f
Security and refactoring improvements for checkpointing
tyler-griggs 6e88b30
Add sampling support for Tinker SkyRL backend
tyler-griggs 0d27131
Use SkyRL default config for inference engines (consistency fix)
tyler-griggs cf90f35
Fix sequential sampling - run all samples in parallel
tyler-griggs b4d26a6
Merge origin/main into tyler/tinker-sampling-main
tyler-griggs 4338348
Fix critical bugs in sampling implementation
tyler-griggs f763f21
Preserve exception messages in sampling error responses
tyler-griggs 707a215
Simplify async handling in engine.py
tyler-griggs 1e0ac27
Clean up engine.py comments and log messages
tyler-griggs e080d59
Simplify sampling implementation
tyler-griggs 26088c4
Remove redundant vLLM comment
tyler-griggs 27942d9
Add persist flag to skip disk save on RL loop hot path
tyler-griggs 2af1854
Delegate inference engine creation to skyrl-train, simplify model check
tyler-griggs 900d317
Address remaining review feedback
tyler-griggs 746680e
Merge origin/main into tyler/tinker-sampling-main
tyler-griggs 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
Some comments aren't visible on the classic Files Changed page.
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
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.
The
samplemethod is vulnerable to resource exhaustion leading to a Denial of Service. It iterates through all prompts inprepared_batch.all_prompts(the size of which is controlled by the user-suppliednum_samplesparameter) and creates a task for each one, then executes all tasks in parallel usingasyncio.gather. There is no upper bound onnum_samplesnor any chunking of the tasks. An attacker can provide an extremely large value fornum_samples, causing the application to consume excessive memory and network resources, potentially leading to an Out-Of-Memory (OOM) crash or system instability.Implement a maximum limit for
num_samplesand process the sampling tasks in smaller, fixed-size batches (e.g., using a semaphore or by chunking the input list).