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
OpenDAS
Lmdeploy
Commits
b9ef84ab
Commit
b9ef84ab
authored
Nov 29, 2023
by
xiabo
Browse files
Update README.md
parent
d869f96d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
31 deletions
+11
-31
README.md
README.md
+11
-31
No files found.
README.md
View file @
b9ef84ab
...
@@ -30,51 +30,29 @@ LMdeploy官方github地址:[https://github.com/InternLM/lmdeploy](https://github
...
@@ -30,51 +30,29 @@ LMdeploy官方github地址:[https://github.com/InternLM/lmdeploy](https://github
### 使用源码编译方式安装
### 使用源码编译方式安装
#### 编译环境准备
#### 编译环境准备
提供3种环境准备方式:
下载光源的镜像,起dcoker
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:lmdeploy-dtk2310-torch1.13-py38
1.
基于已有的镜像,可跳过源码编译,直接进行推理。
# <Image ID>用上面拉取docker镜像的ID替换
# <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
```
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:lmdeploy0.0.13_dtk23.04_torch1.13_py38
注:要是非光源提供镜像,配置环境:(若安装过慢,可以添加源:pip3 install xxx -i https://pypi.tuna.tsinghua.edu.cn/simple/)
```
```
2.
基于光源pytorch基础镜像环境:镜像下载地址:
[
https://sourcefind.cn/#/image/dcu/pytorch
](
https://sourcefind.cn/#/image/dcu/pytorch
)
,根据pytorch、python、dtk及系统下载对应的镜像版本。(若安装过慢,可以添加源:pip3 install xxx -i https://pypi.tuna.tsinghua.edu.cn/simple/)
```
shell
pip3 install -r requirements.txt
pip3 install -r requirements.txt
pip3
install
transformers
==
4.33.2
pip3 install urllib3==1.24
pip3 install urllib3==1.24
pip3
install
gradio
==
3.50.2
pip3
install
wheel
yum install rapidjson
yum install rapidjson
# gcc版本需要>=9 安装高版本gcc
# 执行dtk环境变量
source
{
DTK_PATH
}
/env.sh
source
{
DTK_PATH
}
/cuda/env.sh
# 升级gcc版本到9
yum install -y centos-release-scl
yum install -y centos-release-scl
yum install -y devtoolset-9
yum install -y devtoolset-9
scl enable devtoolset-9 bash
scl enable devtoolset-9 bash
```
3.
基于现有python环境:安装pytorch,pytorch whl包下载目录:
[
https://cancon.hpccube.com:65024/4/main/pytorch/dtk23.04
](
https://cancon.hpccube.com:65024/4/main/pytorch/dtk23.04
)
,根据python、dtk版本,下载对应pytorch的whl包。安装命令如下:
```
shell
pip3
install
torch
*
(
下载的torch的whl包
)
pip3
install
-r
requirements.txt
pip3
install
transformers
==
4.33.2
pip3
install
urllib3
==
1.24
pip3
install
gradio
==
3.50.2
pip3
install
wheel
yum
install
rapidjson
# 执行dtk环境变量
# 执行dtk环境变量
source {DTK_PATH}/env.sh
source {DTK_PATH}/env.sh
source {DTK_PATH}/cuda/env.sh
source {DTK_PATH}/cuda/env.sh
# 升级gcc版本到9
yum
install
-y
centos-release-scl
yum
install
-y
devtoolset-9
scl
enable
devtoolset-9 bash
```
```
注:需要GCC版本>=9.0
#### 源码编译安装
#### 源码编译安装
-
代码下载
-
代码下载
...
@@ -88,6 +66,8 @@ make -j 32 && make install
...
@@ -88,6 +66,8 @@ make -j 32 && make install
cd .. && python3 setup.py install
cd .. && python3 setup.py install
2. 编译成whl包安装
2. 编译成whl包安装
# 安装wheel
pip3 install wheel
mkdir build && cd build
mkdir build && cd build
sh ../generate.sh
sh ../generate.sh
make -j 32 && make install
make -j 32 && make install
...
...
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