-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
[v1] torchrun compatibility #13642
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
Merged
[v1] torchrun compatibility #13642
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
80f26c1
fix assert
youkaichao 884fd62
use rpc rank
youkaichao dfefe4e
fix output
youkaichao f7bdc6d
add config
youkaichao e52e49e
add determine_available_memory
youkaichao 96f557b
add more tests
youkaichao ebf9a33
fix more compatibility
youkaichao 1b5575b
fix tests
youkaichao 4e2623a
fix tests
youkaichao d3d8230
add tests
youkaichao 2d862c8
comment
youkaichao fbf8b3b
fix tpu worker
youkaichao 9114d8d
Merge branch 'main' into v1_torchrun
youkaichao 1eaf5c7
auto set env var
youkaichao 5ea12fd
update tests
youkaichao e1bee76
lazily read env var
youkaichao 1588ed0
add comments
youkaichao 2f4c005
move the test to v1
youkaichao 1983cd4
use wrapper
youkaichao b10ad89
fix
youkaichao 75028b0
Merge branch 'main' into v1_torchrun
youkaichao cce7f49
add comments
youkaichao 9f4888b
fix method resolution order
youkaichao 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
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
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 |
|---|---|---|
|
|
@@ -567,6 +567,10 @@ def init_worker(self, all_kwargs: List[Dict[str, Any]]) -> None: | |
| self.worker = worker_class(**kwargs) | ||
| assert self.worker is not None | ||
|
|
||
| def initialize_from_config(self, kv_cache_configs: List[Any]) -> None: | ||
| kv_cache_config = kv_cache_configs[self.rpc_rank] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ruisearch42 @comaniac FYI, if a method needs to send different argument to different ranks, the indexing should use |
||
| self.worker.initialize_from_config(kv_cache_config) # type: ignore | ||
|
|
||
| def execute_method(self, method: Union[str, bytes], *args, **kwargs): | ||
| try: | ||
| target = self if self.worker is None else self.worker | ||
|
|
||
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.
this is to test if we can directly access the model wih
llm.llm_engine.model_executor.driver_worker.worker.model_runner.model. it is used in https://github.com/volcengine/verl/blob/0a1b16f800c25ac80504038fd8b8be4282d6c606/verl/workers/sharding_manager/fsdp_vllm.py#L84There 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.
Maybe worth a comment?