Skip to content

Commit fae8a98

Browse files
authored
remove ppu backend (#3904)
1 parent 5c2c8df commit fae8a98

File tree

10 files changed

+5
-137
lines changed

10 files changed

+5
-137
lines changed

lmdeploy/cli/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def calib_search_scale(parser):
388388
)
389389

390390
@staticmethod
391-
def device(parser, default: str = 'cuda', choices: List[str] = ['cuda', 'ascend', 'maca', 'camb', 'ppu']):
391+
def device(parser, default: str = 'cuda', choices: List[str] = ['cuda', 'ascend', 'maca', 'camb']):
392392
"""Add argument device to parser."""
393393

394394
return parser.add_argument('--device',

lmdeploy/messages.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,7 @@ def __post_init__(self):
385385
'invalid max_prefill_token_num'
386386
assert self.num_gpu_blocks >= 0, 'invalid num_gpu_blocks'
387387
assert self.quant_policy in (0, 4, 8), 'invalid quant_policy'
388-
assert self.device_type in ['cuda', 'ascend', 'maca', 'camb',
389-
'ppu'], (f'invalid device_type: {self.device_type}')
388+
assert self.device_type in ['cuda', 'ascend', 'maca', 'camb'], (f'invalid device_type: {self.device_type}')
390389
assert self.block_size >= 16 and (self.block_size & (self.block_size - 1)) == 0, \
391390
f'block_size must be >= 16 and a power of 2, but got {self.block_size}'
392391
if self.quant_policy > 0 and self.device_type not in ['cuda', 'ascend']:

lmdeploy/pytorch/backends/dlinfer/ppu/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

lmdeploy/pytorch/backends/dlinfer/ppu/op_backend.py

Lines changed: 0 additions & 87 deletions
This file was deleted.

lmdeploy/pytorch/backends/selector.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ def _get_backend():
2121
if device_type == 'camb':
2222
from .dlinfer.camb import CambOpsBackend
2323
return CambOpsBackend
24-
if device_type == 'ppu':
25-
from .dlinfer.ppu import PpuOpsBackend
26-
return PpuOpsBackend
2724
else:
2825
raise RuntimeError(f'Unsupported device type: {device_type}')
2926

lmdeploy/pytorch/kernels/dispatcher.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,7 @@ def __init__(self, func_name: str):
6464
self.func_name = func_name
6565
self.dispatched_func = self.load_and_call
6666
self.device_manager.register_context_callback(self.device_callback)
67-
self.device_map = {
68-
'cuda': 'cuda',
69-
'ascend': 'dlinfer',
70-
'npu': 'dlinfer',
71-
'maca': 'dlinfer',
72-
'camb': 'dlinfer',
73-
'ppu': 'dlinfer'
74-
}
67+
self.device_map = {'cuda': 'cuda', 'ascend': 'dlinfer', 'npu': 'dlinfer', 'maca': 'dlinfer', 'camb': 'dlinfer'}
7568

7669
def device_callback(self, context: DeviceContext):
7770
"""Device context callback."""

lmdeploy/pytorch/models/module_map.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@
77
ASCEND_MODULE_MAP = dict()
88
MACA_MODULE_MAP = dict()
99
CAMB_MODULE_MAP = dict()
10-
PPU_MODULE_MAP = dict()
1110

12-
DEVICE_SPECIAL_MODULE_MAP = dict(ascend=ASCEND_MODULE_MAP,
13-
maca=MACA_MODULE_MAP,
14-
camb=CAMB_MODULE_MAP,
15-
ppu=PPU_MODULE_MAP)
11+
DEVICE_SPECIAL_MODULE_MAP = dict(ascend=ASCEND_MODULE_MAP, maca=MACA_MODULE_MAP, camb=CAMB_MODULE_MAP)
1612

1713
# llama
1814
MODULE_MAP.update({

lmdeploy/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def get_max_batch_size(device_type: str):
335335
Args:
336336
device_type (str): the type of device
337337
"""
338-
assert device_type in ['cuda', 'ascend', 'maca', 'camb', 'ppu']
338+
assert device_type in ['cuda', 'ascend', 'maca', 'camb']
339339
if device_type == 'cuda':
340340
max_batch_size_map = {'a100': 256, 'a800': 256, 'h100': 512, 'h800': 512}
341341
import torch
@@ -352,8 +352,6 @@ def get_max_batch_size(device_type: str):
352352
return 256
353353
elif device_type == 'camb':
354354
return 256
355-
elif device_type == 'ppu':
356-
return 256
357355

358356

359357
def is_bf16_supported(device_type: str = 'cuda'):
@@ -401,7 +399,6 @@ def try_import_deeplink(device_type: str):
401399
'npu',
402400
'maca',
403401
'camb',
404-
'ppu',
405402
]
406403
if device_type in deeplink_device_type_list:
407404
try:

requirements/runtime_ppu.txt

Lines changed: 0 additions & 21 deletions
This file was deleted.

requirements_ppu.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)