Skip to content

Commit a2426b3

Browse files
committed
fix lint
1 parent c6a9711 commit a2426b3

File tree

7 files changed

+127
-129
lines changed

7 files changed

+127
-129
lines changed

.ci/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ The scripts assume:
140140
- Linux environment
141141
- Git available
142142
- Internet access for downloading packages
143-
- Sufficient disk space for conda and packages
143+
- Sufficient disk space for conda and packages

.ci/install-cudnn.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ EXTRACTED_DIR="cudnn-linux-${ARCH_PATH}-${CUDNN_VERSION}_cuda12-archive"
6464
if [ -d "$EXTRACTED_DIR" ]; then
6565
sudo cp -a "$EXTRACTED_DIR/include/"* "$CUDA_HOME/include/"
6666
sudo cp -a "$EXTRACTED_DIR/lib/"* "$CUDA_HOME/lib64/"
67-
67+
6868
# Set permissions using find to avoid globbing issues
6969
sudo find "$CUDA_HOME/include" -name "cudnn*.h" -exec chmod a+r {} \;
7070
sudo find "$CUDA_HOME/lib64" -name "libcudnn*" -exec chmod a+r {} \;
71-
71+
7272
echo "cuDNN installed successfully"
7373
else
7474
echo "ERROR: Extracted directory not found: $EXTRACTED_DIR"

.ci/install-project.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ echo "Verifying installation..."
3030
python -c "import tritonparse; print(f'tritonparse installed successfully')"
3131
python -c "import coverage; print(f'coverage version: {coverage.__version__}')"
3232

33-
echo "Project installation completed successfully!"
33+
echo "Project installation completed successfully!"

.ci/install-triton.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ if [ -z "$CONDA_ENV" ]; then
1313
exit 1
1414
fi
1515

16-
1716
# Activate conda environment
1817
source /opt/miniconda3/etc/profile.d/conda.sh
1918
conda activate "$CONDA_ENV"

.ci/run-tests.sh

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -31,70 +31,70 @@ conda activate "$CONDA_ENV"
3131

3232
# Build unittest command based on test type
3333
case "$TEST_TYPE" in
34-
"cpu")
35-
echo "Running CPU tests only..."
36-
if [ "$COVERAGE" = "true" ]; then
37-
echo "Running with coverage..."
38-
if [ "$VERBOSE" = "true" ]; then
39-
coverage run -m unittest tests.test_tritonparse.TestTritonparseCPU -v
40-
else
41-
coverage run -m unittest tests.test_tritonparse.TestTritonparseCPU
42-
fi
43-
coverage report
44-
coverage xml
34+
"cpu")
35+
echo "Running CPU tests only..."
36+
if [ "$COVERAGE" = "true" ]; then
37+
echo "Running with coverage..."
38+
if [ "$VERBOSE" = "true" ]; then
39+
coverage run -m unittest tests.test_tritonparse.TestTritonparseCPU -v
4540
else
46-
if [ "$VERBOSE" = "true" ]; then
47-
python -m unittest tests.test_tritonparse.TestTritonparseCPU -v
48-
else
49-
python -m unittest tests.test_tritonparse.TestTritonparseCPU
50-
fi
41+
coverage run -m unittest tests.test_tritonparse.TestTritonparseCPU
5142
fi
52-
;;
53-
"cuda")
54-
echo "Running CUDA tests only..."
55-
export CUDA_VISIBLE_DEVICES=0
56-
if [ "$COVERAGE" = "true" ]; then
57-
echo "Running with coverage..."
58-
if [ "$VERBOSE" = "true" ]; then
59-
coverage run -m unittest tests.test_tritonparse.TestTritonparseCUDA -v
60-
else
61-
coverage run -m unittest tests.test_tritonparse.TestTritonparseCUDA
62-
fi
63-
coverage report
64-
coverage xml
43+
coverage report
44+
coverage xml
45+
else
46+
if [ "$VERBOSE" = "true" ]; then
47+
python -m unittest tests.test_tritonparse.TestTritonparseCPU -v
6548
else
66-
if [ "$VERBOSE" = "true" ]; then
67-
python -m unittest tests.test_tritonparse.TestTritonparseCUDA -v
68-
else
69-
python -m unittest tests.test_tritonparse.TestTritonparseCUDA
70-
fi
49+
python -m unittest tests.test_tritonparse.TestTritonparseCPU
7150
fi
72-
;;
73-
"all")
74-
echo "Running all tests..."
75-
export CUDA_VISIBLE_DEVICES=0
76-
if [ "$COVERAGE" = "true" ]; then
77-
echo "Running with coverage..."
78-
if [ "$VERBOSE" = "true" ]; then
79-
coverage run -m unittest tests.test_tritonparse -v
80-
else
81-
coverage run -m unittest tests.test_tritonparse
82-
fi
83-
coverage report
84-
coverage xml
51+
fi
52+
;;
53+
"cuda")
54+
echo "Running CUDA tests only..."
55+
export CUDA_VISIBLE_DEVICES=0
56+
if [ "$COVERAGE" = "true" ]; then
57+
echo "Running with coverage..."
58+
if [ "$VERBOSE" = "true" ]; then
59+
coverage run -m unittest tests.test_tritonparse.TestTritonparseCUDA -v
8560
else
86-
if [ "$VERBOSE" = "true" ]; then
87-
python -m unittest tests.test_tritonparse -v
88-
else
89-
python -m unittest tests.test_tritonparse
90-
fi
61+
coverage run -m unittest tests.test_tritonparse.TestTritonparseCUDA
9162
fi
92-
;;
93-
*)
94-
echo "Unknown test type: $TEST_TYPE"
95-
echo "Available options: cpu, cuda, all"
96-
exit 1
97-
;;
63+
coverage report
64+
coverage xml
65+
else
66+
if [ "$VERBOSE" = "true" ]; then
67+
python -m unittest tests.test_tritonparse.TestTritonparseCUDA -v
68+
else
69+
python -m unittest tests.test_tritonparse.TestTritonparseCUDA
70+
fi
71+
fi
72+
;;
73+
"all")
74+
echo "Running all tests..."
75+
export CUDA_VISIBLE_DEVICES=0
76+
if [ "$COVERAGE" = "true" ]; then
77+
echo "Running with coverage..."
78+
if [ "$VERBOSE" = "true" ]; then
79+
coverage run -m unittest tests.test_tritonparse -v
80+
else
81+
coverage run -m unittest tests.test_tritonparse
82+
fi
83+
coverage report
84+
coverage xml
85+
else
86+
if [ "$VERBOSE" = "true" ]; then
87+
python -m unittest tests.test_tritonparse -v
88+
else
89+
python -m unittest tests.test_tritonparse
90+
fi
91+
fi
92+
;;
93+
*)
94+
echo "Unknown test type: $TEST_TYPE"
95+
echo "Available options: cpu, cuda, all"
96+
exit 1
97+
;;
9898
esac
9999

100-
echo "Tests completed successfully!"
100+
echo "Tests completed successfully!"

.ci/setup.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ sudo apt-get update
2323
echo "Setting up LLVM 17 APT source with modern GPG key handling..."
2424

2525
# Download and install GPG key to /usr/share/keyrings
26-
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | \
27-
gpg --dearmor | sudo tee /usr/share/keyrings/llvm-archive-keyring.gpg > /dev/null
26+
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key |
27+
gpg --dearmor | sudo tee /usr/share/keyrings/llvm-archive-keyring.gpg >/dev/null
2828

2929
# Make sure key file is readable by _apt
3030
sudo chmod a+r /usr/share/keyrings/llvm-archive-keyring.gpg
3131

3232
# Write APT source list, explicitly binding keyring file
33-
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" | \
34-
sudo tee /etc/apt/sources.list.d/llvm-toolchain-jammy-17.list
33+
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" |
34+
sudo tee /etc/apt/sources.list.d/llvm-toolchain-jammy-17.list
3535

3636
# Update package lists
3737
sudo apt-get update
@@ -54,7 +54,6 @@ echo "Verifying clang installation..."
5454
clang --version
5555
clangd --version
5656

57-
5857
# Install Miniconda if not already installed
5958
if [ ! -d "/opt/miniconda3" ]; then
6059
echo "Installing Miniconda..."

.github/workflows/test.yml

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
11
name: Tests
22

33
on:
4-
push:
5-
branches: [main, develop, findhao/setup_ci]
6-
pull_request:
7-
branches: [main]
8-
workflow_dispatch:
9-
inputs:
10-
test-type:
11-
description: "Type of tests to run"
12-
required: true
13-
default: "all"
14-
type: choice
15-
options:
16-
- "all"
17-
- "cpu"
18-
- "cuda"
19-
coverage:
20-
description: "Enable coverage reporting"
21-
required: true
22-
default: false
23-
type: boolean
4+
push:
5+
branches: [main, develop, findhao/setup_ci]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
inputs:
10+
test-type:
11+
description: "Type of tests to run"
12+
required: true
13+
default: "all"
14+
type: choice
15+
options:
16+
- "all"
17+
- "cpu"
18+
- "cuda"
19+
coverage:
20+
description: "Enable coverage reporting"
21+
required: true
22+
default: false
23+
type: boolean
2424

2525
jobs:
26-
test:
27-
runs-on: 4-core-ubuntu-gpu-t4
28-
timeout-minutes: 120
29-
steps:
30-
- uses: actions/checkout@v4
26+
test:
27+
runs-on: 4-core-ubuntu-gpu-t4
28+
timeout-minutes: 120
29+
steps:
30+
- uses: actions/checkout@v4
3131

32-
- name: Set up Python 3.11
33-
uses: actions/setup-python@v4
34-
with:
35-
python-version: "3.11"
32+
- name: Set up Python 3.11
33+
uses: actions/setup-python@v4
34+
with:
35+
python-version: "3.11"
3636

37-
- name: Setup environment
38-
env:
39-
CONDA_ENV: tritonparse
40-
PYTHON_VERSION: "3.11"
41-
CUDA_VERSION: "12.8"
42-
run: |
43-
bash .ci/setup.sh
37+
- name: Setup environment
38+
env:
39+
CONDA_ENV: tritonparse
40+
PYTHON_VERSION: "3.11"
41+
CUDA_VERSION: "12.8"
42+
run: |
43+
bash .ci/setup.sh
4444
45-
- name: Install Triton from source
46-
env:
47-
CONDA_ENV: tritonparse
48-
run: |
49-
bash .ci/install-triton.sh
45+
- name: Install Triton from source
46+
env:
47+
CONDA_ENV: tritonparse
48+
run: |
49+
bash .ci/install-triton.sh
5050
51-
- name: Install project dependencies
52-
env:
53-
CONDA_ENV: tritonparse
54-
run: |
55-
bash .ci/install-project.sh
51+
- name: Install project dependencies
52+
env:
53+
CONDA_ENV: tritonparse
54+
run: |
55+
bash .ci/install-project.sh
5656
57-
- name: Cache pip dependencies
58-
uses: actions/cache@v3
59-
with:
60-
path: ~/.cache/pip
61-
key: ${{ runner.os }}-pip-3.11-${{ hashFiles('**/pyproject.toml') }}
62-
restore-keys: |
63-
${{ runner.os }}-pip-3.11-
57+
- name: Cache pip dependencies
58+
uses: actions/cache@v3
59+
with:
60+
path: ~/.cache/pip
61+
key: ${{ runner.os }}-pip-3.11-${{ hashFiles('**/pyproject.toml') }}
62+
restore-keys: |
63+
${{ runner.os }}-pip-3.11-
6464
65-
- name: Run tests
66-
env:
67-
CONDA_ENV: tritonparse
68-
TEST_TYPE: ${{ github.event.inputs.test-type || 'all' }}
69-
COVERAGE: ${{ github.event.inputs.coverage || 'false' }}
70-
run: |
71-
bash .ci/run-tests.sh
65+
- name: Run tests
66+
env:
67+
CONDA_ENV: tritonparse
68+
TEST_TYPE: ${{ github.event.inputs.test-type || 'all' }}
69+
COVERAGE: ${{ github.event.inputs.coverage || 'false' }}
70+
run: |
71+
bash .ci/run-tests.sh

0 commit comments

Comments
 (0)