pyg-lib 0.4.0: PyTorch 2.2 support, distributed sampling, sparse softmax, edge-level temporal sampling
Latestpyg-lib==0.4.0
brings PyTorch 2.2 support, distributed neighbor sampling, accelerated softmax operations, and edge-level temporal sampling support to PyG πππ
Highlights
PyTorch 2.2 Support
pyg-lib==0.4.0
is fully compatible with PyTorch 2.2 (#294). To install for PyTorch 2.2, simply run
pip install pyg-lib -f https://data.pyg.org/whl/torch-2.2.0+${CUDA}.html
where ${CUDA}
should be replaced by either cpu
, cu118
or cu121
The following combinations are supported:
PyTorch 2.2 | cpu |
cu118 |
cu121 |
---|---|---|---|
Linux | β | β | β |
macOS | β |
Older PyTorch versions like PyTorch 1.12, 1.13, 2.0.0 and 2.1.0 are still supported, and can be installed as described in our README.md
.
Distributed Sampling
pyg-lib==0.4.0
integrates all the low-level code for performing distributed neighbor sampling as part of torch_geometric.distributed
in PyG 2.5 (#246, #252, #253, #254).
Sparse Softmax Implementation
pyg-lib==0.4.0
supports a fast sparse softmax_csr
implementation based on CSR input representation (#264, #282):
from pyg_lib.ops import softmax_csr
src = torch.randn(4, 4)
ptr = torch.tensor([0, 4])
out = softmax_csr(src, ptr)
Edge-level Temporal Sampling
pyg-lib==0.4.0
brings edge-level temporal sampling support to PyG (#280). In particular, neighbor_sample
and hetero_neighbor_sample
now support the edge_time
attribute, which will only samples edges in case they have a lower or equal timestamp than their corresponding seed_time
.
Additional Features
- Added support for
bfloat16
data type insegment_matmul
andgrouped_matmul
on CPU (#272) - Improved the runtime of biased sampling in
neighbor_sample
andhetero_neighbor_sample
(#270)
Bugfixes
- Dropped the MKL code path in
neighbor_sample
andhetero_neighbor_sample
withreplace=False
since it did not correctly prevent duplicates (#275) - Fixed
grouped_matmul
in case input tensors are not contiguous (#290)
New Contributors
Full Changelog: 0.3.0...0.4.0