Repository navigation
Commit 37fa4c0
committed
refactor: drop worker passthroughs that duplicate upstream
NPUWorker overrides several worker RPC methods whose implementation is
already identical in upstream vllm/v1/worker/gpu_worker.py::Worker. I
audited every method on the class against the effective upstream
implementation (gpu_worker.Worker, falling back to WorkerBase) on both
supported vLLM lanes - v0.33.0 and the pinned main commit c410543d - with
an AST comparison, and deleted the ones that only restate the upstream
delegation to self.model_runner:
- add_lora / remove_lora / list_loras / pin_lora: byte-identical bodies
- get_model / reset_encoder_cache / take_draft_token_ids: byte-identical
- get_supported_tasks: body and decorators identical, the only difference
was a redundant quoted return annotation
The LoRA feature itself, the punica wrapper, the model-runner
implementation and every Ascend-specific override stay untouched; the
deleted methods keep resolving to the same code through inheritance. The
imports that only those methods used (LoRARequest, SupportedTask,
DraftTokenIds) go away with them.
Methods that look like pass-throughs but differ from upstream on at least
one lane were deliberately kept, e.g. reset_mm_cache (tolerates runners
without the method), synchronize_device (torch.npu.synchronize),
sample_tokens (no with_gpu_sync_check) and reload_weights.
Static checks only: ruff check, ruff format --check and py_compile pass on
vllm_ascend/worker/worker.py.
Signed-off-by: Ronald1995 <ronaldautomobile@163.com>1 parent 7fcd509 commit 37fa4c0
1 file changed
Lines changed: 1 addition & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
58 | | - | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
| |||
71 | 69 | | |
72 | 70 | | |
73 | 71 | | |
74 | | - | |
| 72 | + | |
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
| |||
1169 | 1167 | | |
1170 | 1168 | | |
1171 | 1169 | | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | 1170 | | |
1176 | 1171 | | |
1177 | 1172 | | |
| |||
1360 | 1355 | | |
1361 | 1356 | | |
1362 | 1357 | | |
1363 | | - | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
1378 | 1358 | | |
1379 | 1359 | | |
1380 | 1360 | | |
| |||
1439 | 1419 | | |
1440 | 1420 | | |
1441 | 1421 | | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | 1422 | | |
1449 | 1423 | | |
1450 | 1424 | | |
| |||
0 commit comments