Download Latest Version PyG 2.7.0 source code.tar.gz (4.2 MB)
Email in envelope

Get an email when there's a new version of PyTorch Geometric

Home / 2.6.0
Name Modified Size InfoDownloads / Week
Parent folder
PyG 2.6.0 source code.tar.gz 2024-09-13 3.9 MB
PyG 2.6.0 source code.zip 2024-09-13 4.7 MB
README.md 2024-09-13 21.2 kB
Totals: 3 Items   8.6 MB 0

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

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.

:::python
 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

  • Fixed VirtualNode transform for empty edge indices (#9605)
  • Fixed an issue where the import order in the multi-GPU cugraph example could cause an rmm error (#9577)
  • Fixed load_state_dict behavior with lazy parameters in HeteroDictLinear (#9493)
  • Sequential modules can now be properly pickled (#9369)
  • Fixed pickle.load for jittable MessagePassing modules (#9368)
  • Fixed batching of sparse tensors saved via data.edge_index (#9317)
  • Fixed arbitrary keyword ordering in MessagePassing.propagate() (#9245)
  • Fixed the node mapping in the RCDD dataset (#9234)
  • Fixed incorrect treatment of edge_label and edge_label_index in ToSparseTensor transform (#9199)
  • Fixed EgoData processing in SnapDataset in case filenames are unsorted (#9195)
  • Fixed empty graph and isolated node handling in to_dgl() function (#9188)
  • Fixed bug in to_scipy_sparse_matrix() when CUDA is set as default torch device (#9146)
  • Fixed the MetaPath2Vec model in case the last node is isolated (#9145)
  • Ensured backward compatibility in MessagePassing via torch.load() (#9105)
  • Prevented model compilation on custom MessagePassing.propagate() functions (#9079)
  • Ignore self.propagate appearances in comments when parsing MessagePassing implementation (#9044)
  • Fixed OSError on read-only file systems within MessagePassing (#9032)
  • Fixed metaclass conflict in Dataset (#8999)
  • Fixed import errors on MessagePassing modules with nested inheritance (#8973)
  • Fixed TorchScript compilation error for MessagePassing._check_input() on older torch versions (#9564)

Changes

New Contributors

Full Changelog: https://github.com/pyg-team/pytorch_geometric/compare/2.5.0...2.6.0

Source: README.md, updated 2024-09-13