Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
```

- 测试模型推理服务性能
Expand Down
2 changes: 2 additions & 0 deletions python/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down
3 changes: 3 additions & 0 deletions python/icinfer/engine/libinfinicore_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 4 additions & 2 deletions scripts/jiuge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] <path/to/model_dir> [n_device]"
"Usage: python jiuge.py [--cpu | --nvidia| --qy| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device]"
)
sys.exit(1)
model_path = sys.argv[2]
Expand All @@ -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] <path/to/model_dir> [n_device]"
"Usage: python jiuge.py [--cpu | --nvidia| --qy| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device]"
)
sys.exit(1)

Expand Down
2 changes: 2 additions & 0 deletions scripts/jiuge_ppl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -26,6 +27,7 @@
"iluvatar": "cuda",
"kunlun": "cuda",
"hygon": "cuda",
"qy": "cuda",
}


Expand Down
1 change: 1 addition & 0 deletions scripts/launch_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"iluvatar": DeviceType.DEVICE_TYPE_ILUVATAR,
"kunlun": DeviceType.DEVICE_TYPE_KUNLUN,
"hygon": DeviceType.DEVICE_TYPE_HYGON,
"qy": DeviceType.DEVICE_TYPE_QY,
}


Expand Down
1 change: 1 addition & 0 deletions scripts/libinfinicore_infer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down