Commit 3a426695 authored by xgqdut2016's avatar xgqdut2016
Browse files

issue/147: 增加QY device

parent 4fd9d490
...@@ -15,13 +15,13 @@ xmake && xmake install ...@@ -15,13 +15,13 @@ xmake && xmake install
- 运行模型推理测试 - 运行模型推理测试
```bash ```bash
python scripts/jiuge.py [--cpu | --nvidia | --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] path/to/model_dir [n_device] python scripts/jiuge.py [--cpu | --nvidia | --qy | --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] path/to/model_dir [n_device]
``` ```
- 部署模型推理服务 - 部署模型推理服务
```bash ```bash
python scripts/launch_server.py --model-path MODEL_PATH [-h] [--dev {cpu,nvidia,cambricon,ascend,metax,moore,iluvatar,kunlun,hygon}] [--ndev NDEV] [--max-batch MAX_BATCH] [--max-tokens MAX_TOKENS] python scripts/launch_server.py --model-path MODEL_PATH [-h] [--dev {cpu,nvidia,qy, cambricon,ascend,metax,moore,iluvatar,kunlun,hygon}] [--ndev NDEV] [--max-batch MAX_BATCH] [--max-tokens MAX_TOKENS]
``` ```
- 测试模型推理服务性能 - 测试模型推理服务性能
......
...@@ -825,7 +825,7 @@ class JiugeForCauslLM: ...@@ -825,7 +825,7 @@ class JiugeForCauslLM:
def test(): def test():
if len(sys.argv) < 3: if len(sys.argv) < 3:
print( print(
"Usage: python jiuge.py [--cpu | --nvidia| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device] [--verbose]" "Usage: python jiuge.py [--cpu | --nvidia| --qy| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device] [--verbose]"
) )
sys.exit(1) sys.exit(1)
...@@ -844,6 +844,8 @@ def test(): ...@@ -844,6 +844,8 @@ def test():
device_type = DeviceType.DEVICE_TYPE_CPU device_type = DeviceType.DEVICE_TYPE_CPU
elif sys.argv[1] == "--nvidia": elif sys.argv[1] == "--nvidia":
device_type = DeviceType.DEVICE_TYPE_NVIDIA device_type = DeviceType.DEVICE_TYPE_NVIDIA
elif sys.argv[1] == "--qy":
device_type = DeviceType.DEVICE_TYPE_QY
elif sys.argv[1] == "--cambricon": elif sys.argv[1] == "--cambricon":
device_type = DeviceType.DEVICE_TYPE_CAMBRICON device_type = DeviceType.DEVICE_TYPE_CAMBRICON
elif sys.argv[1] == "--ascend": elif sys.argv[1] == "--ascend":
...@@ -860,7 +862,7 @@ def test(): ...@@ -860,7 +862,7 @@ def test():
device_type = DeviceType.DEVICE_TYPE_HYGON device_type = DeviceType.DEVICE_TYPE_HYGON
else: else:
print( print(
"Usage: python jiuge.py [--cpu | --nvidia| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device] [--verbose]" "Usage: python jiuge.py [--cpu | --nvidia| --qy| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device] [--verbose]"
) )
sys.exit(1) sys.exit(1)
......
...@@ -7,6 +7,7 @@ from libinfinicore_infer import DeviceType ...@@ -7,6 +7,7 @@ from libinfinicore_infer import DeviceType
DEVICE_TYPE_MAP = { DEVICE_TYPE_MAP = {
"cpu": DeviceType.DEVICE_TYPE_CPU, "cpu": DeviceType.DEVICE_TYPE_CPU,
"nvidia": DeviceType.DEVICE_TYPE_NVIDIA, "nvidia": DeviceType.DEVICE_TYPE_NVIDIA,
"qy": DeviceType.DEVICE_TYPE_QY,
"cambricon": DeviceType.DEVICE_TYPE_CAMBRICON, "cambricon": DeviceType.DEVICE_TYPE_CAMBRICON,
"ascend": DeviceType.DEVICE_TYPE_ASCEND, "ascend": DeviceType.DEVICE_TYPE_ASCEND,
"metax": DeviceType.DEVICE_TYPE_METAX, "metax": DeviceType.DEVICE_TYPE_METAX,
...@@ -19,6 +20,7 @@ DEVICE_TYPE_MAP = { ...@@ -19,6 +20,7 @@ DEVICE_TYPE_MAP = {
TORCH_DEVICE_TYPE_MAP = { TORCH_DEVICE_TYPE_MAP = {
"cpu": "cpu", "cpu": "cpu",
"nvidia": "cuda", "nvidia": "cuda",
"qy": "cuda",
"cambricon": "mlu", "cambricon": "mlu",
"ascend": "npu", "ascend": "npu",
"metax": "cuda", "metax": "cuda",
......
...@@ -20,6 +20,7 @@ import janus ...@@ -20,6 +20,7 @@ import janus
DEVICE_TYPE_MAP = { DEVICE_TYPE_MAP = {
"cpu": DeviceType.DEVICE_TYPE_CPU, "cpu": DeviceType.DEVICE_TYPE_CPU,
"nvidia": DeviceType.DEVICE_TYPE_NVIDIA, "nvidia": DeviceType.DEVICE_TYPE_NVIDIA,
"qy": DeviceType.DEVICE_TYPE_QY,
"cambricon": DeviceType.DEVICE_TYPE_CAMBRICON, "cambricon": DeviceType.DEVICE_TYPE_CAMBRICON,
"ascend": DeviceType.DEVICE_TYPE_ASCEND, "ascend": DeviceType.DEVICE_TYPE_ASCEND,
"metax": DeviceType.DEVICE_TYPE_METAX, "metax": DeviceType.DEVICE_TYPE_METAX,
......
...@@ -36,6 +36,7 @@ class DeviceType(ctypes.c_int): ...@@ -36,6 +36,7 @@ class DeviceType(ctypes.c_int):
DEVICE_TYPE_ILUVATAR = 6 DEVICE_TYPE_ILUVATAR = 6
DEVICE_TYPE_KUNLUN = 7 DEVICE_TYPE_KUNLUN = 7
DEVICE_TYPE_HYGON = 8 DEVICE_TYPE_HYGON = 8
DEVICE_TYPE_QY = 9
class KVCacheCStruct(ctypes.Structure): class KVCacheCStruct(ctypes.Structure):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment