Commit b9ef84ab authored by xiabo's avatar xiabo
Browse files

Update README.md

parent d869f96d
......@@ -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 transformers==4.33.2
pip3 install urllib3==1.24
pip3 install gradio==3.50.2
pip3 install wheel
yum install rapidjson
# 执行dtk环境变量
source {DTK_PATH}/env.sh
source {DTK_PATH}/cuda/env.sh
# 升级gcc版本到9
# gcc版本需要>=9 安装高版本gcc
yum install -y centos-release-scl
yum install -y devtoolset-9
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环境变量
source {DTK_PATH}/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
cd .. && python3 setup.py install
2. 编译成whl包安装
# 安装wheel
pip3 install wheel
mkdir build && cd build
sh ../generate.sh
make -j 32 && make install
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment