Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jerrrrry
infinilm
Commits
2a51ff9e
Commit
2a51ff9e
authored
Sep 12, 2025
by
zhuyue
Browse files
Compatible with Hygon DCU.
parent
d39a5e4d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
4 deletions
+16
-4
README.md
README.md
+2
-2
scripts/jiuge.py
scripts/jiuge.py
+4
-2
scripts/jiuge_ppl.py
scripts/jiuge_ppl.py
+6
-0
scripts/launch_server.py
scripts/launch_server.py
+3
-0
scripts/libinfinicore_infer/base.py
scripts/libinfinicore_infer/base.py
+1
-0
No files found.
README.md
View file @
2a51ff9e
...
...
@@ -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]
```
-
测试模型推理服务性能
...
...
scripts/jiuge.py
View file @
2a51ff9e
...
...
@@ -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
)
...
...
scripts/jiuge_ppl.py
View file @
2a51ff9e
...
...
@@ -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"
,
}
...
...
scripts/launch_server.py
View file @
2a51ff9e
...
...
@@ -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
,
}
...
...
scripts/libinfinicore_infer/base.py
View file @
2a51ff9e
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment