Skip to content

Commit 18a2adf

Browse files
FindHaofacebook-github-bot
authored andcommitted
Fix CI build and improve parallelism (#47)
Summary: This PR introduces two main improvements to the CI workflow: 1. **Run Jobs in Parallel:** The `test` job no longer waits for the `format-check` job to complete. By removing the `needs` dependency in `.github/workflows/test.yml`, both jobs can run concurrently, which helps to speed up the overall CI pipeline. 2. **Fix Broken cuDNN Installation:** The CI was failing during the environment setup because the `install_cudnn.sh` script from the PyTorch repository was removed. This has been fixed by: * Using the newer `install_cuda.sh` script which contains the necessary `install_cudnn` function. * Correctly calling the `install_cudnn` function with the required `CUDA_VERSION` and `CUDNN_VERSION` arguments. These changes make the CI process both faster and more reliable. Pull Request resolved: #47 Reviewed By: adamomainz Differential Revision: D79178763 Pulled By: FindHao fbshipit-source-id: cdd4aaf4c0cc1ea7715f99d27b532d18202950af
1 parent 1661137 commit 18a2adf

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

.ci/setup.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,13 @@ else
8787
HAS_CORRECT_CUDA=false
8888
fi
8989

90-
if [ "$HAS_CORRECT_CUDA" = "true" ]; then
91-
echo "🔧 Installing development libraries only..."
92-
# Install other dev libraries but skip CUDA toolkit
93-
sudo apt-get install -y libstdc++6 libstdc++-12-dev libffi-dev libncurses-dev zlib1g-dev libxml2-dev git build-essential
94-
else
95-
echo "📦 Installing CUDA $CUDA_VERSION_REQUIRED and development libraries..."
90+
echo "🔧 Installing development libraries"
91+
sudo apt-get install -y libstdc++6 libstdc++-12-dev libffi-dev libncurses-dev zlib1g-dev libxml2-dev git build-essential cmake bc gdb curl wget
92+
93+
if [ "$HAS_CORRECT_CUDA" != "true" ]; then
94+
echo "📦 Installing CUDA $CUDA_VERSION_REQUIRED"
9695
# Install all packages including CUDA toolkit (this is the big download)
97-
sudo apt-get install -y cuda-toolkit-12.8 libstdc++6 libstdc++-12-dev libffi-dev libncurses-dev zlib1g-dev libxml2-dev git build-essential
96+
sudo apt-get install -y cuda-toolkit-12.8
9897
fi
9998

10099
# Verify clang installation
@@ -170,7 +169,14 @@ echo "Using cuDNN version: $CUDNN_VERSION"
170169

171170
# Install cuDNN using PyTorch's script
172171
echo "Installing cuDNN using PyTorch's script..."
173-
curl -s https://raw.githubusercontent.com/pytorch/pytorch/main/.ci/docker/common/install_cudnn.sh | sudo bash
172+
curl -s https://raw.githubusercontent.com/pytorch/pytorch/main/.ci/docker/common/install_cuda.sh -o /tmp/install_cuda.sh
173+
chmod +x /tmp/install_cuda.sh
174+
# The install_cudnn function is defined in install_cuda.sh.
175+
# We source the script and call the function with sudo to install cuDNN.
176+
# The -E flag preserves the environment variables. The function expects
177+
# CUDA major version (e.g., "12") and CUDNN version as arguments.
178+
CUDA_MAJOR_VERSION="${CUDA_VERSION%%.*}"
179+
sudo -E bash -c "source /tmp/install_cuda.sh && install_cudnn \"${CUDA_MAJOR_VERSION}\" \"${CUDNN_VERSION}\""
174180

175181
# Install PyTorch nightly
176182
echo "Installing PyTorch nightly..."

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
test:
6060
runs-on: 4-core-ubuntu-gpu-t4
6161
timeout-minutes: 120
62-
needs: format-check
6362
steps:
6463
- uses: actions/checkout@v4
6564

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,4 @@ clean:
5555

5656
install-dev:
5757
@echo "Installing development dependencies..."
58-
pip install -e ".[test]"
59-
pip install black usort ruff
58+
pip install black usort ruff coverage

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ pip install -e .
7171

7272
**Prerequisites:** Python ≥ 3.10, Triton > 3.3.1 ([install from source](https://github.com/triton-lang/triton)), GPU required (NVIDIA/AMD)
7373

74+
TritonParse relies on new features in Triton > 3.3.1. Please install Triton from source for now.
75+
7476
## 📚 Complete Documentation
7577

7678
| 📖 Guide | Description |

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ test = [
1515
"coverage>=7.0.0",
1616
]
1717

18+
1819
[tool.setuptools.packages.find]
1920
include = ["tritonparse*"]
2021

0 commit comments

Comments
 (0)