Skip to content

Commit

Permalink
Merge branch 'build_pyg_231' of github.com:pyg-team/pytorch_geometric…
Browse files Browse the repository at this point in the history
… into build_pyg_231
  • Loading branch information
rusty1s committed Aug 2, 2023
2 parents 5534bf4 + 45243c1 commit 136481f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 66 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added the `FilterEdges` graph coarsening operator ([#7361](https://github.com/pyg-team/pytorch_geometric/pull/7361))
- Added the `DirGNN` model for learning on directed graphs ([#7458](https://github.com/pyg-team/pytorch_geometric/pull/7458))
- Allow GPU tensors as input to `NodeLoader` and `LinkLoader` ([#7572](https://github.com/pyg-team/pytorch_geometric/pull/7572))
- Added an `embedding_device` option to allow for GPU inference in `BasicGNN` ([#7548](https://github.com/pyg-team/pytorch_geometric/pull/7548))
- Added an `embedding_device` option to allow for GPU inference in `BasicGNN` ([#7548](https://github.com/pyg-team/pytorch_geometric/pull/7548), [#7829](https://github.com/pyg-team/pytorch_geometric/pull/7829))
- Added `Performer` to `GPSConv` and remove `attn_dropout` argument from `GPSConv` ([#7465](https://github.com/pyg-team/pytorch_geometric/pull/7465))
- Enabled `LinkNeighborLoader` to return number of sampled nodes and edges per hop ([#7516](https://github.com/pyg-team/pytorch_geometric/pull/7516))
- Added the `HM` personalized fashion recommendation dataset ([#7515](https://github.com/pyg-team/pytorch_geometric/pull/7515))
Expand All @@ -46,7 +46,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `PrefetchLoader` capabilities ([#7376](https://github.com/pyg-team/pytorch_geometric/pull/7376), [#7378](https://github.com/pyg-team/pytorch_geometric/pull/7378), [#7383](https://github.com/pyg-team/pytorch_geometric/pull/7383))
- Added an example for hierarchical sampling ([#7244](https://github.com/pyg-team/pytorch_geometric/pull/7244))
- Added Kùzu remote backend examples ([#7298](https://github.com/pyg-team/pytorch_geometric/pull/7298))
- Fixed tracing of `add_self_loops` for a dynamic number of nodes ([#7330](https://github.com/pyg-team/pytorch_geometric/pull/7330))
- Added an optional `add_pad_mask` argument to the `Pad` transform ([#7339](https://github.com/pyg-team/pytorch_geometric/pull/7339))
- Added `keep_inter_cluster_edges` option to `ClusterData` to support inter-subgraph edge connections when doing graph partitioning ([#7326](https://github.com/pyg-team/pytorch_geometric/pull/7326))
- Unify graph pooling framework ([#7308](https://github.com/pyg-team/pytorch_geometric/pull/7308), [#7625](https://github.com/pyg-team/pytorch_geometric/pull/7625))
Expand Down Expand Up @@ -78,6 +77,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Changed

- Fixed tracing of `add_self_loops` for a dynamic number of nodes ([#7330](https://github.com/pyg-team/pytorch_geometric/pull/7330))
- Fixed device issue in `PNAConv.get_degree_histogram` ([#7830](https://github.com/pyg-team/pytorch_geometric/pull/7830))
- Fixed the shape of `edge_label_time` when using temporal sampling on homogeneous graphs ([#7807](https://github.com/pyg-team/pytorch_geometric/pull/7807))
- Made `FieldStatus` enum picklable to avoid `PicklingError` in a multi-process setting ([#7808](https://github.com/pyg-team/pytorch_geometric/pull/7808))
- Fixed `edge_label_index` computation in `LinkNeighborLoader` for the homogeneous+`disjoint` mode ([#7791](https://github.com/pyg-team/pytorch_geometric/pull/7791))
Expand Down
14 changes: 12 additions & 2 deletions benchmark/inference/inference_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,19 @@ def run(args: argparse.ArgumentParser):
data = transformation(data)

with cpu_affinity, amp, timeit() as time:
inference_kwargs = {}
if args.reuse_device_for_embeddings and not hetero:
inference_kwargs['embedding_device'] = device
for _ in range(args.warmup):
if args.full_batch:
full_batch_inference(model, data)
else:
model.inference(subgraph_loader, device,
progress_bar=True)
model.inference(
subgraph_loader,
device,
progress_bar=True,
**inference_kwargs,
)
if args.warmup > 0:
time.reset()
with itt, profile:
Expand All @@ -232,6 +239,7 @@ def run(args: argparse.ArgumentParser):
subgraph_loader,
device,
progress_bar=True,
**inference_kwargs,
)
if args.evaluate:
test_acc = test(
Expand Down Expand Up @@ -287,6 +295,8 @@ def run(args: argparse.ArgumentParser):

add('--device', choices=['cpu', 'cuda', 'xpu'], default='cpu',
help='Device to run benchmark on')
add('--reuse-device-for-embeddings', action='store_true',
help='Use the same device for embeddings as specified in "--device"')
add('--datasets', nargs='+',
default=['ogbn-mag', 'ogbn-products', 'Reddit'], type=str)
add('--use-sparse-tensor', action='store_true',
Expand Down
Binary file added docs/source/_static/thumbnails/create_gnn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 136481f

Please sign in to comment.