github pyg-team/pytorch_geometric 2.6.0
PyG 2.6.0

5 days ago

We are excited to announce the release of PyG 2.6 🎉🎉🎉

  • Highlights
  • Breaking Changes
  • Features
  • Bugfixes
  • Changes
  • Full Changelog

PyG 2.6 is the culmination of work from 59 contributors who have worked on features and bug-fixes for a total of over 238 commits since torch-geometric==2.5.0.

Highlights

PyTorch 2.4 Support

PyG 2.6 is fully compatible with PyTorch 2.4, and supports the following combinations:

PyTorch 2.2 cpu cu118 cu121 cu124
Linux
macOS
Windows

You can still install PyG 2.6 with an older PyTorch release up to PyTorch 1.13 in case you are not eager to update your PyTorch version.

GNNs+LLMs

In order to facilitate further research on combining GNNs with LLMs, PyG 2.6 introduces

Index Tensor Representation

Similar to the EdgeIndex class introduced in PyG 2.5, torch-geometric==2.6.0 introduces the Index class for efficient storage of 1D indices. While Index sub-classes a general torch.Tensor, it can hold additional (meta)data, i.e.:

  • dim_size: The size of the underlying sparse vector, i.e. the size of a dimension that can be indexed via Index. By default, it is inferred as dim_size=index.max() + 1
  • is_sorted: Whether indices are sorted in ascending order.

Additionally, Index caches data via indptr for fast CSR conversion in case its representation is sorted. Caches are filled based on demand (e.g., when calling Index.get_indptr() or when explicitly requested via Index.fill_cache_(), and are maintained and adjusted over its lifespan.

 from torch_geometric import Index

index = Index([0, 1, 1, 2], dim_size=3, is_sorted=True)
assert index.dim_size == 3
assert index.is_sorted

# Flipping order:
index.flip(0)
assert not index.is_sorted

# Filtering:
mask = torch.tensor([True, True, True, False])
index[:, mask]
assert index.is_sorted

EdgeIndex and Index will interact seamlessly together, e.g., edge_index[0] will now return a Index instance.
This ensures optimal computation in GNN message passing schemes, while preserving the ease-of-use of regular COO-based PyG workflows. EdgeIndex and Index will fully deprecate the usage of SparseTensor from torch-sparse in later releases, leaving us with just a single source of truth for representing graph structure information in PyG.

Breaking Changes

Features

Examples

  • Added a multi-GPU example for training GNNs on the PCQM4M graph-level regression task (#9070)
  • Added a multi-GPU ogbn-mag240m example (#8249)
  • Added support for cugraph data loading capabilities in the papers100m examples (#8173)
  • Improved the hyper-parameters of the [single-node](ogbn-papers100m example](https://github.com/pyg-team/pytorch_geometric/blob/master/examples/ogbn_papers_100m.py) and [multi-node](https://github.com/pyg-team/pytorch_geometric/blob/master/examples/multi_gpu/papers100m_gcn_cugraph_multinode.py) ogbn-papers100m examples, and added evaluation on all ranks (#8823, #9386, #9445)

EdgeIndex and Index

torch_geometric.nn

torch_geometric.metrics

torch_geometric.transforms

torch_geometric.utils

torch_geometric.datasets

torch_geometric.loader

  • Added support for negative sampling in LinkLoader acccording to source and destination node weights (#9316)

Bugfixes

Changes

New Contributors

Full Changelog: 2.5.0...2.6.0

Don't miss a new pytorch_geometric release

NewReleases is sending notifications on new releases.