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
InternLM_lmdeploy
Commits
07438a8b
Commit
07438a8b
authored
Aug 23, 2024
by
xuxzh1
🎱
Browse files
update readme
parent
31f4f2f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
19 deletions
+34
-19
README.md
README.md
+34
-19
No files found.
README.md
View file @
07438a8b
...
@@ -14,18 +14,33 @@ InterLM是一个基础语言模型的集合,参数范围从7B到20B。在数万
...
@@ -14,18 +14,33 @@ InterLM是一个基础语言模型的集合,参数范围从7B到20B。在数万
## 环境配置
## 环境配置
提供光源拉取推理的docker镜像:
*
提供光源拉取推理的docker镜像:
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:lmdeploy0.0.13_dtk23.04_torch1.13_py38
```
bash
# <Image ID>用上面拉取docker镜像的ID替换
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.1.0-ubuntu20.04-dtk24.04.1-py3.10
(
推荐
)
# <Host Path>主机端路径
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:lmdeploy0.0.13_dtk23.04_torch1.13_py38
# <Container Path>容器映射路径
# <Image ID>用上面拉取docker镜像的ID替换
docker run -it --name interlm --shm-size=1024G --device=/dev/kfd --device=/dev/dri/ --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --ulimit memlock=-1:-1 --ipc=host --network host --group-add video -v <Host Path>:<Container Path> <Image ID> /bin/bash
# <Host Path>主机端路径
```
# <Container Path>容器映射路径
镜像版本依赖:
docker run
-it
--name
baichuan
--shm-size
=
1024G
--device
=
/dev/kfd
--device
=
/dev/dri/
--cap-add
=
SYS_PTRACE
--security-opt
seccomp
=
unconfined
--ulimit
memlock
=
-1
:-1
--ipc
=
host
--network
host
--group-add
video
-v
<Host Path>:<Container Path> <Image ID> /bin/bash
*
DTK驱动:dtk23.04
```
*
Pytorch: 1.13
*
python: python3.8
镜像版本依赖:
*
DTK驱动:24.04.1
*
Pytorch: 2.1.0
*
python: python3.10
> [!NOTE]
>
> 使用lmdeploy0.0.13_dtk23.04_torch1.13_py38如果遇到 importError:libgemm multiB int4.so: cannot open shared obiect file: No such file or directory
>
> 解决方法:
>
> ```bash
> rm /usr/local/lib/python3.8/site-packages/_turbomind.cpython-38-x86_64-linux-gnu.so
> ```
## 数据集
## 数据集
无
无
...
@@ -33,7 +48,7 @@ docker run -it --name interlm --shm-size=1024G --device=/dev/kfd --device=/dev/
...
@@ -33,7 +48,7 @@ docker run -it --name interlm --shm-size=1024G --device=/dev/kfd --device=/dev/
## 推理
## 推理
### 源码编译安装
### 源码编译安装
```
```
bash
# 若使用光源的镜像,可以跳过源码编译安装,镜像里面安装好了lmdeploy。
# 若使用光源的镜像,可以跳过源码编译安装,镜像里面安装好了lmdeploy。
git clone http://developer.hpccube.com/codes/modelzoo/llama_lmdeploy.git
git clone http://developer.hpccube.com/codes/modelzoo/llama_lmdeploy.git
cd
llama_lmdeploy
cd
llama_lmdeploy
...
@@ -47,7 +62,7 @@ cd .. && python3 setup.py install
...
@@ -47,7 +62,7 @@ cd .. && python3 setup.py install
```
```
### 运行 internlm-chat-7
### 运行 internlm-chat-7
```
```
bash
# 模型转换
# 模型转换
# <model_name> 模型的名字 ('llama', 'internlm', 'vicuna', 'internlm-chat-7b', 'internlm-chat', 'internlm-chat-7b-8k', 'internlm-chat-20b', 'internlm-20b', 'baichuan-7b', 'baichuan2-7b', 'llama2', 'qwen-7b', 'qwen-14b')
# <model_name> 模型的名字 ('llama', 'internlm', 'vicuna', 'internlm-chat-7b', 'internlm-chat', 'internlm-chat-7b-8k', 'internlm-chat-20b', 'internlm-20b', 'baichuan-7b', 'baichuan2-7b', 'llama2', 'qwen-7b', 'qwen-14b')
# <model_path> 模型路径
# <model_path> 模型路径
...
@@ -71,13 +86,13 @@ lmdeploy chat turbomind --model_path ./workspace_interlm7b --tp 1 # 输入
...
@@ -71,13 +86,13 @@ lmdeploy chat turbomind --model_path ./workspace_interlm7b --tp 1 # 输入
# <tp> 用于张量并行的GPU数量应该是2^n (和模型转换的时候保持一致)
# <tp> 用于张量并行的GPU数量应该是2^n (和模型转换的时候保持一致)
# <restful_api> modelpath_or_server的标志(默认是False)
# <restful_api> modelpath_or_server的标志(默认是False)
lmdeploy serve gradio --model_path_or_server ./workspace_interlm7b --server_name {ip} --server_port {por
d
} --batch_size 32 --tp 1 --restful_api False
lmdeploy serve gradio
--model_path_or_server
./workspace_interlm7b
--server_name
{
ip
}
--server_port
{
por
t
}
--batch_size
32
--tp
1
--restful_api
False
在网页上输入{ip}:{por
d
}即可进行对话
在网页上输入
{
ip
}
:
{
por
t
}
即可进行对话
```
```
### 运行 internlm-chat-20b
### 运行 internlm-chat-20b
```
```
bash
# 模型转换
# 模型转换
lmdeploy convert
--model_name
internlm-chat-20b
--model_path
/path/to/model
--model_format
hf
--tokenizer_path
None
--dst_path
./workspace_interlm20b
--tp
4
lmdeploy convert
--model_name
internlm-chat-20b
--model_path
/path/to/model
--model_format
hf
--tokenizer_path
None
--dst_path
./workspace_interlm20b
--tp
4
...
@@ -87,9 +102,9 @@ lmdeploy chat turbomind --model_path ./workspace_interlm20b --tp 4
...
@@ -87,9 +102,9 @@ lmdeploy chat turbomind --model_path ./workspace_interlm20b --tp 4
# 服务器网页端运行
# 服务器网页端运行
在bash端运行:
在bash端运行:
lmdeploy serve gradio --model_path_or_server ./workspace_interlm20b --server_name {ip} --server_port {por
d
} --batch_size 32 --tp 4 --restful_api False
lmdeploy serve gradio
--model_path_or_server
./workspace_interlm20b
--server_name
{
ip
}
--server_port
{
por
t
}
--batch_size
32
--tp
4
--restful_api
False
在网页上输入{ip}:{por
d
}即可进行对话
在网页上输入
{
ip
}
:
{
por
t
}
即可进行对话
```
```
...
...
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