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

issue/147: 增加QY device

parent 4fd9d490
......@@ -15,13 +15,13 @@ xmake && xmake install
- 运行模型推理测试
```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
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:
def test():
if len(sys.argv) < 3:
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)
......@@ -844,6 +844,8 @@ def test():
device_type = DeviceType.DEVICE_TYPE_CPU
elif sys.argv[1] == "--nvidia":
device_type = DeviceType.DEVICE_TYPE_NVIDIA
elif sys.argv[1] == "--qy":
device_type = DeviceType.DEVICE_TYPE_QY
elif sys.argv[1] == "--cambricon":
device_type = DeviceType.DEVICE_TYPE_CAMBRICON
elif sys.argv[1] == "--ascend":
......@@ -860,7 +862,7 @@ def test():
device_type = DeviceType.DEVICE_TYPE_HYGON
else:
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)
......
......@@ -7,6 +7,7 @@ from libinfinicore_infer import DeviceType
DEVICE_TYPE_MAP = {
"cpu": DeviceType.DEVICE_TYPE_CPU,
"nvidia": DeviceType.DEVICE_TYPE_NVIDIA,
"qy": DeviceType.DEVICE_TYPE_QY,
"cambricon": DeviceType.DEVICE_TYPE_CAMBRICON,
"ascend": DeviceType.DEVICE_TYPE_ASCEND,
"metax": DeviceType.DEVICE_TYPE_METAX,
......@@ -19,6 +20,7 @@ DEVICE_TYPE_MAP = {
TORCH_DEVICE_TYPE_MAP = {
"cpu": "cpu",
"nvidia": "cuda",
"qy": "cuda",
"cambricon": "mlu",
"ascend": "npu",
"metax": "cuda",
......
......@@ -20,6 +20,7 @@ import janus
DEVICE_TYPE_MAP = {
"cpu": DeviceType.DEVICE_TYPE_CPU,
"nvidia": DeviceType.DEVICE_TYPE_NVIDIA,
"qy": DeviceType.DEVICE_TYPE_QY,
"cambricon": DeviceType.DEVICE_TYPE_CAMBRICON,
"ascend": DeviceType.DEVICE_TYPE_ASCEND,
"metax": DeviceType.DEVICE_TYPE_METAX,
......
......@@ -36,6 +36,7 @@ class DeviceType(ctypes.c_int):
DEVICE_TYPE_ILUVATAR = 6
DEVICE_TYPE_KUNLUN = 7
DEVICE_TYPE_HYGON = 8
DEVICE_TYPE_QY = 9
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