Skip to content

Commit ebea4bd

Browse files
authored
Moved common requirements from docker and setup.py to file (#1880)
<!-- .github/pull_request_template.md --> ## 📌 Description <!-- What does this PR do? Briefly describe the changes and why they’re needed. --> To avoid duplication bugs between Dockerfile (install_python_packages.sh) and setup.py, the common dependencies were moved into requirements.txt ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### ✅ Pre-commit Checks - [ ] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [x] I have installed the hooks with `pre-commit install`. - [ ] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## 🧪 Tests - [ ] Tests have been added or updated as needed. - [ ] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. -->
1 parent a4ddf26 commit ebea4bd

12 files changed

+55
-37
lines changed

.github/workflows/release-ci-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: Build and push ${{ matrix.cuda }} ${{ matrix.arch }} image
6868
uses: docker/build-push-action@v5
6969
with:
70-
context: docker
70+
context: .
7171
file: docker/Dockerfile.${{ matrix.cuda }}
7272
platforms: linux/${{ matrix.arch }}
7373
push: ${{ github.event_name != 'pull_request' }}

docker/Dockerfile.cu126

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y \
99
wget
1010

1111
# Install python
12-
COPY install/install_python.sh /install/install_python.sh
12+
COPY docker/install/install_python.sh /install/install_python.sh
1313
RUN bash /install/install_python.sh /opt/conda py312
1414

1515
# Set home directory
@@ -20,7 +20,8 @@ ENV PATH="/opt/conda/bin:$PATH"
2020
ENV PATH="/opt/conda/envs/py312/bin:$PATH"
2121

2222
# Install torch and other python packages
23-
COPY install/install_python_packages.sh /install/install_python_packages.sh
23+
COPY requirements.txt /install/requirements.txt
24+
COPY docker/install/install_python_packages.sh /install/install_python_packages.sh
2425
RUN bash /install/install_python_packages.sh cu126
2526

2627
# Install mpi4py in the conda environment

docker/Dockerfile.cu126.dev

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ USER $USERNAME
3737
WORKDIR /home/$USERNAME
3838

3939
# Install python
40-
COPY install/install_python.sh /install/install_python.sh
40+
COPY docker/install/install_python.sh /install/install_python.sh
4141
RUN bash /install/install_python.sh /home/$USERNAME/conda py312
4242

4343
RUN echo "source activate py312" >> ~/.bashrc
4444
ENV PATH="/home/$USERNAME/conda/bin:$PATH"
4545
ENV PATH="/home/$USERNAME/conda/envs/py312/bin:$PATH"
4646

4747
# Install torch and other python packages
48-
COPY install/install_python_packages.sh /install/install_python_packages.sh
48+
COPY requirements.txt /install/requirements.txt
49+
COPY docker/install/install_python_packages.sh /install/install_python_packages.sh
4950
RUN bash /install/install_python_packages.sh cu126 && pip3 install pre-commit
5051

5152
# Install mpi4py in the conda environment

docker/Dockerfile.cu128

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y \
99
wget
1010

1111
# Install python
12-
COPY install/install_python.sh /install/install_python.sh
12+
COPY docker/install/install_python.sh /install/install_python.sh
1313
RUN bash /install/install_python.sh /opt/conda py312
1414

1515
# Set home directory
@@ -20,7 +20,8 @@ ENV PATH="/opt/conda/bin:$PATH"
2020
ENV PATH="/opt/conda/envs/py312/bin:$PATH"
2121

2222
# Install torch and other python packages
23-
COPY install/install_python_packages.sh /install/install_python_packages.sh
23+
COPY requirements.txt /install/requirements.txt
24+
COPY docker/install/install_python_packages.sh /install/install_python_packages.sh
2425
RUN bash /install/install_python_packages.sh cu128
2526

2627
# Install mpi4py in the conda environment

docker/Dockerfile.cu128.dev

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ USER $USERNAME
3737
WORKDIR /home/$USERNAME
3838

3939
# Install python
40-
COPY install/install_python.sh /install/install_python.sh
40+
COPY docker/install/install_python.sh /install/install_python.sh
4141
RUN bash /install/install_python.sh /home/$USERNAME/conda py312
4242

4343
RUN echo "source activate py312" >> ~/.bashrc
4444
ENV PATH="/home/$USERNAME/conda/bin:$PATH"
4545
ENV PATH="/home/$USERNAME/conda/envs/py312/bin:$PATH"
4646

4747
# Install torch and other python packages
48-
COPY install/install_python_packages.sh /install/install_python_packages.sh
48+
COPY requirements.txt /install/requirements.txt
49+
COPY docker/install/install_python_packages.sh /install/install_python_packages.sh
4950
RUN bash /install/install_python_packages.sh cu128 && pip3 install pre-commit
5051

5152
# Install mpi4py in the conda environment

docker/Dockerfile.cu129

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y \
99
wget
1010

1111
# Install python
12-
COPY install/install_python.sh /install/install_python.sh
12+
COPY docker/install/install_python.sh /install/install_python.sh
1313
RUN bash /install/install_python.sh /opt/conda py312
1414

1515
# Set home directory
@@ -23,7 +23,8 @@ ENV PATH="/opt/conda/envs/py312/bin:$PATH"
2323
ENV TRITON_PTXAS_PATH="/usr/local/cuda/bin/ptxas"
2424

2525
# Install torch and other python packages
26-
COPY install/install_python_packages.sh /install/install_python_packages.sh
26+
COPY requirements.txt /install/requirements.txt
27+
COPY docker/install/install_python_packages.sh /install/install_python_packages.sh
2728
RUN bash /install/install_python_packages.sh cu129
2829

2930
# Install mpi4py in the conda environment

docker/Dockerfile.cu129.dev

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ USER $USERNAME
3737
WORKDIR /home/$USERNAME
3838

3939
# Install python
40-
COPY install/install_python.sh /install/install_python.sh
40+
COPY docker/install/install_python.sh /install/install_python.sh
4141
RUN bash /install/install_python.sh /home/$USERNAME/conda py312
4242

4343
RUN echo "source activate py312" >> ~/.bashrc
4444
ENV PATH="/home/$USERNAME/conda/bin:$PATH"
4545
ENV PATH="/home/$USERNAME/conda/envs/py312/bin:$PATH"
4646

4747
# Install torch and other python packages
48-
COPY install/install_python_packages.sh /install/install_python_packages.sh
48+
COPY requirements.txt /install/requirements.txt
49+
COPY docker/install/install_python_packages.sh /install/install_python_packages.sh
4950
RUN bash /install/install_python_packages.sh cu129 && pip3 install pre-commit
5051

5152
# Install mpi4py in the conda environment

docker/Dockerfile.cu130

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y \
99
wget
1010

1111
# Install python
12-
COPY install/install_python.sh /install/install_python.sh
12+
COPY docker/install/install_python.sh /install/install_python.sh
1313
RUN bash /install/install_python.sh /opt/conda py312
1414

1515
# Set home directory
@@ -23,7 +23,8 @@ ENV PATH="/opt/conda/envs/py312/bin:$PATH"
2323
ENV TRITON_PTXAS_PATH="/usr/local/cuda/bin/ptxas"
2424

2525
# Install torch and other python packages
26-
COPY install/install_python_packages.sh /install/install_python_packages.sh
26+
COPY requirements.txt /install/requirements.txt
27+
COPY docker/install/install_python_packages.sh /install/install_python_packages.sh
2728
# use nightly/cu130 temporarily and change to cu130 when torch releases stable version
2829
RUN bash /install/install_python_packages.sh nightly/cu130
2930

docker/Dockerfile.cu130.dev

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ USER $USERNAME
3737
WORKDIR /home/$USERNAME
3838

3939
# Install python
40-
COPY install/install_python.sh /install/install_python.sh
40+
COPY docker/install/install_python.sh /install/install_python.sh
4141
RUN bash /install/install_python.sh /home/$USERNAME/conda py312
4242

4343
RUN echo "source activate py312" >> ~/.bashrc
4444
ENV PATH="/home/$USERNAME/conda/bin:$PATH"
4545
ENV PATH="/home/$USERNAME/conda/envs/py312/bin:$PATH"
4646

4747
# Install torch and other python packages
48-
COPY install/install_python_packages.sh /install/install_python_packages.sh
48+
COPY requirements.txt /install/requirements.txt
49+
COPY docker/install/install_python_packages.sh /install/install_python_packages.sh
4950
# use nightly/cu130 temporarily and change to cu130 when torch releases stable version
5051
RUN bash /install/install_python_packages.sh nightly/cu130 && pip3 install pre-commit
5152

docker/install/install_python_packages.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,8 @@ set -u
2323
CUDA_VERSION=${1:-cu128}
2424

2525
pip3 install torch --index-url https://download.pytorch.org/whl/${CUDA_VERSION}
26-
pip3 install requests responses ninja pytest numpy scipy build nvidia-ml-py cuda-python einops nvidia-nvshmem-cu12
27-
pip3 install click
28-
pip3 install 'apache-tvm-ffi==0.1.0b15'
29-
pip3 install nvidia-cutlass-dsl
30-
pip3 install 'nvidia-cudnn-frontend>=1.13.0'
26+
pip3 install -r /install/requirements.txt
27+
pip3 install responses pytest scipy build cuda-python nvidia-nvshmem-cu12
3128

3229
# Install cudnn package based on CUDA version
3330
if [[ "$CUDA_VERSION" == *"cu13"* ]]; then

0 commit comments

Comments
 (0)