Update Flash Attn Installation

This commit is contained in:
XXXXRT666 2026-02-17 04:35:40 +00:00
parent d5ed91deb5
commit 319a09fa2d
4 changed files with 11 additions and 9 deletions

View File

@ -59,17 +59,17 @@ source "$HOME/.bashrc"
"$HOME/conda/bin/conda" install gcc=11 gxx ffmpeg uv cmake make unzip $SYSROOT_PKG "libstdcxx-ng>=11" -y "$HOME/conda/bin/conda" install gcc=11 gxx ffmpeg uv cmake make unzip $SYSROOT_PKG "libstdcxx-ng>=11" -y
cd workspace
if [ "$CUDA_VERSION" = "12.8" ]; then if [ "$CUDA_VERSION" = "12.8" ]; then
"$HOME/conda/bin/uv" pip install ".[cu128]" --no-cache-dir --python "$(which python)" "$HOME/conda/bin/uv" pip install ".[cu128]" --no-cache-dir --python "$HOME/conda/bin/python"
"$HOME/conda/bin/conda" install cuda-nvcc=12.8 -y
elif [ "$CUDA_VERSION" = "12.6" ]; then elif [ "$CUDA_VERSION" = "12.6" ]; then
"$HOME/conda/bin/uv" pip install ".[cu126]" --no-cache-dir --python "$(which python)" "$HOME/conda/bin/uv" pip install ".[cu126]" --no-cache-dir --python "$HOME/conda/bin/python"
"$HOME/conda/bin/conda" install cuda-nvcc=12.6 -y
fi fi
export PATH="$HOME/conda/bin:$PATH" export PATH="$HOME/conda/bin:$PATH"
"$HOME/conda/bin/uv" pip install ".[flash-attn]" --python "$(which python)" "$HOME/conda/bin/uv" pip install ".[flash-attn]" --python "$HOME/conda/bin/python"
"$HOME/conda/bin/uv" cache clean "$HOME/conda/bin/uv" cache clean
rm $LOG_PATH rm $LOG_PATH

View File

@ -331,7 +331,6 @@ switch ($Device) {
} }
Write-Info "Installing PyTorch For CUDA 12.8..." Write-Info "Installing PyTorch For CUDA 12.8..."
Invoke-PIP ".[cu128]" Invoke-PIP ".[cu128]"
Invoke-Conda cuda-nvcc=12.8
Write-Info "Installing Flash Attn..." Write-Info "Installing Flash Attn..."
Invoke-PIP ".[flash-attn]" Invoke-PIP ".[flash-attn]"
Write-Success "Flash Attn Installed" Write-Success "Flash Attn Installed"
@ -346,7 +345,6 @@ switch ($Device) {
} }
Write-Info "Installing PyTorch For CUDA 12.6..." Write-Info "Installing PyTorch For CUDA 12.6..."
Invoke-PIP ".[cu126]" Invoke-PIP ".[cu126]"
Invoke-Conda cuda-nvcc=12.6
Write-Info "Installing Flash Attn..." Write-Info "Installing Flash Attn..."
Invoke-PIP ".[flash-attn]" Invoke-PIP ".[flash-attn]"
Write-Success "Flash Attn Installed" Write-Success "Flash Attn Installed"

View File

@ -392,14 +392,12 @@ if [ "$USE_CUDA" = true ] && [ "$WORKFLOW" = false ]; then
fi fi
echo -e "${INFO}Installing PyTorch For CUDA 12.8..." echo -e "${INFO}Installing PyTorch For CUDA 12.8..."
run_pip_quiet ".[cu128]" run_pip_quiet ".[cu128]"
run_conda_quiet cuda-nvcc=12.8
elif [ "$CUDA" = 126 ]; then elif [ "$CUDA" = 126 ]; then
if awk "BEGIN {exit !($CUDAVERSION < 12.0)}"; then if awk "BEGIN {exit !($CUDAVERSION < 12.0)}"; then
echo -e "${WARNING}CUDA 12.6 Is Not Supported By Current Driver" echo -e "${WARNING}CUDA 12.6 Is Not Supported By Current Driver"
fi fi
echo -e "${INFO}Installing PyTorch For CUDA 12.6..." echo -e "${INFO}Installing PyTorch For CUDA 12.6..."
run_pip_quiet ".[cu126]" run_pip_quiet ".[cu126]"
run_conda_quiet cuda-nvcc=12.6
fi fi
echo -e "${INFO}Installing Flash Attn" echo -e "${INFO}Installing Flash Attn"

View File

@ -75,6 +75,12 @@ dependency-metadata = [
{ name = "faster-whisper", requires-dist = [], requires-python = ">=3.10" }, { name = "faster-whisper", requires-dist = [], requires-python = ">=3.10" },
] ]
[tool.uv.extra-build-dependencies]
flash-attn = [{ requirement = "torch", match-runtime = true }]
[tool.uv.extra-build-variables]
flash-attn = { FLASH_ATTENTION_SKIP_CUDA_BUILD = "TRUE" }
[tool.uv.pip] [tool.uv.pip]
no-binary = ["opencc"] no-binary = ["opencc"]