-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor get_punica_wrapper() into platform
Signed-off-by: Shanshan Shen <[email protected]>
- Loading branch information
1 parent
12b41b1
commit 69797a8
Showing
8 changed files
with
43 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,19 +1,7 @@ | ||
from vllm.platforms import current_platform | ||
from vllm.utils import print_info_once | ||
|
||
from .punica_base import PunicaWrapperBase | ||
|
||
|
||
def get_punica_wrapper(*args, **kwargs) -> PunicaWrapperBase: | ||
if current_platform.is_cuda_alike(): | ||
# Lazy import to avoid ImportError | ||
from vllm.lora.punica_wrapper.punica_gpu import PunicaWrapperGPU | ||
print_info_once("Using PunicaWrapperGPU.") | ||
return PunicaWrapperGPU(*args, **kwargs) | ||
elif current_platform.is_hpu(): | ||
# Lazy import to avoid ImportError | ||
from vllm.lora.punica_wrapper.punica_hpu import PunicaWrapperHPU | ||
print_info_once("Using PunicaWrapperHPU.") | ||
return PunicaWrapperHPU(*args, **kwargs) | ||
else: | ||
raise NotImplementedError | ||
return current_platform.get_punica_wrapper(*args, **kwargs) |
This file contains 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 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 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 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 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 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 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