Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
31030d2
update
akihironitta May 25, 2025
dd957fc
update
akihironitta May 25, 2025
db66306
update
akihironitta May 25, 2025
1ce880c
update
akihironitta Jun 7, 2025
f691f57
update
akihironitta Jun 8, 2025
8ee205e
Merge branch 'master' into aki/python
akihironitta Jun 8, 2025
f18d5c3
update
akihironitta Jun 8, 2025
cad08be
update
akihironitta Jun 8, 2025
4e9606a
no py dev
akihironitta Jun 9, 2025
1c08f17
update
akihironitta Jun 9, 2025
ad6935a
empty
akihironitta Jun 9, 2025
606f6bd
update
akihironitta Jun 9, 2025
efa6fd6
update
akihironitta Jun 9, 2025
2c814ab
update
akihironitta Jun 9, 2025
e0f58bd
update
akihironitta Jun 9, 2025
df70196
update
akihironitta Jun 9, 2025
9534a9d
update
akihironitta Jun 9, 2025
fbf7739
update
akihironitta Jun 9, 2025
fe05a87
update
akihironitta Jun 9, 2025
76c6d2d
update
akihironitta Jun 9, 2025
a169720
update
akihironitta Jun 9, 2025
2208fb9
update
akihironitta Jun 9, 2025
7d4f9e4
update
akihironitta Jun 9, 2025
3dba12c
update
akihironitta Jun 9, 2025
6799d8b
update
akihironitta Jun 9, 2025
60f9864
update
akihironitta Jun 9, 2025
f7ac62a
update
akihironitta Jun 9, 2025
56f9e23
update
akihironitta Jun 9, 2025
a0659ef
update
akihironitta Jun 9, 2025
e028473
update
akihironitta Jun 9, 2025
e28d634
update
akihironitta Jun 9, 2025
22c320a
Update CMakeLists.txt
akihironitta Jun 9, 2025
ecf1384
Merge branch 'aki/python' into aki/ci-manylinux
akihironitta Jun 9, 2025
206cd31
update
akihironitta Jun 9, 2025
0392efa
Merge branch 'master' into aki/ci-manylinux
akihironitta Jun 16, 2025
0f7d890
update
akihironitta Jun 16, 2025
9de4de2
empty
akihironitta Jun 16, 2025
77cd931
Update pyproject.toml
akihironitta Jun 18, 2025
f76bcb7
Merge branch 'master' into aki/ci-manylinux
akihironitta Jul 27, 2025
d975e09
trim old cuda builds
akihironitta Jul 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 47 additions & 26 deletions .github/workflows/_build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,71 @@ on: # yamllint disable-line rule:truthy
test-matrix:
type: string
required: true
docker-hub-username:
type: string
required: true
secrets:
docker-hub-token:
required: true
aws-access-key-id:
required: true
aws-secret-access-key:
required: true

defaults:
run:
shell: bash

jobs:
wheel:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(inputs.test-matrix) }}

steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ inputs.docker-hub-username }}
password: ${{ secrets.docker-hub-token }}

- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.aws-access-key-id }}
aws-secret-access-key: ${{ secrets.aws-secret-access-key }}
aws-region: us-west-1

- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
uses: ./.github/actions/setup
- name: Free up disk space
# Disk space required for CPU builds is usually small enough, so we
# save a few minutes by skipping this step.
if: ${{ matrix.cuda-version != 'cpu' }}
uses: jlumbroso/[email protected]
with:
python-version: ${{ matrix.python-version }}
torch-version: ${{ matrix.torch-version }}
cuda-version: ${{ matrix.cuda-version }}
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
tool-cache: true

- name: Set up Python
uses: actions/setup-python@v5
with:
# NOTE: This is a version used for cibuildwheel but not for wheels.
python-version: 3.11

- name: Install dependencies
run: |
pip install cibuildwheel auditwheel

- name: Set version
run: |
Expand All @@ -43,23 +83,4 @@ jobs:

- name: Build wheel
run: |
source ./.github/workflows/cuda/Linux-env.sh ${{ matrix.cuda-version }}
echo $TORCH_CUDA_ARCH_LIST
pip install build
python -m build --wheel --no-isolation --outdir dist

- name: Install wheel
run: |
cd dist
ls -lah
pip install *.whl
python -c "import pyg_lib; print('pyg-lib:', pyg_lib.__version__)"
python -c "import pyg_lib; print('CUDA:', pyg_lib.cuda_version())"
python -c "import pyg_lib.ops"
python -c "import pyg_lib.sampler"
cd ..

- name: Test wheel
run: |
pip install pytest pytest-cov
pytest --cov --cov-report=xml
bash ./.github/workflows/utils/build_linux.sh ${{ matrix.cuda-version }} ${{ matrix.python-version }} ${{ matrix.torch-version }}
5 changes: 5 additions & 0 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ jobs:
uses: ./.github/workflows/_build_linux.yml
with:
test-matrix: ${{ needs.trigger.outputs.matrix-linux }}
docker-hub-username: ${{ vars.DOCKERHUB_USERNAME }}
secrets:
docker-hub-token: ${{ secrets.DOCKERHUB_TOKEN }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

macos:
needs: [trigger]
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/utils/build_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
set -ex

CUDA_VERSION="${1:?Specify cuda version, e.g. cpu, cu128}"
PYTHON_VERSION="${2:?Specify python version, e.g. 3.12}"
TORCH_VERSION="${3:?Specify torch version, e.g. 2.7.0}"
echo "CUDA_VERSION: ${CUDA_VERSION}"
echo "PYTHON_VERSION: ${PYTHON_VERSION//./}"
echo "TORCH_VERSION: ${TORCH_VERSION}"

source ./.github/workflows/cuda/Linux-env.sh ${CUDA_VERSION}
echo "FORCE_CUDA: ${FORCE_CUDA}"
echo "TORCH_CUDA_ARCH_LIST: ${TORCH_CUDA_ARCH_LIST}"

export CIBW_BUILD="cp${PYTHON_VERSION//./}-manylinux_x86_64"
export CIBW_BEFORE_BUILD="pip install ninja wheel setuptools && pip install torch==${TORCH_VERSION} --index-url https://download.pytorch.org/whl/${CUDA_VERSION}"
# pyg-lib doesn't have torch as a dependency, so we need to explicitly install it when running tests.
export CIBW_BEFORE_TEST="pip install pytest && pip install torch==${TORCH_VERSION} --index-url https://download.pytorch.org/whl/${CUDA_VERSION}"

if [[ "${CUDA_VERSION}" == "cu"* ]]; then
# Use CUDA-pre-installed image
export CIBW_MANYLINUX_X86_64_IMAGE=akihironitta/manylinux:${CUDA_VERSION}
else
export CIBW_MANYLINUX_X86_64_IMAGE=quay.io/pypa/manylinux_2_28_x86_64
fi

rm -rf Testing libpyg.so build dist outputs # for local testing
python -m cibuildwheel --output-dir dist
ls -ahl dist/
python -m auditwheel show dist/*.whl

unzip dist/*.whl -d debug/
ldd debug/libpyg.so
readelf -d debug/libpyg.so
12 changes: 6 additions & 6 deletions .github/workflows/utils/full_matrix_linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@
{
"torch-version": "2.4.0",
"python-version": ["3.9", "3.10", "3.11", "3.12"],
"cuda-version": ["cpu", "cu118", "cu121", "cu124"]
"cuda-version": ["cpu"]
},
{
"torch-version": "2.3.0",
"python-version": ["3.9", "3.10", "3.11", "3.12"],
"cuda-version": ["cpu", "cu118", "cu121"]
"cuda-version": ["cpu"]
},
{
"torch-version": "2.2.0",
"python-version": ["3.9", "3.10", "3.11"],
"cuda-version": ["cpu", "cu118", "cu121"]
"cuda-version": ["cpu"]
},
{
"torch-version": "2.1.0",
"python-version": ["3.9", "3.10", "3.11"],
"cuda-version": ["cpu", "cu118", "cu121"]
"cuda-version": ["cpu"]
},
{
"torch-version": "2.0.0",
"python-version": ["3.9", "3.10", "3.11"],
"cuda-version": ["cpu", "cu117", "cu118"]
"cuda-version": ["cpu"]
},
{
"torch-version": "1.13.0",
"python-version": ["3.9", "3.10", "3.11"],
"cuda-version": ["cpu", "cu116", "cu117"]
"cuda-version": ["cpu"]
}
]
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@ documentation="https://pyg-lib.readthedocs.io"
repository="https://github.com/pyg-team/pyg-lib.git"
changelog="https://github.com/pyg-team/pyg-lib/blob/master/CHANGELOG.md"

[tool.cibuildwheel]
build-frontend = {name = "build", args = ["--no-isolation"] }
test-command = "pytest {project}/test"

[tool.cibuildwheel.linux]
environment-pass = [
"FORCE_NINJA",
"FORCE_CUDA",
"CUDA_HOME",
"TORCH_CUDA_ARCH_LIST",
]
repair-wheel-command = """
auditwheel repair \
--wheel-dir {dest_dir} {wheel} \
--exclude 'libtorch*.so' \
--exclude 'libc10*.so' \
--exclude 'libgomp*.so*' \
--exclude 'libcuda.so*'
"""

[tool.pytest.ini_options]
addopts=[
"--capture=no",
Expand Down
Loading