Skip to main content

pyg-lib

Docs Status Code Coverage Slack Contributing

Installation

We provide pre-built Python wheels for all major OS/PyTorch/CUDA combinations from Python 3.10 till 3.14, see here.

To install the wheels for CPU/CUDA backend, simply run

pip install pyg-lib -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html

where

  • ${TORCH} should be replaced by either 2.10.0, 2.11.0, or 2.12.0
  • ${CUDA} should be replaced by either cpu, cu126, cu128, cu130, or cu132

The following combinations are supported:

PyTorch 2.12 cpu cu126 cu128 cu130 cu132
Linux
Windows
macOS
PyTorch 2.11 cpu cu126 cu128 cu130
Linux
Windows
macOS
PyTorch 2.10 cpu cu126 cu128 cu130
Linux
Windows
macOS
PyTorch 2.9 cpu cu126 cu128 cu130
Linux
Windows
macOS

For ROCM backend, there is an external pyg-rocm-build repository provides wheels and detailed instructions on how to install PyG for ROCm. If you have any questions about it, please open an issue here.

Note: ROCM backend only support Linux up to now.

Build from source on a ROCm machine (Linux)

The following steps build and install pyg-lib with ROCm/HIP support from source. Ensure your ROCm installation includes hipblaslt, rocblas, rocprim, rocthrust, and composable_kernel.

  1. Install system build tools:
sudo apt update
sudo apt install -y build-essential python3-dev python3-pip cmake ninja-build
  1. Install Python build dependencies:
python3 -m pip install --upgrade pip setuptools wheel ninja
  1. Install a ROCm-enabled PyTorch build (matching your ROCm stack):
# Example:
# python3 -m pip install torch torchvision --index-url https://download.pytorch.org/whl/rocm6.3
  1. Configure environment variables:
export ROCM_PATH=/opt/rocm
export CMAKE_PREFIX_PATH="${ROCM_PATH};${ROCM_PATH}/lib/cmake"
export FORCE_ROCM=1
export FORCE_CUDA=0

# Set your GPU architecture, for example gfx90a/gfx942/gfx1100:
export PYTORCH_ROCM_ARCH="gfx1100;gfx950;gfx942;gfx90a;gfx908;gfx1201;gfx1101;gfx1030"
# Alternatively, you can use:
# export AMDGPU_TARGETS=gfx90a;gfx950;gfx942;gfx90a;gfx908;gfx1201;gfx1101;gfx1030
# If your hipcc does not recognize one of the targets, remove that target.

# Optional: disable CK grouped matmul path (enabled by default).
# export PYG_ROCM_MATMUL_USE_CK=0
# Optional: require CK path (fail fast if fallback would happen).
# export PYG_ROCM_MATMUL_REQUIRE_CK=1

grouped_matmul / segment_matmul behavior on ROCm:

  • Important: The CK backend in pyg-lib only provides native kernels for bf16 and fp16.
  • fp16 input: use CK FP16 grouped GEMM path.
  • bf16 input: use CK BF16 grouped GEMM path.
  • fp32 input: CK does not run native FP32 kernels. pyg-lib first converts to bf16 and tries CK BF16, then converts to fp16 and tries CK FP16.
  • Since fp32 uses reduced-precision conversion on the CK path, numerical differences at bf16/fp16 precision are expected.
  • PYG_ROCM_MATMUL_USE_CK=0: disable CK grouped matmul and use ATen matmul.
  • PYG_ROCM_MATMUL_REQUIRE_CK=1: strict mode. If no CK path is accepted, an error is raised instead of falling back.
  • Without strict mode, unsupported CK shapes/targets fall back to at::mm_out with a warning that includes the reason.
  • On architectures without CK XDL support for the selected path (for example some gfx10 targets), fallback warnings are expected.
  1. Build and install:
python3 -m pip install -v .

For editable/development install:

python3 -m pip install -v -e .

Optional check:

python3 -c "import torch; print(torch.version.hip)"

From nightly

Nightly wheels are provided for Linux from Python 3.10 till 3.14:

pip install pyg-lib -f https://data.pyg.org/whl/nightly/torch-${TORCH}+${CUDA}.html

From master

pip install ninja wheel
pip install --no-build-isolation git+https://github.com/pyg-team/pyg-lib.git

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyg_lib_rocm-0.8.0.post1-cp314-cp314-manylinux_2_32_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.32+ x86-64

pyg_lib_rocm-0.8.0.post1-cp313-cp313-manylinux_2_32_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.32+ x86-64

pyg_lib_rocm-0.8.0.post1-cp312-cp312-manylinux_2_32_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.32+ x86-64

pyg_lib_rocm-0.8.0.post1-cp311-cp311-manylinux_2_32_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.32+ x86-64

pyg_lib_rocm-0.8.0.post1-cp310-cp310-manylinux_2_32_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.32+ x86-64

File details

Details for the file pyg_lib_rocm-0.8.0.post1-cp314-cp314-manylinux_2_32_x86_64.whl.

File metadata

File hashes

Hashes for pyg_lib_rocm-0.8.0.post1-cp314-cp314-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 534af09eed7f8f7100a371fd7139201e9b6d18daccbd605068dd42e515b4f158
MD5 c6093937c9249a5b8d165c025f102a68
BLAKE2b-256 59d0fa3a5b15e85cddf7489f3d020c34703a3380901329b7c0cf8491c817444a

See more details on using hashes here.

File details

Details for the file pyg_lib_rocm-0.8.0.post1-cp313-cp313-manylinux_2_32_x86_64.whl.

File metadata

File hashes

Hashes for pyg_lib_rocm-0.8.0.post1-cp313-cp313-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 28aac461659dde0bee52ce4db10f1bfcc726936233ee2d9e5ba401414b21c5af
MD5 e1971deef08a4eb4d07d2c904ada89fe
BLAKE2b-256 e8a3d1df977a3a6b77adf315a74e5f124b88deec438693788107544efe5de9a3

See more details on using hashes here.

File details

Details for the file pyg_lib_rocm-0.8.0.post1-cp312-cp312-manylinux_2_32_x86_64.whl.

File metadata

File hashes

Hashes for pyg_lib_rocm-0.8.0.post1-cp312-cp312-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 3aa0073800d445c6c17c07b1c468cd2f6a8903f39d22ca70ad78b84ae8ec3ed6
MD5 b34ea264bd6c24f510689a7366ff15c7
BLAKE2b-256 d0871c1e444cb144e2023dad30cf3e2d2f9aba29d343763f697a6ad0303c9bb1

See more details on using hashes here.

File details

Details for the file pyg_lib_rocm-0.8.0.post1-cp311-cp311-manylinux_2_32_x86_64.whl.

File metadata

File hashes

Hashes for pyg_lib_rocm-0.8.0.post1-cp311-cp311-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 a37050c63367f6dfe2ac87ff22a5fbe840daf73ead54d2e853b016109c6fa3a1
MD5 d00a9cc6d09eef845adc6a8cd24e7f21
BLAKE2b-256 c99b47775f38243a91e7341f952c397499ba53ffc32513e436aea496f2daf4e6

See more details on using hashes here.

File details

Details for the file pyg_lib_rocm-0.8.0.post1-cp310-cp310-manylinux_2_32_x86_64.whl.

File metadata

File hashes

Hashes for pyg_lib_rocm-0.8.0.post1-cp310-cp310-manylinux_2_32_x86_64.whl
Algorithm Hash digest
SHA256 28c1f81cdf6bcfa526b57f27be724847603e6165247d173f718e6a965d89b8d1
MD5 2b8243e01fe9e9ab3842c181e3609db2
BLAKE2b-256 d29170e6b55d7f0d5a794d9a9ec84a6bf823802629a2dfb21d99ae5033deacc5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.8.0.post1 This release

5 files

0.8.0

5 files

0.6.0.post2

5 files

0.6.0.post1

5 files

0.6.0

5 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page