You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/developer_guide/feature_guide/patch.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,11 @@ In `vllm_ascend/patch`, you can see the code structure as follows:
20
20
vllm_ascend
21
21
├── patch
22
22
│ ├── platform
23
-
│ │ ├── patch_0_9_1
23
+
│ │ ├── patch_0_9_2
24
24
│ │ ├── patch_common
25
25
│ │ ├── patch_main
26
26
│ ├── worker
27
-
│ │ ├── patch_0_9_1
27
+
│ │ ├── patch_0_9_2
28
28
│ │ ├── patch_common
29
29
│ │ ├── patch_main
30
30
└───────────
@@ -38,15 +38,15 @@ vllm_ascend
38
38
39
39
In both **platform** and **worker** folder, there are several patch modules. They are used for patching different version of vLLM.
40
40
41
-
-`patch_0_9_1`: This module is used for patching vLLM 0.9.1. The version is always the nearest version of vLLM. Once vLLM is released, we will drop this patch module and bump to a new version. For example, `patch_0_9_2` is used for patching vLLM 0.9.2.
41
+
-`patch_0_9_2`: This module is used for patching vLLM 0.9.2. The version is always the nearest version of vLLM. Once vLLM is released, we will drop this patch module and bump to a new version. For example, `patch_0_9_2` is used for patching vLLM 0.9.2.
42
42
-`patch_main`: This module is used for patching the code in vLLM main branch.
43
-
-`patch_common`: This module is used for patching both vLLM 0.9.1 and vLLM main branch.
43
+
-`patch_common`: This module is used for patching both vLLM 0.9.2 and vLLM main branch.
44
44
45
45
## How to write a patch
46
46
47
47
Before writing a patch, following the principle above, we should patch the least code. If it's necessary, we can patch the code in either **platform** and **worker** folder. Here is an example to patch `distributed` module in vLLM.
48
48
49
-
1. Decide which version of vLLM we should patch. For example, after analysis, here we want to patch both 0.9.1 and main of vLLM.
49
+
1. Decide which version of vLLM we should patch. For example, after analysis, here we want to patch both 0.9.2 and main of vLLM.
50
50
2. Decide which process we should patch. For example, here `distributed` belongs to the vLLM main process, so we should patch `platform`.
51
51
3. Create the patch file in the right folder. The file should be named as `patch_{module_name}.py`. The example here is `vllm_ascend/patch/platform/patch_common/patch_distributed.py`.
52
52
4. Write your patch code in the new file. Here is an example:
@@ -79,4 +79,4 @@ Before writing a patch, following the principle above, we should patch the least
79
79
80
80
## Limitation
81
81
1. In V1 Engine, vLLM starts three kinds of process: Main process, EngineCore process and Worker process. Now vLLM Ascend only support patch the code in Main process and Worker process by default. If you want to patch the code runs in EngineCore process, you should patch EngineCore process entirely during setup, the entry code is here `vllm.v1.engine.core`. Please override `EngineCoreProc`and`DPEngineCoreProc` entirely.
82
-
2. If you are running an edited vLLM code, the version of the vLLM may be changed automatically. For example, if you runs an edited vLLM based on v0.9.1, the version of vLLM may be change to v0.9.2xxx, in this case, the patch for v0.9.1in vLLM Ascend would not work as expect, because that vLLM Ascend can't distinguish the version of vLLM you're using. In this case, you can set the environment variable `VLLM_VERSION` to specify the version of vLLM you're using, then the patch for v0.9.1 should work.
82
+
2. If you are running an edited vLLM code, the version of the vLLM may be changed automatically. For example, if you runs an edited vLLM based on v0.9.2, the version of vLLM may be change to v0.9.2xxx, in this case, the patch for v0.9.2in vLLM Ascend would not work as expect, because that vLLM Ascend can't distinguish the version of vLLM you're using. In this case, you can set the environment variable `VLLM_VERSION` to specify the version of vLLM you're using, then the patch for v0.9.2 should work.
0 commit comments