DGL (Deep Graph Library)

repository·master·Indexed 12 days ago

https://github.com/dmlc/dgl

A high-performance, scalable Python package for deep learning on graphs. DGL is framework-agnostic, supporting PyTorch, MXNet, and TensorFlow, and is optimized for single-GPU and distributed multi-machine training. The ecosystem includes DGL-Go, a command-line tool for training, using, and studying Graph Neural Networks (GNNs) via a workflow of configuration, training, and exporting.

Tokens
244.5K
Snippets
672
Records
950
Agent score
96%

What's inside DGL

  1. Available DGL NN layers and utilities

    master

    DGL provides several common GNN layers and utility functions. While the library is extensible, the core includes:

    • Convolutional Layers: Such as SAGEConv and other graph convolution implementations.
    • Dense Convolutional Layers: For dense graph operations.
    • Pooling Layers: For graph-level or node-level pooling.
    • Utilities: Helper functions for graph neural network construction.
  2. Explore DGL-powered projects and ecosystems

    master

    Several specialized libraries and tools are built on top of DGL for specific domains and tasks:

    • Life Sciences:
      • DGL-LifeSci: GNN applications in life sciences.
      • RNAGlib: Construction, analysis, and ML on RNA 2.5D Graphs.
    • Knowledge Graphs & Embeddings:
      • DGL-KE: Scalable package for large-scale knowledge graph embeddings.
      • JAKET: Joint pre-training of Knowledge Graph and Language Understanding.
    • Benchmarks & Datasets:
      • OGB (Open Graph Benchmark): Large-scale, diverse benchmark datasets.
      • Benchmarking GNN: A framework for benchmarking GNNs.
    • NLP & Text:
      • Graph4NLP: Intersection of Deep Learning on Graphs and NLP.
    • Visualization & Analysis:
      • GNNLens2: Visualization tool for GNNs.
      • GNNLens: Visual analytics for prediction error diagnosis.
    • Other Specialized Tools:
      • TGL: Framework for large-scale temporal graphs.
      • DGLD: Deep Graph Anomaly Detection.
      • ArangoDB-DGL Adapter: Import/export graphs between ArangoDB and DGL.
      • Amazon Neptune ML: AWS capability using GNNs for graph data predictions.
  3. Use dgl.transforms for graph transformations and feature engineering

    master

    The dgl.transforms module provides a collection of tools to transform graph structures and node/edge features. These transforms can be used to modify the topology of a graph (e.g., adding self-loops, creating line graphs, or computing k-hop graphs) or to apply mathematical normalization and feature engineering (e.g., GCN normalization, PageRank, or Laplacian Positional Encodings).

    Most transforms follow a consistent interface where they can be applied to a DGL graph to produce a modified version or a new graph. For complex pipelines, you can use Compose to chain multiple transformations together.

  4. Find research paper implementations in DGL examples

    master

    The examples/ directory contains PyTorch implementations of selected research papers related to Graph Neural Networks (GNNs). You can find examples categorized by their publication year and tagged with specific tasks such as:

    • Node Classification: (e.g., ARGO, OGC, BGNN, GATv2, SIGN)
    • Link Prediction: (e.g., NGGN, SEAL_OGBL)
    • Graph Classification: (e.g., Directional GSN, EEG-GCNN, GXN)
    • Point Cloud Classification: (e.g., Point Transformer, PCT, BiPointNet)
    • Heterogeneous Graphs: (e.g., HGT, TAHIN, MAGNN)
    • Molecular Property Prediction: (e.g., DIMENET, Pre-training strategies)

    To find a specific implementation, you can search the repository for the paper title or use the search tool on dgl.ai.

  5. Get started with Deep Graph Library (DGL)

    master
    Deep Graph Library (DGL) is a Python package designed for implementing Graph Neural Network (GNN) models. It is built on top of existing deep learning frameworks, including PyTorch, MXNet, and TensorFlow. DGL provides control over message passing, speed optimizations through auto-batching and sparse matrix kernels, and supports multi-GPU/CPU training for large-scale graphs.
  6. Implement NGNN for link prediction in DGL

    master
    This example demonstrates how to implement NGNN (Network In Graph Neural Network) using DGL. NGNN is a model-agnostic methodology that allows arbitrary Graph Neural Network (GNN) models (like GCN or GraphSage) to increase their model capacity. The implementation provided experiments with full-batch GCN and GraphSage models on several OGB datasets.
  7. Available built-in DGL NN modules

    master

    DGL provides a variety of pre-implemented modules to accelerate GNN development. These include categories such as:

    • Convolutional layers (e.g., SAGEConv)
    • Dense convolutional layers
    • Pooling layers
    • Utility modules

    Users can extend DGL by contributing new modules to these categories.

  8. Built-in DGL NN layers and utilities

    master

    DGL provides a collection of integrated building blocks for GNN models. Depending on your backend, these include:

    • Convolutional layers: e.g., SAGEConv.
    • Dense convolutional layers.
    • Pooling layers.
    • Utilities for GNN construction.

    For PyTorch users, these are located in the dgl.nn.pytorch namespace.

  9. Overview of the Distributed Graph Partitioning Pipeline

    master

    For massive graphs that exceed a single machine's RAM, DGL uses a parallel data preparation pipeline consisting of two main steps:

    1. Graph Partitioning: Calculates partition ownership and saves a partition assignment. This step can use parallel algorithms like ParMETIS.
    2. Data Dispatching: Uses the partition assignment to physically partition the graph data, convert it into training-ready formats, and dispatch it to specified machines.

    The pipeline is modular; you can replace Step 1 with a custom partitioning algorithm as long as it produces valid partition assignment files.

  10. What is GraphBolt and how does it work?

    master

    GraphBolt is a high-flexibility, scalable data loading framework for Graph Neural Networks (GNNs) built on top of DGL and PyTorch.

    It integrates with PyTorch datapipe by using a unified MiniBatch data structure to connect different processing stages. This allows GraphBolt to streamline data loading and preprocessing for training, validation, and testing through a pipelined architecture. Because the process is exposed as a pipeline, users can substitute any stage with custom implementations while still benefiting from GraphBolt's optimized scheduling strategy.