Skip to content

Commit 5ed03e3

Browse files
committed
fix
1 parent 4d65e33 commit 5ed03e3

File tree

2 files changed

+10
-39
lines changed

2 files changed

+10
-39
lines changed

.github/workflows/docker-publish.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,7 @@ jobs:
118118
# Remove the container
119119
docker rm "$CONTAINER_ID"
120120
# Verify wheel file has been copied
121-
echo "Exported wheel files:"
122-
ls -la ./out
123-
WHEEL_COUNT=$(ls -1 ./out/*.whl | wc -l)
124-
echo "Total wheel files: $WHEEL_COUNT"
121+
ls ./out
125122
126123
- name: Upload .whl to GitHub Release
127124
if: startsWith(github.ref, 'refs/tags/')
@@ -132,7 +129,7 @@ jobs:
132129
133130
# Get wheel file information
134131
LIGHTKERNEL_WHEEL=$(ls ./out/lightllm_kernel-*.whl | head -n1 | xargs basename)
135-
FLASH_ATTN_WHEEL=$(ls ./out/flash_attn_3-*.whl | head -n1 | xargs basename)
132+
FA3_MTP_WHEEL=$(ls ./out/flash_attn_3-*.whl | head -n1 | xargs basename)
136133
137134
gh release create "$TAG_NAME" ./out/*.whl \
138135
--title "LightKernel Release $TAG_NAME" \
@@ -142,20 +139,20 @@ jobs:
142139
143140
📦 **Packages:**
144141
- **$LIGHTKERNEL_WHEEL** - Core CUDA kernel library
145-
- **$FLASH_ATTN_WHEEL** - Flash Attention 3.0 (Hopper)
142+
- **$FA3_MTP_WHEEL** - Fa3 MTP 3.0 (Hopper)
146143
147144
🚀 **Quick Installation:**
148145
\`\`\`bash
149146
# Install both packages
150147
pip install https://github.com/${{ github.repository }}/releases/download/$TAG_NAME/$LIGHTKERNEL_WHEEL
151-
pip install https://github.com/${{ github.repository }}/releases/download/$TAG_NAME/$FLASH_ATTN_WHEEL
148+
pip install https://github.com/${{ github.repository }}/releases/download/$TAG_NAME/$FA3_MTP_WHEEL
152149
\`\`\`
153150
154151
🔧 **Build Environment:**
155152
- CUDA: 12.6.1 with cuDNN
156153
- PyTorch: 2.7.1
157154
- Python: 3.10
158-
- Architecture: CUDA Compute Capabilities 8.0, 8.6, 8.9, 9.0
155+
- Architecture: CUDA Compute Capabilities 9.0
159156
160157
🐳 **Docker Image:** \`${{ steps.meta.outputs.tags }}\`
161158

Dockerfile

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,15 @@ ARG TARGETPLATFORM
77
ENV PATH=/opt/conda/bin:$PATH \
88
CONDA_PREFIX=/opt/conda
99

10-
# Install system dependencies
1110
RUN chmod 777 -R /tmp && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
1211
ca-certificates \
1312
libssl-dev \
1413
curl \
1514
g++ \
1615
make \
17-
git \
18-
cmake \
19-
ninja-build \
20-
build-essential && \
16+
git && \
2117
rm -rf /var/lib/apt/lists/*
2218

23-
# Install Mambaforge
2419
RUN case ${TARGETPLATFORM} in \
2520
"linux/arm64") MAMBA_ARCH=aarch64 ;; \
2621
*) MAMBA_ARCH=x86_64 ;; \
@@ -29,24 +24,18 @@ RUN case ${TARGETPLATFORM} in \
2924
bash ~/mambaforge.sh -b -p /opt/conda && \
3025
rm ~/mambaforge.sh
3126

32-
# Install Python
3327
RUN case ${TARGETPLATFORM} in \
3428
"linux/arm64") exit 1 ;; \
3529
*) /opt/conda/bin/conda update -y conda && \
3630
/opt/conda/bin/conda install -y "python=${PYTHON_VERSION}" ;; \
3731
esac && \
3832
/opt/conda/bin/conda clean -ya
3933

40-
# Set working directory
41-
WORKDIR /workspace
4234

43-
# Install PyTorch with CUDA support
44-
RUN pip install torch==2.7.1
35+
WORKDIR /root
4536

46-
# Install build dependencies
47-
RUN pip install --upgrade pip setuptools wheel build scikit-build-core[pyproject] pybind11 ninja
37+
RUN pip install torch==2.7.1
4838

49-
# Copy source code to container
5039
COPY . .
5140

5241
# 🔧 设置 PyTorch 路径,让 CMake 能找到 Torch 配置
@@ -55,18 +44,14 @@ RUN python -c "import torch; print(f'PyTorch installed at: {torch.__path__[0]}')
5544
TORCH_PATH=$(python -c "import torch; print(torch.utils.cmake_prefix_path)") && \
5645
echo "Torch CMAKE path: $TORCH_PATH"
5746

58-
# Set environment variables for building
59-
ENV FLASH_ATTENTION_FORCE_BUILD=TRUE \
60-
FLASH_ATTENTION_DISABLE_BACKWARD=TRUE \
61-
CUDA_HOME=/usr/local/cuda \
47+
ENV CUDA_HOME=/usr/local/cuda \
6248
CUDA_ROOT=/usr/local/cuda
6349

6450
# 🎯 关键修复:设置 CMAKE_PREFIX_PATH 让 CMake 找到 PyTorch
6551
RUN TORCH_CMAKE_PATH=$(python -c "import torch; print(torch.utils.cmake_prefix_path)") && \
6652
echo "export CMAKE_PREFIX_PATH=$TORCH_CMAKE_PATH:\$CMAKE_PREFIX_PATH" >> ~/.bashrc && \
6753
echo "CMAKE_PREFIX_PATH=$TORCH_CMAKE_PATH" >> /etc/environment
6854

69-
# Create output directory
7055
RUN mkdir -p /out
7156

7257
# Build lightllm-kernel package (main project)
@@ -82,17 +67,6 @@ RUN echo "🔧 Building lightllm-kernel package..." && \
8267
# Build flash_attn_3 package (hopper)
8368
RUN echo "🔧 Building flash_attn_3 package..." && \
8469
cd flash-attention/hopper && \
85-
MAX_JOBS=2 NVCC_THREADS=2 FLASH_ATTN_CUDA_ARCHS=90 python setup.py bdist_wheel && \
70+
MAX_JOBS=1 NVCC_THREADS=1 FLASH_ATTN_CUDA_ARCHS=90 FLASH_ATTENTION_DISABLE_SM80=TRUE python setup.py bdist_wheel && \
8671
cp dist/*.whl /out/ && \
8772
echo "✅ flash_attn_3 build completed"
88-
89-
# Verify all wheels are built
90-
RUN echo "📦 Final wheel packages:" && \
91-
ls -la /out/ && \
92-
WHEEL_COUNT=$(ls -1 /out/*.whl | wc -l) && \
93-
echo "Total wheels built: $WHEEL_COUNT" && \
94-
if [ "$WHEEL_COUNT" -ne 2 ]; then \
95-
echo "❌ Error: Expected 2 wheels, found $WHEEL_COUNT" && exit 1; \
96-
else \
97-
echo "✅ Successfully built all wheel packages"; \
98-
fi

0 commit comments

Comments
 (0)