-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
[Hardware][CPU] Multi-LoRA implementation for the CPU backend #11100
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
Changes from 28 commits
c8a8c5b
3545ac1
2b3c650
cc0bd6c
dc9091a
410b746
8eab6a6
5dfcf62
651dc04
d1026bb
2840445
41c518f
abb03e5
d212fc9
dcb1794
3a684b8
c9b9f63
acdb4e3
cfa082f
8eaf7ec
bd54243
21c3799
aeaf078
61c42cf
0d19f03
5af9cbb
202aca3
76444f4
64c700f
06399bc
69eb3dc
e208468
d8cb9af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| from vllm.model_executor.layers.sampler import Sampler | ||
| from vllm.model_executor.layers.vocab_parallel_embedding import ParallelLMHead | ||
| from vllm.model_executor.model_loader import get_model | ||
| from vllm.platforms import current_platform | ||
|
|
||
|
|
||
| class ContextIDInfo(TypedDict): | ||
|
|
@@ -65,13 +66,16 @@ def cleanup_fixture(should_do_global_cleanup_after_test: bool): | |
| @pytest.fixture | ||
| def dist_init(): | ||
| temp_file = tempfile.mkstemp()[1] | ||
| init_distributed_environment( | ||
| world_size=1, | ||
| rank=0, | ||
| distributed_init_method=f"file://{temp_file}", | ||
| local_rank=0, | ||
| backend="nccl", | ||
| ) | ||
|
|
||
| backend = "nccl" | ||
| if current_platform.is_cpu(): | ||
| backend = "gloo" | ||
|
|
||
| init_distributed_environment(world_size=1, | ||
| rank=0, | ||
| distributed_init_method=f"file://{temp_file}", | ||
| local_rank=0, | ||
| backend=backend) | ||
| initialize_model_parallel(1, 1) | ||
| yield | ||
| cleanup_dist_env_and_memory(shutdown_ray=True) | ||
|
|
@@ -81,13 +85,15 @@ def dist_init(): | |
| def dist_init_torch_only(): | ||
| if torch.distributed.is_initialized(): | ||
| return | ||
| backend = "nccl" | ||
| if current_platform.is_cpu(): | ||
| backend = "gloo" | ||
|
|
||
| temp_file = tempfile.mkstemp()[1] | ||
| torch.distributed.init_process_group( | ||
| backend="nccl", | ||
| world_size=1, | ||
| rank=0, | ||
| init_method=f"file://{temp_file}", | ||
| ) | ||
| torch.distributed.init_process_group(world_size=1, | ||
| rank=0, | ||
| init_method=f"file://{temp_file}", | ||
| backend=backend) | ||
|
Collaborator
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. @DarkLight1337 Are our CPU vendor willing to provide hardware testing for these? Who should we contact?
Member
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. I remember there is no numa node restriction for CPU TP, so I think we can just change
Collaborator
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. My bad, I meant to ask if the CPU LoRA testing should be placed here. If so, we might need to contact the CPU vendor?
Contributor
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. @jeejeelee Hi, I think it may be easier to run the offline lora case? Thus we don't need to download the weights file CC @bigPYJ1151
Collaborator
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. @zhouyuan Do you mean adding
Contributor
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. Yes, the target is to enable a test to verify the lora code path on CPU backend |
||
|
|
||
|
|
||
| @pytest.fixture | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.