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-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ Before writing a patch, following the principle above, we should patch the least
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:
53
+
53
54
```python
54
55
import vllm
55
56
@@ -59,8 +60,10 @@ Before writing a patch, following the principle above, we should patch the least
5. Import the patch filein`__init__.py`. In this example, add `import vllm_ascend.patch.platform.patch_common.patch_distributed` into `vllm_ascend/patch/platform/patch_common/__init__.py`.
63
-
6. Add the description of the patch in`vllm_ascend/patch/__init__.py`. The description formatisas follows:
63
+
64
+
6. Import the patch filein`__init__.py`. In this example, add `import vllm_ascend.patch.platform.patch_common.patch_distributed` into `vllm_ascend/patch/platform/patch_common/__init__.py`.
65
+
7. Add the description of the patch in`vllm_ascend/patch/__init__.py`. The description formatisas follows:
66
+
64
67
```
65
68
# ** File: <The patch file name> **
66
69
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -74,8 +77,8 @@ Before writing a patch, following the principle above, we should patch the least
74
77
# Future Plan:
75
78
# <Describe the future plan to remove the patch>
76
79
```
77
-
7. Add the Unit Test andE2E Test. Any newly added code in vLLM Ascend should contain the Unit Test andE2E Test as well. You can find more details in [test guide](../contribution/testing.md)
78
80
81
+
8. Add the Unit Test andE2E Test. Any newly added code in vLLM Ascend should contain the Unit Test andE2E Test as well. You can find more details in [test guide](../contribution/testing.md)
79
82
80
83
## Limitation
81
84
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.
0 commit comments