[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

@@ -64,6 +64,9 @@ class NPUWorker(LocalOrDistributedWorkerBase):
distributed_init_method: str,
is_driver_worker: bool = False,
model_runner_cls: Optional[Type[ModelRunnerBase]] = None):
# register patch for vllm
from vllm_ascend.utils import adapt_patch
adapt_patch()
# Register ops when worker init.
from vllm_ascend import ops # noqa: F401