Library / SDK
BUPT-GAMMA/OpenHGNN avatar
BUPT-GAMMA/OpenHGNN

OpenHGNN: one entry point for 83 heterogeneous graph models

This is an open-source toolkit for Heterogeneous Graph Neural Network(OpenHGNN) based on DGL.

985 stars170 forksPythonApache-2.0

At a glance

What is it?
OpenHGNN is a Python toolkit for heterogeneous graph neural networks built on DGL and PyTorch, with a registry of 83 model names, 17 task and flow entries, and a CLI that inspects what is installed and registered. It suits a researcher who wants to compare models on the same dataset rather than reimplement each one, and its pins on DGL and PyTorch versions are narrow.
Who is it for?
Adopt OpenHGNN when you are comparing heterogeneous graph models on a shared dataset, because the registry and the common task interface mean a model swap is a name change rather than a rewrite, and the model reproduction guide makes the comparison honest.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 109 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A registry instead of a model zoo

OpenHGNN is an open source toolkit for heterogeneous graph neural networks based on DGL, the Deep Graph Library, and PyTorch, and it integrates state of the art models of heterogeneous graphs.

The design is a registry rather than a collection of scripts, and the current statistics make the scale concrete. There are 83 registered model names and 17 registered task and flow entries, and version 0.9 adds 10 model contributions, where HERO and HERO_homo are two registered names for one contribution.

The point of a registry is that a model is registered rather than imported by path, so running one is a matter of naming it. The same applies to tasks, which are the units of work such as node classification, and to datasets. The four key features spell out the intent: easy-to-use interfaces for running experiments with the given models and datasets, extensibility so a user can define a customised task, model or dataset, efficiency because the DGL backend provides efficient APIs, and discoverability, since CLI commands can inspect the environment, the registered models, the registered tasks and the datasets.

That last one is the feature a research tool earns its keep with. When a result does not reproduce, the first question is usually which version of which model ran, and a registry where the model list is queryable from the command line answers that without a spreadsheet.

The project is Apache-2.0 licensed, developed by BUPT-GAMMA LAB, and the last push to the main branch was on 2026-07-07. The README names v0.9.0 as the latest version, released on 2026-06-26, and the last tagged release in the release history is v0.7.0 from 2024.

What version 0.9 added, and what the earlier releases built up

The News section is a running list of what each release added, and reading it backwards tells you what the toolkit is for.

Version 0.9, released on 2026-06-26, added the 10 model contributions listed as HGDL, HGEN, HGSketch, HGOT, RMR, HERO and HERO_homo, SEHTGNN, HTGformer, HCMGNN and RelGT. It also added the node_regression task for continuous node-label prediction, updated the documentation entry points, and strengthened the model contribution standards around DGL implementation, trainerflow, dataset, README and smoke-test requirements.

The last of those is the one worth noting. A model contribution now has to come with a smoke test, which is the difference between a repository of code that runs and a repository of code that is known to run.

Version 0.7, from 2024-07-23, added new models and datasets, the Graph Prompt pipeline, a data process frame of dgl.graphBolt, a new GNN aggregator of dgl.sparse, and distributed training.

Version 0.5, from 2023-07-17, added four new tasks, pretrain, recommendation, graph attacks and defenses, and abnorm_event detection, plus TensorBoard visualisation and a maintenance and test module.

Version 0.4, from 2023-01-13, added more models supporting mini-batch training and a benchmark for million-scale graphs. Version 0.3, from 2022-06-27, added the API usage, customisation of user-defined datasets and models, and visualisation tools of heterogeneous graphs. Version 0.2, from 2022-02-28, added the Space4HGNN project and the benchmark and leaderboard.

The tool is a paper at CIKM 2022, the Open Source Toolkit for Heterogeneous Graph Neural Network, accepted in the short paper track, with a Chinese version on the OpenI community and a Slack channel for discussion.

Installing it, and the DGL wheel that needs a special index

The requirements are specific and the README gives you the exact combinations, which saves a lot of guessing.

Python 3.10 to 3.12, PyTorch 2.3.x to 2.4.x, DGL 2.2.x to 2.4.x, and a CPU or NVIDIA GPU on Linux.

There are two officially recommended environments. The primary is Python 3.11 with PyTorch 2.4.0 and DGL 2.4.0+cu121, and the compatibility one is Python 3.10 with PyTorch 2.3.1 and DGL 2.2.1. The repository file environment.yml is pinned to the primary setup.

The install starts with a conda environment, which the README marks as optional but recommends:

bash
conda create -n openhgnn python=3.11
conda activate openhgnn

Then PyTorch, following their tutorial, for example:

bash
pip install torch==2.4.0 torchvision torchaudio

Then DGL, and this is the step with a catch, because the wheels are not on PyPI in the usual place:

bash
pip install dgl==2.4.0+cu121 -f https://data.dgl.ai/wheels/torch-2.4/cu121/repo.html

The find-links flag points pip at a DGL-hosted wheel index, and the path encodes both the PyTorch version and the CUDA version, so the URL changes with your setup. The requirements file also carries a find-links line pointing at the same DGL wheel index.

Finally OpenHGNN itself, from PyPI or from source:

bash
pip install openhgnn
bash
git clone https://github.com/BUPT-GAMMA/OpenHGNN
# If you encounter a network error, try git clone from openi as following.

The clone section has a note that a network error can be worked around by cloning from the OpenI mirror instead, which matters for users behind a slow link to GitHub, and the OpenI mirror is also where the Chinese documentation lives.

The registry, the CLI and the reproduction guide

The documentation entry points listed in the README are the map of the project, and each one answers a different question.

The v0.9 release notes cover what changed in the current version. The quick start is the entry point for a new user. The model overview is the catalogue of the registered models. The model reproduction guide is the one that matters for research, because a toolkit that lets you run 83 models is only useful if the results are comparable, which means the same data splits and the same training configuration, and a guide that tells you how to reproduce a published result is the mechanism for that.

The task overview, which the README links with the node_regression addition in its title, is where the unit of work is defined, and the model PR checklist is the contribution contract.

Alongside the documentation, the repository has main.py and main_GUI.py at the top level, a space4hgnn.py and a space4hgnn/ directory for the Space4HGNN work, an openhgnn/ package, a tests/ directory with a pytest.ini, an examples/ directory with applications, basic_usage, customization and hyperparameter_optimization subdirectories, and a docs/ directory with a readthedocs configuration.

The examples directory is a good sign of how the project expects to be learned. basic_usage is the first thing to read, customization shows how to add your own task, model or dataset, hyperparameter_optimization shows the Optuna integration, and applications shows the pipelines built on top, which is the layer the older releases kept adding, application pipelines in v0.4 and the Graph Prompt pipeline in v0.7.

The library dependencies beyond the graph stack are also visible in setup.py, with numpy, pandas, the ogb benchmark library, optuna, colorama and TensorBoard, plus rdflib, igraph, lmdb and ordered_set in the requirements file.

Editorial conclusion

Adopt OpenHGNN when you are comparing heterogeneous graph models on a shared dataset, because the registry and the common task interface mean a model swap is a name change rather than a rewrite, and the model reproduction guide makes the comparison honest. Do not adopt it on a modern stack without checking the pins, because the requirements file caps torch and dgl at 2.2.1 while the README recommends PyTorch 2.3 to 2.4 and DGL 2.2 to 2.4, and the package version in setup.py is still 0.7.0 even though the README names v0.9.0 as current. Before you build, plan for the DGL wheel index, since the install command needs an extra find-links URL for the CUDA build.

Frequently asked questions

What is OpenHGNN and what does it register?

It is an open source toolkit for heterogeneous graph neural networks based on DGL and PyTorch. The current version registers 83 model names and 17 task and flow entries, with version 0.9 adding 10 model contributions and a node_regression task for continuous node-label prediction. CLI commands can inspect the environment, the registered models, the registered tasks and the datasets.

What are the installation requirements for OpenHGNN?

Python 3.10 to 3.12, PyTorch 2.3.x to 2.4.x, DGL 2.2.x to 2.4.x, and a CPU or NVIDIA GPU on Linux. The primary recommended environment is Python 3.11 with PyTorch 2.4.0 and DGL 2.4.0+cu121, and the compatibility one is Python 3.10 with PyTorch 2.3.1 and DGL 2.2.1, with environment.yml pinned to the primary setup.

How do I install DGL for OpenHGNN?

Follow the DGL tutorial for your OS and CUDA version, for example `pip install dgl==2.4.0+cu121 -f https://data.dgl.ai/wheels/torch-2.4/cu121/repo.html`. The wheels come from a DGL-hosted index rather than PyPI, so the find-links URL has to change with your PyTorch and CUDA versions.

What does OpenHGNN integrate for hyperparameter tuning?

It integrates optuna for hyperparameter optimization, and the repository has an examples/hyperparameter_optimization directory. The core dependencies listed in setup.py are numpy, pandas, ogb, torch, optuna, colorama and TensorBoard, with rdflib, igraph, lmdb and ordered_set also in the requirements file.

Official sources

  1. BUPT-GAMMA/OpenHGNN on GitHub
  2. Issues
  3. License: Apache-2.0
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/bupt-gamma-openhgnn.svg)](https://hysenlabs.com/projects/bupt-gamma-openhgnn)

Was this useful?