Skip to content

Commit 0e7aefe

Browse files
committed
update
1 parent 13159f8 commit 0e7aefe

File tree

2 files changed

+73
-62
lines changed

2 files changed

+73
-62
lines changed

README.md

Lines changed: 5 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
![](https://img.shields.io/badge/version-v0.1-brightgreen)
77
![](https://img.shields.io/github/issues/PaddlePaddle/GraphNet?label=open%20issues)
88
[![Documentation](https://img.shields.io/badge/documentation-blue)](./GraphNet_technical_report.pdf)
9-
<a href="https://img.shields.io/badge/微信-green?logo=wechat&amp"><img src="https://img.shields.io/badge/微信-green?logo=wechat&amp"></a>
9+
<a href="https://github.com/user-attachments/assets/125e3494-25c9-4494-9acd-8ad65ca85d03"><img src="https://img.shields.io/badge/微信-green?logo=wechat&amp"></a>
1010
</div>
1111

1212
**GraphNet** is a large-scale dataset of deep learning **computation graphs**, built as a standard benchmark for **tensor compiler** optimization. It provides over 2.7K computation graphs extracted from state-of-the-art deep learning models spanning diverse tasks and ML frameworks. With standardized formats and rich metadata, GraphNet enables fair comparison and reproducible evaluation of the general optimization capabilities of tensor compilers, thereby supporting advanced research such as AI for System on compilers.
@@ -16,7 +16,7 @@
1616
- [2025-8-20] 🚀 The second round of [open contribution tasks](https://github.com/PaddlePaddle/Paddle/issues/74773) was released. (completed ✅)
1717
- [2025-7-30] 🚀 The first round of [open contribution tasks](https://github.com/PaddlePaddle/GraphNet/issues/44) was released. (completed ✅)
1818
## Benchmark Results
19-
We evaluate two representative tensor compiler backends, CINN (PaddlePaddle) and TorchInductor (PyTorch), on GraphNet's NLP and CV subsets. The evaluation adopts two quantitative metrics proposed in the [GraphNet Technical Report](./GraphNet_technical_report.pdf):
19+
We evaluate two representative tensor compiler backends, CINN (PaddlePaddle) and TorchInductor (PyTorch), on GraphNet's NLP and CV subsets. The evaluation adopts two quantitative metrics proposed in the [Technical Report](./GraphNet_technical_report.pdf):
2020
- **Speedup Score** S(t) — evaluates compiler performance under varying numerical tolerance levels.
2121
<div align="center">
2222
<img src="/pics/St-result.jpg" alt="Speedup Score S_t Results" width="80%">
@@ -91,66 +91,9 @@ python -m graph_net.S_analysis \
9191

9292
The scripts are designed to process a file structure as `/benchmark_path/category_name/`, and items on x-axis are identified by name of the sub-directories. After executing, several summary plots of result in categories (model tasks, libraries...) will be exported to `$GRAPH_NET_BENCHMARK_PATH`.
9393

94-
### 🧱 Contribute More Samples
95-
96-
GraphNet provides automated tools for graph extraction and validation.
97-
98-
<div align="center">
99-
<img src="/pics/graphnet_overview.jpg" alt="GraphNet Architecture Overview" width="65%">
100-
</div>
101-
102-
**Demo: Extract & Validate ResNet‑18**
103-
```bash
104-
git clone https://github.com/PaddlePaddle/GraphNet.git
105-
cd GraphNet
106-
107-
# Set your workspace directory
108-
export GRAPH_NET_EXTRACT_WORKSPACE=/home/yourname/graphnet_workspace/
109-
110-
# Extract the ResNet‑18 computation graph
111-
python graph_net/test/vision_model_test.py
112-
113-
# Validate the extracted graph (e.g. /home/yourname/graphnet_workspace/resnet18/)
114-
python -m graph_net.torch.validate \
115-
--model-path $GRAPH_NET_EXTRACT_WORKSPACE/resnet18/
116-
```
117-
118-
**Illustration – Extraction Workflow**
119-
120-
<div align="center">
121-
<img src="/pics/dataset_composition.png" alt="GraphNet Extract Sample" width="65%">
122-
</div>
123-
124-
* Source code of custom_op is required **only when** corresponding operator is used in the module, and **no specific format** is required.
125-
126-
**Step 1: graph_net.torch.extract**
127-
128-
Wrap the model with the extractor — that’s all you need:
129-
130-
```bash
131-
import graph_net
132-
133-
# Instantiate the model (e.g. a torchvision model)
134-
model = ...
135-
136-
# Extract your own model
137-
model = graph_net.torch.extract(name="model_name", dynamic="True")(model)
138-
```
139-
140-
After running, the extracted graph will be saved to: `$GRAPH_NET_EXTRACT_WORKSPACE/model_name/`.
141-
142-
For more details, see docstring of `graph_net.torch.extract` defined in `graph_net/torch/extractor.py`.
143-
144-
**Step 2: graph_net.torch.validate**
145-
146-
To verify that the extracted model meets requirements, we use `graph_net.torch.validate` in CI tool and also ask contributors to self-check in advance:
147-
148-
```bash
149-
python -m graph_net.torch.validate \
150-
--model-path $GRAPH_NET_EXTRACT_WORKSPACE/model_name
151-
```
152-
153-
All the **construction constraints** will be examined automatically. After passing validation, a unique `graph_hash.txt` will be generated and later checked in CI procedure to avoid redundant.
94+
### 🧱 Construction & Contribution Guide
95+
Want to understand how GraphNet is built or contribute new samples?
96+
Check out the [Contributors Guide](./docs/README_contribute.md) for the extraction and validation pipeline.
15497

15598

15699
## Future Roadmap

docs/README_contribute.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Contributing to GraphNet
2+
To guarantee the dataset’s overall quality, reproducibility, and cross-compiler compatibility, we define the following construction **constraints**:
3+
4+
1. Computation graphs must be executable in imperative (eager) mode.
5+
2. Computation graphs and their corresponding Python code must support serialization and deserialization.
6+
3. The full graph can be decomposed into two disjoint subgraphs.
7+
4. Operator names within each computation graph must be statically parseable.
8+
5. If custom operators are used, their implementation code must be fully accessible.
9+
10+
## Graph Extraction & Validation
11+
GraphNet provides automated tools for graph extraction and validation.
12+
13+
<div align="center">
14+
<img src="/pics/graphnet_overview.jpg" alt="GraphNet Architecture Overview" width="65%">
15+
</div>
16+
17+
**Demo: Extract & Validate ResNet‑18**
18+
```bash
19+
git clone https://github.com/PaddlePaddle/GraphNet.git
20+
cd GraphNet
21+
22+
# Set your workspace directory
23+
export GRAPH_NET_EXTRACT_WORKSPACE=/home/yourname/graphnet_workspace/
24+
25+
# Extract the ResNet‑18 computation graph
26+
python graph_net/test/vision_model_test.py
27+
28+
# Validate the extracted graph (e.g. /home/yourname/graphnet_workspace/resnet18/)
29+
python -m graph_net.torch.validate \
30+
--model-path $GRAPH_NET_EXTRACT_WORKSPACE/resnet18/
31+
```
32+
33+
**Illustration – Extraction Workflow**
34+
35+
<div align="center">
36+
<img src="/pics/dataset_composition.png" alt="GraphNet Extract Sample" width="65%">
37+
</div>
38+
39+
* Source code of custom_op is required **only when** corresponding operator is used in the module, and **no specific format** is required.
40+
41+
**Step 1: graph_net.torch.extract**
42+
43+
Wrap the model with the extractor — that’s all you need:
44+
45+
```bash
46+
import graph_net
47+
48+
# Instantiate the model (e.g. a torchvision model)
49+
model = ...
50+
51+
# Extract your own model
52+
model = graph_net.torch.extract(name="model_name", dynamic="True")(model)
53+
```
54+
55+
After running, the extracted graph will be saved to: `$GRAPH_NET_EXTRACT_WORKSPACE/model_name/`.
56+
57+
For more details, see docstring of `graph_net.torch.extract` defined in `graph_net/torch/extractor.py`.
58+
59+
**Step 2: graph_net.torch.validate**
60+
61+
To verify that the extracted model meets requirements, we use `graph_net.torch.validate` in CI tool and also ask contributors to self-check in advance:
62+
63+
```bash
64+
python -m graph_net.torch.validate \
65+
--model-path $GRAPH_NET_EXTRACT_WORKSPACE/model_name
66+
```
67+
68+
All the **construction constraints** will be examined automatically. After passing validation, a unique `graph_hash.txt` will be generated and later checked in CI procedure to avoid redundant.

0 commit comments

Comments
 (0)