Skip to content

feat: integrate RGT model with Riemannian manifold support#251

Open
Kindin-X wants to merge 6 commits into
BUPT-GAMMA:mainfrom
Kindin-X:lyr
Open

feat: integrate RGT model with Riemannian manifold support#251
Kindin-X wants to merge 6 commits into
BUPT-GAMMA:mainfrom
Kindin-X:lyr

Conversation

@Kindin-X

Copy link
Copy Markdown

Description

This PR integrates the RGT (Riemannian Graph Transformer) model into GammaGL,. It extends graph learning capabilities to hyperbolic (Lorentz) and spherical manifolds. The implementation includes cross-manifold attention and Riemannian vector quantization for self-supervised pre-training, along with robust downstream adapters for node classification, link prediction, graph classification, and few-shot node classification.

Checklist

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature])
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage
  • Code is well-documented
  • To the best of my knowledge, examples are either not affected by this change,
    or have been fixed to be compatible with this change
  • Related issue is referred in this PR

Changes

  • RGT Core Model & Heads: Implemented the multi-manifold encoder (rgt.py) and downstream task adapters (rgt_heads.py for NC, LP, GC, and Few-shot NC).
  • Manifold Layers & Attention: Added geoopt-wrapped manifold operations (Lorentz, Sphere, Euclidean, Product), Cross-Manifold Attention (rgt_attention.py), and Riemannian/Euclidean Vector Quantization (vq_*.py).
  • Datasets & Loaders: Introduced a BFS-based subgraph/link/graph loader (rgt_loader.py) and added the Airports and GitHub datasets along with RGT class mappings.
  • Training Pipeline & Utilities: Provided unified training scripts for pre-training and supervised fine-tuning (examples/rgt/), and added stable manifold math utilities (manifold_math.py).
  • Framework Enhancements: Added a pure-Python fallback (_gspmm_fallback) in torch.py for environments lacking C++ extensions, improved download.py with size validation/re-downloading, and added einops to setup.py dependencies.

Kindin-X added 6 commits May 13, 2026 11:13
- Add RGT (Riemannian Graph Transformer) model with Lorentz/Sphere/Euclidean manifolds
- Add cross-manifold attention and vector quantization (VQ) modules
- Add MoleculeGNN model for molecular property prediction
- Add manifold math utilities, data loaders, and training/eval tooling
- Add Airports and KarateClub datasets
- Move RGT-specific utils from gammagl/utils/ to examples/rgt/utils.py
- Remove GammaGL_Reference_Guide.md
- Remove run_server.py from tracking
- setup.py: drop local portability patches, return to upstream original
- .gitignore: remove project-specific ignores (run_server.py, iteration_log.md, PR_Description.md)
…ve hardcoded backend

- Merge rgt_heads into rgt.py, move mappings to examples/rgt/
- Merge 4 manifold files into rgt_layers.py
- Revert mpops/torch.py, ops/*/__init__.py, download.py to upstream
- Remove hardcoded TL_BACKEND from all RGT files
- Set TL_BACKEND via run_server.py environment
- Replace tlx.isnan/tlx.isinf with tlx.is_nan/tlx.is_inf across all RGT files
- Fix sample_sequence_fn call to use positional arg instead of keyword
- Add tokens propagation from dataset to batch in ExtractNodeLoader.__iter__
- Add CPU deserialization fallback for cached pickle files on GPU-less servers
Merge rgt_mappings.py into utils.py (class_maps dict), merge
rgt_pretrain.py and rgt_supervised.py into train.py. This follows
the pattern used by other examples (single utils + train pair).
All logic preserved unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant