Efficient and Modular ML on Temporal Graphs
Project description
About The Project
TGM is a research library designed to accelerate training workloads over dynamic graphs and facilitate prototyping of temporal graph learning methods.
Our main goal is to provide an efficient abstraction over dynamic graphs to enable new practitioners to quickly contribute to research in the field. We natively support both discrete and continuous-time graphs.
[!NOTE] TGM is still alpha software, and may introduce breaking changes.
Library Highlights
- :zap: It's not that fast yet but it will be soon :)
- :hourglass_flowing_sand: First library to support both discrete and continuous-time graphs
- :wrench: Built-in support for TGB datasets, MRR-based link prediction, and Node Property Prediction
- :sparkles: Modular, intuitive API for rapid model prototyping
- :atom: Efficient dataloading with edge and time-based batching
- :heavy_check_mark: Validated implementations of popular TG methods
Supported Methods
We aim to support the following temporal graph learning methods. If you want us to prioritize a new method, please open an issue and feel free to discuss them with us.
- :white_check_mark: EdgeBank
- :white_check_mark: GCN
- :white_check_mark: GC-LSTM
- :white_check_mark: GraphMixer
- :white_check_mark: TGAT
- :white_check_mark: TGN
- :white_large_square: DygFormer
- :white_large_square: TNCN
- :white_large_square: DyGMamba
- :white_large_square: NLB
- :white_large_square: NAT
Performance Benchmarks
Work in progress.
Installation
The current recommended way to install TGM is from source.
Using uv (recommended)
# Create and activate your venv
uv venv my_venv --python 3.10 && source my_venv/bin/activate
# Install the wheels into the venv
uv pip install git+https://github.com/tgm-team/tgm.git
# Test the install
python -c 'import tgm; print(tgm.__version__)'
Using pip
# Create and activate your venv
python3.10 -m venv my_venv && source my_venv/bin/activate
# Install the wheels into the venv
pip install git+https://github.com/tgm-team/tgm.git
# Test the install
python -c 'import tgm; print(tgm.__version__)'
These steps should work on Linux systems. We have not officially tested on other platforms, so expect additional work may be required. If you encounter issues on your system, please open an issue and feel free to discuss them with us.
Windows
To enable GPU on non-linux platforms, you will need to manually install the appropriate torch wheels for your drivers. For instance, for cuda:12.4, follow the steps above and then issue:
uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
Quick Tour for New Users
Running Pre-packaged Examples
Start by syncing additional dependencies in our example scripts:
uv sync --group examples
For this example, we'll run TGAT dynamic link-prediction on tgbl-wiki. We'll use standard parameters on run on GPU. We show some explicit arguments for clarity:
python examples/linkproppred/tgat.py \
--dataset tgbl-wiki \
--bsize 200 \
--device cuda \
--epochs 1 \
--n-nbrs 20 20 \
--sampling recency
[!TIP] Refer to our our docs for more information and TG example recipes.
Creating a new model
Work in progress.
Documentation
Documentation along with a quick start guide can be found on the docs website.
Citation
Please cite our paper if your use this code in your own work:
@article{TODO,
title = "TODO",
author = "TODO"
journal = "TODO",
url = "TODO"
year = "2025",
}
Contributing
If you notice anything unexpected, or would like to propose a new feature, please open an issue and feel free to discuss them with us.
To learn more about making a contribution to TGM see our contribution guide.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tgm_lib-0.1.0a0.tar.gz.
File metadata
- Download URL: tgm_lib-0.1.0a0.tar.gz
- Upload date:
- Size: 28.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c47940950578bdeb0f50e639ab986e4ac3147a0b31ddda8a0afe41afd0d654e
|
|
| MD5 |
721274805aea756177d3a5a330da2715
|
|
| BLAKE2b-256 |
8a69992e7fcf616359ff9a08dd026cd1cc0efb9a3af2ffa2db4b41203fa7f25d
|
Provenance
The following attestation bundles were made for tgm_lib-0.1.0a0.tar.gz:
Publisher:
publish.yml on tgm-team/tgm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tgm_lib-0.1.0a0.tar.gz -
Subject digest:
3c47940950578bdeb0f50e639ab986e4ac3147a0b31ddda8a0afe41afd0d654e - Sigstore transparency entry: 265533955
- Sigstore integration time:
-
Permalink:
tgm-team/tgm@487404a4e56113ede924465a1db5819e45044672 -
Branch / Tag:
refs/tags/v0.1.0a0 - Owner: https://github.com/tgm-team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@487404a4e56113ede924465a1db5819e45044672 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tgm_lib-0.1.0a0-py3-none-any.whl.
File metadata
- Download URL: tgm_lib-0.1.0a0-py3-none-any.whl
- Upload date:
- Size: 31.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78e1438c8456cc69b0e9f96592bd8a3d3551ee357f72d799d8b5599182796495
|
|
| MD5 |
466da91180019886d32575985d8adc85
|
|
| BLAKE2b-256 |
8121de4c0951cbba8e20e4b2b85390da83e2ede020615a432347ce04202aea29
|
Provenance
The following attestation bundles were made for tgm_lib-0.1.0a0-py3-none-any.whl:
Publisher:
publish.yml on tgm-team/tgm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tgm_lib-0.1.0a0-py3-none-any.whl -
Subject digest:
78e1438c8456cc69b0e9f96592bd8a3d3551ee357f72d799d8b5599182796495 - Sigstore transparency entry: 265533961
- Sigstore integration time:
-
Permalink:
tgm-team/tgm@487404a4e56113ede924465a1db5819e45044672 -
Branch / Tag:
refs/tags/v0.1.0a0 - Owner: https://github.com/tgm-team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@487404a4e56113ede924465a1db5819e45044672 -
Trigger Event:
push
-
Statement type: