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
ModelZoo
Mistral-Small_pytorch
Commits
7b025bd5
Commit
7b025bd5
authored
Jun 11, 2025
by
chenych
Browse files
Fix bugs in README.
parent
d784acce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
14 deletions
+5
-14
README.md
README.md
+5
-14
No files found.
README.md
View file @
7b025bd5
...
@@ -19,7 +19,7 @@ Mistral Small 3.1 (25.03) 是一款多用途模型,专为编程、数学推理
...
@@ -19,7 +19,7 @@ Mistral Small 3.1 (25.03) 是一款多用途模型,专为编程、数学推理
## 环境配置
## 环境配置
`-v 路径`
、
`docker_nam
`
e和
`imageID`
根据实际情况修改
`-v 路径`
、
`docker_name
`
和
`imageID`
根据实际情况修改
### Docker(方法一)
### Docker(方法一)
```
bash
```
bash
...
@@ -27,7 +27,6 @@ docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:vllm0.8.5-ubuntu22.04
...
@@ -27,7 +27,6 @@ docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:vllm0.8.5-ubuntu22.04
docker run
-it
--shm-size
200g
--network
=
host
--name
{
docker_name
}
--privileged
--device
=
/dev/kfd
--device
=
/dev/dri
--device
=
/dev/mkfd
--group-add
video
--cap-add
=
SYS_PTRACE
--security-opt
seccomp
=
unconfined
-u
root
-v
/path/your_code_data/:/path/your_code_data/
-v
/opt/hyhal/:/opt/hyhal/:ro
{
imageID
}
bash
docker run
-it
--shm-size
200g
--network
=
host
--name
{
docker_name
}
--privileged
--device
=
/dev/kfd
--device
=
/dev/dri
--device
=
/dev/mkfd
--group-add
video
--cap-add
=
SYS_PTRACE
--security-opt
seccomp
=
unconfined
-u
root
-v
/path/your_code_data/:/path/your_code_data/
-v
/opt/hyhal/:/opt/hyhal/:ro
{
imageID
}
bash
cd
/your_code_path/mistral-small_pytorch
cd
/your_code_path/mistral-small_pytorch
pip
install
mistral_common>
=
1.5.4
```
```
### Dockerfile(方法二)
### Dockerfile(方法二)
...
@@ -37,11 +36,10 @@ docker build --no-cache -t mistral-small:latest .
...
@@ -37,11 +36,10 @@ docker build --no-cache -t mistral-small:latest .
docker run
-it
--shm-size
200g
--network
=
host
--name
{
docker_name
}
--privileged
--device
=
/dev/kfd
--device
=
/dev/dri
--device
=
/dev/mkfd
--group-add
video
--cap-add
=
SYS_PTRACE
--security-opt
seccomp
=
unconfined
-u
root
-v
/path/your_code_data/:/path/your_code_data/
-v
/opt/hyhal/:/opt/hyhal/:ro
{
imageID
}
bash
docker run
-it
--shm-size
200g
--network
=
host
--name
{
docker_name
}
--privileged
--device
=
/dev/kfd
--device
=
/dev/dri
--device
=
/dev/mkfd
--group-add
video
--cap-add
=
SYS_PTRACE
--security-opt
seccomp
=
unconfined
-u
root
-v
/path/your_code_data/:/path/your_code_data/
-v
/opt/hyhal/:/opt/hyhal/:ro
{
imageID
}
bash
cd
/your_code_path/mistral-small_pytorch
cd
/your_code_path/mistral-small_pytorch
pip
install
mistral_common>
=
1.5.4
```
```
### Anaconda(方法三)
### Anaconda(方法三)
关于本项目DCU显卡所需的特殊深度学习库可从
[
光合
](
https://developer.
hpccube.com
/tool/
)
开发者社区下载安装。
关于本项目DCU显卡所需的特殊深度学习库可从
[
光合
](
https://developer.
sourcefind.cn
/tool/
)
开发者社区下载安装。
```
bash
```
bash
DTK: 25.04
DTK: 25.04
python: 3.10
python: 3.10
...
@@ -51,11 +49,6 @@ deepspeed: 0.14.2+das.opt2.dtk2504
...
@@ -51,11 +49,6 @@ deepspeed: 0.14.2+das.opt2.dtk2504
```
```
`Tips:以上dtk驱动、python、torch等DCU相关工具版本需要严格一一对应`
`Tips:以上dtk驱动、python、torch等DCU相关工具版本需要严格一一对应`
其它非深度学习库安装方式如下:
```
bash
pip
install
mistral_common>
=
1.5.4
```
## 数据集
## 数据集
无
无
...
@@ -69,7 +62,6 @@ git clone https://developer.sourcefind.cn/codes/OpenDAS/llama-factory
...
@@ -69,7 +62,6 @@ git clone https://developer.sourcefind.cn/codes/OpenDAS/llama-factory
2.
通过
[
预训练权重
](
#预训练权重
)
下载预训练模型,当前用例使用
[
Mistral-Small-3.1-24B-Instruct-2503
](
https://huggingface.co/mistralai/Mistral-Small-3.1-24B-Instruct-2503
)
模型。
2.
通过
[
预训练权重
](
#预训练权重
)
下载预训练模型,当前用例使用
[
Mistral-Small-3.1-24B-Instruct-2503
](
https://huggingface.co/mistralai/Mistral-Small-3.1-24B-Instruct-2503
)
模型。
#### 全参微调
#### 全参微调
SFT训练脚本示例,参考
`llama-factory/train_full`
下对应yaml文件。
SFT训练脚本示例,参考
`llama-factory/train_full`
下对应yaml文件。
**参数修改**
:
**参数修改**
:
...
@@ -81,23 +73,22 @@ SFT训练脚本示例,参考`llama-factory/train_full`下对应yaml文件。
...
@@ -81,23 +73,22 @@ SFT训练脚本示例,参考`llama-factory/train_full`下对应yaml文件。
其他参数如:
`--learning_rate`
、
`--save_steps`
可根据自身硬件及需求进行修改。
其他参数如:
`--learning_rate`
、
`--save_steps`
可根据自身硬件及需求进行修改。
#### lora微调
#### lora微调
SFT训练脚本示例,参考
`llama-factory/train_lora`
下对应yaml文件。
SFT训练脚本示例,参考
`llama-factory/train_lora`
下对应yaml文件。
参数解释同
[
#全参微调
](
#全参微调
)
参数解释同
[
#全参微调
](
#全参微调
)
## 推理
## 推理
### vllm推理方法
### vllm推理方法
#### offline
#### offline
```
bash
```
bash
python infer_vllm.py
--model_name_or_path
/path_of/model
python infer_vllm.py
--model_name_or_path
/path_of/model
```
```
#### server
#### server
1.
启动服务
```
bash
```
bash
vllm serve mistralai/Mistral-Small-3.1-24B-Instruct-2503
--tokenizer_mode
mistral
--config_format
mistral
--load_format
mistral
--tool-call-parser
mistral
--enable-auto-tool-choice
--limit_mm_per_prompt
'image=10'
-tp
2
--port
8001
--trust-remote-code
--enforce-eager
--served-model-name
Mistral-Small
vllm serve mistralai/Mistral-Small-3.1-24B-Instruct-2503
--tokenizer_mode
mistral
--config_format
mistral
--load_format
mistral
--tool-call-parser
mistral
--enable-auto-tool-choice
--limit_mm_per_prompt
'image=10'
-tp
2
--port
8001
--trust-remote-code
--enforce-eager
--served-model-name
Mistral-Small
```
```
2.
测试结果
```
bash
```
bash
## 必须添加HF_ENDPOINT环境变量
## 必须添加HF_ENDPOINT环境变量
export
HF_ENDPOINT
=
https://hf-mirror.com
export
HF_ENDPOINT
=
https://hf-mirror.com
...
@@ -110,7 +101,7 @@ python infer_client.py
...
@@ -110,7 +101,7 @@ python infer_client.py
</div>
</div>
### 精度
### 精度
暂无
DCU与GPU精度一致,推理框架:pytorch。
## 应用场景
## 应用场景
### 算法类别
### 算法类别
...
...
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