Commit 2a51ff9e authored by zhuyue's avatar zhuyue
Browse files

Compatible with Hygon DCU.

parent d39a5e4d
......@@ -15,13 +15,13 @@ xmake && xmake install
- 运行模型推理测试
```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
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:
def test():
if len(sys.argv) < 3:
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)
model_path = sys.argv[2]
......@@ -677,9 +677,11 @@ def test():
device_type = DeviceType.DEVICE_TYPE_ILUVATAR
elif sys.argv[1] == "--kunlun":
device_type = DeviceType.DEVICE_TYPE_KUNLUN
elif sys.argv[1] == "--hygon":
device_type = DeviceType.DEVICE_TYPE_HYGON
else:
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)
......
......@@ -11,6 +11,9 @@ DEVICE_TYPE_MAP = {
"ascend": DeviceType.DEVICE_TYPE_ASCEND,
"metax": DeviceType.DEVICE_TYPE_METAX,
"moore": DeviceType.DEVICE_TYPE_MOORE,
"iluvatar": DeviceType.DEVICE_TYPE_ILUVATAR,
"kunlun": DeviceType.DEVICE_TYPE_KUNLUN,
"hygon": DeviceType.DEVICE_TYPE_HYGON,
}
TORCH_DEVICE_TYPE_MAP = {
......@@ -20,6 +23,9 @@ TORCH_DEVICE_TYPE_MAP = {
"ascend": "npu",
"metax": "cuda",
"moore": "cuda",
"iluvatar": "cuda",
"kunlun": "cuda",
"hygon": "cuda",
}
......
......@@ -24,6 +24,9 @@ DEVICE_TYPE_MAP = {
"ascend": DeviceType.DEVICE_TYPE_ASCEND,
"metax": DeviceType.DEVICE_TYPE_METAX,
"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):
DEVICE_TYPE_MOORE = 5
DEVICE_TYPE_ILUVATAR = 6
DEVICE_TYPE_KUNLUN = 7
DEVICE_TYPE_HYGON = 8
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