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
3a426695
Commit
3a426695
authored
Nov 19, 2025
by
xgqdut2016
Browse files
issue/147: 增加QY device
parent
4fd9d490
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
4 deletions
+10
-4
README.md
README.md
+2
-2
scripts/jiuge.py
scripts/jiuge.py
+4
-2
scripts/jiuge_ppl.py
scripts/jiuge_ppl.py
+2
-0
scripts/launch_server.py
scripts/launch_server.py
+1
-0
scripts/libinfinicore_infer/base.py
scripts/libinfinicore_infer/base.py
+1
-0
No files found.
README.md
View file @
3a426695
...
@@ -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
|
--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
```
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]
```
```
-
测试模型推理服务性能
-
测试模型推理服务性能
...
...
scripts/jiuge.py
View file @
3a426695
...
@@ -825,7 +825,7 @@ class JiugeForCauslLM:
...
@@ -825,7 +825,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 | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device] [--verbose]"
"Usage: python jiuge.py [--cpu | --nvidia|
--qy|
--cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device] [--verbose]"
)
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
@@ -844,6 +844,8 @@ def test():
...
@@ -844,6 +844,8 @@ def test():
device_type
=
DeviceType
.
DEVICE_TYPE_CPU
device_type
=
DeviceType
.
DEVICE_TYPE_CPU
elif
sys
.
argv
[
1
]
==
"--nvidia"
:
elif
sys
.
argv
[
1
]
==
"--nvidia"
:
device_type
=
DeviceType
.
DEVICE_TYPE_NVIDIA
device_type
=
DeviceType
.
DEVICE_TYPE_NVIDIA
elif
sys
.
argv
[
1
]
==
"--qy"
:
device_type
=
DeviceType
.
DEVICE_TYPE_QY
elif
sys
.
argv
[
1
]
==
"--cambricon"
:
elif
sys
.
argv
[
1
]
==
"--cambricon"
:
device_type
=
DeviceType
.
DEVICE_TYPE_CAMBRICON
device_type
=
DeviceType
.
DEVICE_TYPE_CAMBRICON
elif
sys
.
argv
[
1
]
==
"--ascend"
:
elif
sys
.
argv
[
1
]
==
"--ascend"
:
...
@@ -860,7 +862,7 @@ def test():
...
@@ -860,7 +862,7 @@ def test():
device_type
=
DeviceType
.
DEVICE_TYPE_HYGON
device_type
=
DeviceType
.
DEVICE_TYPE_HYGON
else
:
else
:
print
(
print
(
"Usage: python jiuge.py [--cpu | --nvidia| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device] [--verbose]"
"Usage: python jiuge.py [--cpu | --nvidia|
--qy|
--cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device] [--verbose]"
)
)
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
...
scripts/jiuge_ppl.py
View file @
3a426695
...
@@ -7,6 +7,7 @@ from libinfinicore_infer import DeviceType
...
@@ -7,6 +7,7 @@ from libinfinicore_infer import DeviceType
DEVICE_TYPE_MAP
=
{
DEVICE_TYPE_MAP
=
{
"cpu"
:
DeviceType
.
DEVICE_TYPE_CPU
,
"cpu"
:
DeviceType
.
DEVICE_TYPE_CPU
,
"nvidia"
:
DeviceType
.
DEVICE_TYPE_NVIDIA
,
"nvidia"
:
DeviceType
.
DEVICE_TYPE_NVIDIA
,
"qy"
:
DeviceType
.
DEVICE_TYPE_QY
,
"cambricon"
:
DeviceType
.
DEVICE_TYPE_CAMBRICON
,
"cambricon"
:
DeviceType
.
DEVICE_TYPE_CAMBRICON
,
"ascend"
:
DeviceType
.
DEVICE_TYPE_ASCEND
,
"ascend"
:
DeviceType
.
DEVICE_TYPE_ASCEND
,
"metax"
:
DeviceType
.
DEVICE_TYPE_METAX
,
"metax"
:
DeviceType
.
DEVICE_TYPE_METAX
,
...
@@ -19,6 +20,7 @@ DEVICE_TYPE_MAP = {
...
@@ -19,6 +20,7 @@ DEVICE_TYPE_MAP = {
TORCH_DEVICE_TYPE_MAP
=
{
TORCH_DEVICE_TYPE_MAP
=
{
"cpu"
:
"cpu"
,
"cpu"
:
"cpu"
,
"nvidia"
:
"cuda"
,
"nvidia"
:
"cuda"
,
"qy"
:
"cuda"
,
"cambricon"
:
"mlu"
,
"cambricon"
:
"mlu"
,
"ascend"
:
"npu"
,
"ascend"
:
"npu"
,
"metax"
:
"cuda"
,
"metax"
:
"cuda"
,
...
...
scripts/launch_server.py
View file @
3a426695
...
@@ -20,6 +20,7 @@ import janus
...
@@ -20,6 +20,7 @@ import janus
DEVICE_TYPE_MAP
=
{
DEVICE_TYPE_MAP
=
{
"cpu"
:
DeviceType
.
DEVICE_TYPE_CPU
,
"cpu"
:
DeviceType
.
DEVICE_TYPE_CPU
,
"nvidia"
:
DeviceType
.
DEVICE_TYPE_NVIDIA
,
"nvidia"
:
DeviceType
.
DEVICE_TYPE_NVIDIA
,
"qy"
:
DeviceType
.
DEVICE_TYPE_QY
,
"cambricon"
:
DeviceType
.
DEVICE_TYPE_CAMBRICON
,
"cambricon"
:
DeviceType
.
DEVICE_TYPE_CAMBRICON
,
"ascend"
:
DeviceType
.
DEVICE_TYPE_ASCEND
,
"ascend"
:
DeviceType
.
DEVICE_TYPE_ASCEND
,
"metax"
:
DeviceType
.
DEVICE_TYPE_METAX
,
"metax"
:
DeviceType
.
DEVICE_TYPE_METAX
,
...
...
scripts/libinfinicore_infer/base.py
View file @
3a426695
...
@@ -36,6 +36,7 @@ class DeviceType(ctypes.c_int):
...
@@ -36,6 +36,7 @@ class DeviceType(ctypes.c_int):
DEVICE_TYPE_ILUVATAR
=
6
DEVICE_TYPE_ILUVATAR
=
6
DEVICE_TYPE_KUNLUN
=
7
DEVICE_TYPE_KUNLUN
=
7
DEVICE_TYPE_HYGON
=
8
DEVICE_TYPE_HYGON
=
8
DEVICE_TYPE_QY
=
9
class
KVCacheCStruct
(
ctypes
.
Structure
):
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