"...git@developer.sourcefind.cn:tsoc/superbenchmark.git" did not exist on "c13ed2a297caf31a7444c9dcfc281dfb2618ce74"
Unverified Commit ddea3d19 authored by PanZezhong1725's avatar PanZezhong1725 Committed by GitHub
Browse files

Merge pull request #46 from gongchensu/feature/support_hygon

Compatible with Hygon DCU.
parents d39a5e4d 2a51ff9e
...@@ -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] path/to/model_dir [n_device] python scripts/jiuge.py [--cpu | --nvidia | --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}] [--ndev NDEV] [--max-batch MAX_BATCH] [--max-tokens MAX_TOKENS] 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]
``` ```
- 测试模型推理服务性能 - 测试模型推理服务性能
......
...@@ -656,7 +656,7 @@ class JiugeForCauslLM: ...@@ -656,7 +656,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] <path/to/model_dir> [n_device]" "Usage: python jiuge.py [--cpu | --nvidia| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device]"
) )
sys.exit(1) sys.exit(1)
model_path = sys.argv[2] model_path = sys.argv[2]
...@@ -677,9 +677,11 @@ def test(): ...@@ -677,9 +677,11 @@ def test():
device_type = DeviceType.DEVICE_TYPE_ILUVATAR device_type = DeviceType.DEVICE_TYPE_ILUVATAR
elif sys.argv[1] == "--kunlun": elif sys.argv[1] == "--kunlun":
device_type = DeviceType.DEVICE_TYPE_KUNLUN device_type = DeviceType.DEVICE_TYPE_KUNLUN
elif sys.argv[1] == "--hygon":
device_type = DeviceType.DEVICE_TYPE_HYGON
else: else:
print( print(
"Usage: python jiuge.py [--cpu | --nvidia| --cambricon | --ascend | --metax | --moore] <path/to/model_dir> [n_device]" "Usage: python jiuge.py [--cpu | --nvidia| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device]"
) )
sys.exit(1) sys.exit(1)
......
...@@ -11,6 +11,9 @@ DEVICE_TYPE_MAP = { ...@@ -11,6 +11,9 @@ DEVICE_TYPE_MAP = {
"ascend": DeviceType.DEVICE_TYPE_ASCEND, "ascend": DeviceType.DEVICE_TYPE_ASCEND,
"metax": DeviceType.DEVICE_TYPE_METAX, "metax": DeviceType.DEVICE_TYPE_METAX,
"moore": DeviceType.DEVICE_TYPE_MOORE, "moore": DeviceType.DEVICE_TYPE_MOORE,
"iluvatar": DeviceType.DEVICE_TYPE_ILUVATAR,
"kunlun": DeviceType.DEVICE_TYPE_KUNLUN,
"hygon": DeviceType.DEVICE_TYPE_HYGON,
} }
TORCH_DEVICE_TYPE_MAP = { TORCH_DEVICE_TYPE_MAP = {
...@@ -20,6 +23,9 @@ TORCH_DEVICE_TYPE_MAP = { ...@@ -20,6 +23,9 @@ TORCH_DEVICE_TYPE_MAP = {
"ascend": "npu", "ascend": "npu",
"metax": "cuda", "metax": "cuda",
"moore": "cuda", "moore": "cuda",
"iluvatar": "cuda",
"kunlun": "cuda",
"hygon": "cuda",
} }
......
...@@ -24,6 +24,9 @@ DEVICE_TYPE_MAP = { ...@@ -24,6 +24,9 @@ DEVICE_TYPE_MAP = {
"ascend": DeviceType.DEVICE_TYPE_ASCEND, "ascend": DeviceType.DEVICE_TYPE_ASCEND,
"metax": DeviceType.DEVICE_TYPE_METAX, "metax": DeviceType.DEVICE_TYPE_METAX,
"moore": DeviceType.DEVICE_TYPE_MOORE, "moore": DeviceType.DEVICE_TYPE_MOORE,
"iluvatar": DeviceType.DEVICE_TYPE_ILUVATAR,
"kunlun": DeviceType.DEVICE_TYPE_KUNLUN,
"hygon": DeviceType.DEVICE_TYPE_HYGON,
} }
......
...@@ -35,6 +35,7 @@ class DeviceType(ctypes.c_int): ...@@ -35,6 +35,7 @@ class DeviceType(ctypes.c_int):
DEVICE_TYPE_MOORE = 5 DEVICE_TYPE_MOORE = 5
DEVICE_TYPE_ILUVATAR = 6 DEVICE_TYPE_ILUVATAR = 6
DEVICE_TYPE_KUNLUN = 7 DEVICE_TYPE_KUNLUN = 7
DEVICE_TYPE_HYGON = 8
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