-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
156 additions
and
11 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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from vllm.logger import init_logger | ||
from vllm.v1.executor.ray_utils import RayWorkerWrapper | ||
|
||
|
||
logger = init_logger(__name__) | ||
|
||
|
||
class IPEXLLMV1Wrapper(RayWorkerWrapper): | ||
def __init__(self, load_in_low_bit="sym_int4", *args, **kwargs) -> None: | ||
super().__init__(*args, **kwargs) | ||
from ipex_llm.vllm.xpu.model_convert import _ipex_llm_convert | ||
_ipex_llm_convert(load_in_low_bit=load_in_low_bit) | ||
self.compiled_dag_cuda_device_set = False | ||
|
||
|
||
def get_ipex_llm_v1_wrapper(load_in_low_bit): | ||
# The reason why we not using functools.partial is that | ||
# ray seems not work well with it. | ||
class WrapperWithLoadBit(IPEXLLMV1Wrapper): | ||
def __init__(self, *args, **kwargs) -> None: | ||
super().__init__(load_in_low_bit=load_in_low_bit, *args, **kwargs) | ||
|
||
# a = functools.partial(IPEXLLMWrapper, load_in_low_bit=load_in_low_bit) | ||
return WrapperWithLoadBit |
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