[MISC] Add patch module (#526)

This PR added patch module for vllm
1. platform patch: the patch will be registered when load the platform
2. worker patch: the patch will be registered when worker is started.

The detail is:
1. patch_common: patch for main and 0.8.4 version
4. patch_main: patch for main verison
5. patch_0_8_4: patch for 0.8.4 version
This commit is contained in:
wangxiyuan
2025-04-16 09:28:58 +08:00
committed by GitHub
parent 434749d299
commit bbe7ccd366
16 changed files with 185 additions and 3 deletions

View File

@@ -51,3 +51,10 @@ def current_stream() -> torch.npu.Stream:
# we return the default stream.
_current_stream = torch.npu.current_stream()
return _current_stream
def adapt_patch(is_global_patch: bool = False):
if is_global_patch:
from vllm_ascend.patch import platform # noqa: F401
else:
from vllm_ascend.patch import worker # noqa: F401