Commit 3e5dfb4d authored by Yang Yong(雍洋)'s avatar Yang Yong(雍洋) Committed by GitHub
Browse files

update docker (#264)

parent a8aea27f
...@@ -34,9 +34,8 @@ RUN cd flash-attention && python setup.py install && rm -rf build ...@@ -34,9 +34,8 @@ RUN cd flash-attention && python setup.py install && rm -rf build
RUN cd flash-attention/hopper && python setup.py install && rm -rf build RUN cd flash-attention/hopper && python setup.py install && rm -rf build
# RUN git clone https://github.com/thu-ml/SageAttention.git RUN git clone https://github.com/ModelTC/SageAttention.git
# # install sageattention with hopper gpu sm9.0 RUN cd SageAttention && CUDA_ARCHITECTURES="8.0,8.6,8.9,9.0,12.0" EXT_PARALLEL=4 NVCC_APPEND_FLAGS="--threads 8" MAX_JOBS=32 pip install --no-cache-dir -v -e .
# RUN cd SageAttention && sed -i 's/set()/{"9.0"}/' setup.py && EXT_PARALLEL=4 NVCC_APPEND_FLAGS="--threads 8" MAX_JOBS=32 pip install --no-cache-dir -v -e .
WORKDIR /workspace WORKDIR /workspace
...@@ -34,9 +34,8 @@ RUN cd flash-attention && python setup.py install && rm -rf build ...@@ -34,9 +34,8 @@ RUN cd flash-attention && python setup.py install && rm -rf build
RUN cd flash-attention/hopper && python setup.py install && rm -rf build RUN cd flash-attention/hopper && python setup.py install && rm -rf build
# RUN git clone https://github.com/thu-ml/SageAttention.git RUN git clone https://github.com/ModelTC/SageAttention.git
# # install sageattention with hopper gpu sm9.0 RUN cd SageAttention && CUDA_ARCHITECTURES="8.0,8.6,8.9,9.0" EXT_PARALLEL=4 NVCC_APPEND_FLAGS="--threads 8" MAX_JOBS=32 pip install --no-cache-dir -v -e .
# RUN cd SageAttention && sed -i 's/set()/{"9.0"}/' setup.py && EXT_PARALLEL=4 NVCC_APPEND_FLAGS="--threads 8" MAX_JOBS=32 pip install --no-cache-dir -v -e .
WORKDIR /workspace WORKDIR /workspace
...@@ -27,39 +27,16 @@ We strongly recommend using the Docker environment, which is the simplest and fa ...@@ -27,39 +27,16 @@ We strongly recommend using the Docker environment, which is the simplest and fa
#### 1. Pull Image #### 1. Pull Image
Visit LightX2V's [Docker Hub](https://hub.docker.com/r/lightx2v/lightx2v/tags), select a tag with the latest date, such as `25080601-cu128`: Visit LightX2V's [Docker Hub](https://hub.docker.com/r/lightx2v/lightx2v/tags), select a tag with the latest date, such as `25082901-cu128`:
```bash ```bash
# Pull the latest version of LightX2V image, this image does not have SageAttention installed docker pull lightx2v/lightx2v:25082901-cu128
docker pull lightx2v/lightx2v:25080601-cu128
```
If you need to use `SageAttention`, you can use image versions with the `-SageSmXX` suffix. The use of `SageAttention` requires selection based on GPU type, where:
1. A100: -SageSm80
2. RTX30 series: -SageSm86
3. RTX40 series: -SageSm89
4. H100: -SageSm90
5. RTX50 series: -SageSm120
For example, to use `SageAttention` on 4090 or H100, the image pull commands are:
```bash
# For 4090, with SageAttention installed
docker pull lightx2v/lightx2v:25080601-cu128-SageSm89
# For H100, with SageAttention installed
docker pull lightx2v/lightx2v:25080601-cu128-SageSm90
``` ```
We recommend using the `cuda128` environment for faster inference speed. If you need to use the `cuda124` environment, you can use image versions with the `-cu124` suffix: We recommend using the `cuda128` environment for faster inference speed. If you need to use the `cuda124` environment, you can use image versions with the `-cu124` suffix:
```bash ```bash
# cuda124 version, without SageAttention installed docker pull lightx2v/lightx2v:25082901-cu124
docker pull lightx2v/lightx2v:25080601-cu124
# For 4090, cuda124 version, with SageAttention installed
docker pull lightx2v/lightx2v:25080601-cu124-SageSm89
# For H100, cuda124 version, with SageAttention installed
docker pull lightx2v/lightx2v:25080601-cu124-SageSm90
``` ```
#### 2. Run Container #### 2. Run Container
...@@ -73,26 +50,11 @@ docker run --gpus all -itd --ipc=host --name [container_name] -v [mount_settings ...@@ -73,26 +50,11 @@ docker run --gpus all -itd --ipc=host --name [container_name] -v [mount_settings
For mainland China, if the network is unstable when pulling images, you can pull from Alibaba Cloud: For mainland China, if the network is unstable when pulling images, you can pull from Alibaba Cloud:
```bash ```bash
# Replace [tag] with the required image tag to download # cuda128
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:[tag] docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25082901-cu128
# For example, download 25080601-cu128
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25080601-cu128
# For example, download 25080601-cu128-SageSm89
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25080601-cu128-SageSm89
# For example, download 25080601-cu128-SageSm90
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25080601-cu128-SageSm90
# For example, download 25080601-cu124
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25080601-cu124
# For example, download 25080601-cu124-SageSm89
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25080601-cu124-SageSm89
# For example, download 25080601-cu124-SageSm90 # cuda124
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25080601-cu124-SageSm90 docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25082901-cu124
``` ```
### 🐍 Conda Environment Setup ### 🐍 Conda Environment Setup
......
...@@ -27,39 +27,16 @@ ...@@ -27,39 +27,16 @@
#### 1. 拉取镜像 #### 1. 拉取镜像
访问 LightX2V 的 [Docker Hub](https://hub.docker.com/r/lightx2v/lightx2v/tags),选择一个最新日期的 tag,比如 `25080601-cu128` 访问 LightX2V 的 [Docker Hub](https://hub.docker.com/r/lightx2v/lightx2v/tags),选择一个最新日期的 tag,比如 `25082901-cu128`
```bash ```bash
# 拉取最新版本的 LightX2V 镜像,此镜像没有安装 SageAttention docker pull lightx2v/lightx2v:25082901-cu128
docker pull lightx2v/lightx2v:25080601-cu128
```
如果需要使用`SageAttention`,可以使用带`-SageSmXX`后缀的镜像版本,`SageAttention`的使用需要针对GPU类型进行选择,其中:
1. A100: -SageSm80
2. RTX30系列: -SageSm86
3. RTX40系列: -SageSm89
4. H100: -SageSm90
5. RTX50系列: -SageSm120
比如要在4090或者H100上使用`SageAttention`,则拉取镜像命令为:
```bash
# 对于4090,安装了 SageAttention
docker pull lightx2v/lightx2v:25080601-cu128-SageSm89
# 对于H100,安装了 SageAttention
docker pull lightx2v/lightx2v:25080601-cu128-SageSm90
``` ```
我们推荐使用`cuda128`环境,以获得更快的推理速度,若需要使用`cuda124`环境,可以使用带`-cu124`后缀的镜像版本: 我们推荐使用`cuda128`环境,以获得更快的推理速度,若需要使用`cuda124`环境,可以使用带`-cu124`后缀的镜像版本:
```bash ```bash
# cuda124版本,没有安装 SageAttention docker pull lightx2v/lightx2v:25082901-cu124
docker pull lightx2v/lightx2v:25080601-cu124
# 对于4090,cuda124版本,安装了 SageAttention
docker pull lightx2v/lightx2v:25080601-cu124-SageSm89
# 对于H100,cuda124版本,安装了 SageAttention
docker pull lightx2v/lightx2v:25080601-cu124-SageSm90
``` ```
#### 2. 运行容器 #### 2. 运行容器
...@@ -73,26 +50,11 @@ docker run --gpus all -itd --ipc=host --name [容器名] -v [挂载设置] --ent ...@@ -73,26 +50,11 @@ docker run --gpus all -itd --ipc=host --name [容器名] -v [挂载设置] --ent
对于中国大陆地区,如果拉取镜像时网络不稳定,可以从阿里云上拉取: 对于中国大陆地区,如果拉取镜像时网络不稳定,可以从阿里云上拉取:
```bash ```bash
# 修改[tag]为所需下载的镜像tag # cuda128
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:[tag] docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25082901-cu128
# 比如下载 25080601-cu128
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25080601-cu128
# 比如下载 25080601-cu128-SageSm89
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25080601-cu128-SageSm89
# 比如下载 25080601-cu128-SageSm90
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25080601-cu128-SageSm90
# 比如下载 25080601-cu124
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25080601-cu124
# 比如下载 25080601-cu124-SageSm89
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25080601-cu124-SageSm89
# 比如下载 25080601-cu124-SageSm90 # cuda124
docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25080601-cu124-SageSm90 docker pull registry.cn-hangzhou.aliyuncs.com/yongyang/lightx2v:25082901-cu124
``` ```
### 🐍 Conda 环境搭建 ### 🐍 Conda 环境搭建
......
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