diff --git a/README.md b/README.md index 7c14a058..e9f0602d 100644 --- a/README.md +++ b/README.md @@ -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] ``` - 测试模型推理服务性能 diff --git a/python/example.py b/python/example.py index 4f45b0dd..64c02272 100644 --- a/python/example.py +++ b/python/example.py @@ -37,6 +37,8 @@ def main(): device_type = DeviceType.DEVICE_TYPE_MOORE elif args.device_type == "iluvatar": device_type = DeviceType.DEVICE_TYPE_ILUVATAR + elif args.device_type == "qy": + device_type = DeviceType.DEVICE_TYPE_QY else: raise ValueError("Error: --device_type is required.") diff --git a/python/icinfer/engine/libinfinicore_infer.py b/python/icinfer/engine/libinfinicore_infer.py index 75f6e025..c74a21b3 100644 --- a/python/icinfer/engine/libinfinicore_infer.py +++ b/python/icinfer/engine/libinfinicore_infer.py @@ -34,6 +34,9 @@ class DeviceType(ctypes.c_int): DEVICE_TYPE_METAX = 4 DEVICE_TYPE_MOORE = 5 DEVICE_TYPE_ILUVATAR = 6 + DEVICE_TYPE_KUNLUN = 7 + DEVICE_TYPE_HYGON = 8 + DEVICE_TYPE_QY = 9 class JiugeMetaCStruct(ctypes.Structure): diff --git a/scripts/jiuge.py b/scripts/jiuge.py index 676d7de7..2fd201c2 100644 --- a/scripts/jiuge.py +++ b/scripts/jiuge.py @@ -707,7 +707,7 @@ def destroy_model_instance(self): def test(): if len(sys.argv) < 3: print( - "Usage: python jiuge.py [--cpu | --nvidia| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] [n_device]" + "Usage: python jiuge.py [--cpu | --nvidia| --qy| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] [n_device]" ) sys.exit(1) model_path = sys.argv[2] @@ -730,9 +730,11 @@ def test(): device_type = DeviceType.DEVICE_TYPE_KUNLUN elif sys.argv[1] == "--hygon": device_type = DeviceType.DEVICE_TYPE_HYGON + elif sys.argv[1] == "--qy": + device_type = DeviceType.DEVICE_TYPE_QY else: print( - "Usage: python jiuge.py [--cpu | --nvidia| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] [n_device]" + "Usage: python jiuge.py [--cpu | --nvidia| --qy| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] [n_device]" ) sys.exit(1) diff --git a/scripts/jiuge_ppl.py b/scripts/jiuge_ppl.py index 061ab303..6ce503bd 100644 --- a/scripts/jiuge_ppl.py +++ b/scripts/jiuge_ppl.py @@ -14,6 +14,7 @@ "iluvatar": DeviceType.DEVICE_TYPE_ILUVATAR, "kunlun": DeviceType.DEVICE_TYPE_KUNLUN, "hygon": DeviceType.DEVICE_TYPE_HYGON, + "qy": DeviceType.DEVICE_TYPE_QY, } TORCH_DEVICE_TYPE_MAP = { @@ -26,6 +27,7 @@ "iluvatar": "cuda", "kunlun": "cuda", "hygon": "cuda", + "qy": "cuda", } diff --git a/scripts/launch_server.py b/scripts/launch_server.py index 115fbd0a..67ae7c41 100644 --- a/scripts/launch_server.py +++ b/scripts/launch_server.py @@ -28,6 +28,7 @@ "iluvatar": DeviceType.DEVICE_TYPE_ILUVATAR, "kunlun": DeviceType.DEVICE_TYPE_KUNLUN, "hygon": DeviceType.DEVICE_TYPE_HYGON, + "qy": DeviceType.DEVICE_TYPE_QY, } diff --git a/scripts/libinfinicore_infer/base.py b/scripts/libinfinicore_infer/base.py index bed65b2e..3305cdba 100644 --- a/scripts/libinfinicore_infer/base.py +++ b/scripts/libinfinicore_infer/base.py @@ -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):