Skip to content

PaddlePaddle/GraphNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphNet

GraphNet is a large‑scale dataset for compiler development, providing researchers with a standardized, open‑access experimental environment. It includes numerous computation graphs extracted from deep learning models, making it easy to compare the optimization effectiveness of different compiler passes.

With GraphNet, users can:

  1. Quickly benchmark the optimization performance of various compiler strategies.
  2. Easily conduct regression tests on existing compilers.
  3. Train AI‑for‑Systems models to automatically generate compiler optimization passes.

Dataset Construction Constraints:

  1. Dynamic graphs must execute correctly.
  2. Each computation graph should include a standardized method for measuring performance.
  3. Graphs and their corresponding Python code must support serialization and deserialization.
  4. The full graph can be decomposed into two disjoint subgraphs.
  5. Compiler passes or behaviors must be configurable.
  6. Operator names within each computation graph must be statically parseable.
  7. If custom operators are used, their implementation code must be fully accessible.
  8. Graph execution on different hardware backends must be configurable via a unified interface.

⚡ Quick Start

Benchmark your compiler on the model:

graph_net.torch.test_compiler

python3 -m graph_net.torch.test_compiler \
  --model-path $GRAPH_NET_EXTRACT_WORKSPACE/model_name/ \
  --compiler /path/to/custom/compiler 
# Note: if --compiler is omitted, PyTorch’s built-in compiler is used by default

Contribute computation graphs to GraphNet:

Demo: Extract & Validate ResNet‑18

git clone https://github.com/PaddlePaddle/GraphNet.git
cd GraphNet

# Set your workspace directory
export GRAPH_NET_EXTRACT_WORKSPACE=/home/yourname/graphnet_workspace

# Extract the ResNet‑18 computation graph
python graph_net/test/vision_model_test.py

# Validate the extracted graph (e.g. /home/yourname/graphnet_workspace/resnet18)
python -m graph_net.torch.validate \
  --model-path $GRAPH_NET_EXTRACT_WORKSPACE/resnet18

graph_net.torch.extract

import graph_net

# Instantiate the model (e.g. a torchvision model)
model = ...  

# Extract your own model
model = graph_net.torch.extract(name="model_name")(model)

# After running, the extracted graph will be saved to:
#   $GRAPH_NET_EXTRACT_WORKSPACE/model_name

graph_net.torch.validate

# Verify that the extracted model meets requirements
python -m graph_net.torch.validate \
  --model-path $GRAPH_NET_EXTRACT_WORKSPACE/model_name

graph_net.pack

# Create a ZIP archive of $GRAPH_NET_EXTRACT_WORKSPACE.
# The --clear-after-pack flag (True|False) determines whether to delete the workspace after packing.
python -m graph_net.pack \
  --output /path/to/output.zip \
  --clear-after-pack True

Note: To configure your user details (username and email) for GraphNet, run:

python -m graph_net.config --global \
  --username "your-name" \
  --email "your-email"

Once you have packaged these extracted models, submit them to the GraphNet community via the following group chats.

License

This project is released under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7

Languages