Copy disabled (too large)
Download .txt
Showing preview only (16,122K chars total). Download the full file to get everything.
Repository: dmlc/dgl
Branch: master
Commit: 3d16000b4170
Files: 2167
Total size: 15.1 MB
Directory structure:
gitextract_7pa1_qyp/
├── .clang-format
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── --work-item--dev-only-.md
│ │ ├── bug-report.md
│ │ ├── documentation.md
│ │ ├── feature-request.md
│ │ └── questions-help-support.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ └── workflows/
│ ├── lint.yml
│ └── stale.yml
├── .gitignore
├── .gitmodules
├── .lintrunner.toml
├── CMakeLists.txt
├── CONTRIBUTORS.md
├── Jenkinsfile
├── LICENSE
├── NEWS.md
├── README.md
├── apps/
│ └── life_sci/
│ └── README.md
├── benchmarks/
│ ├── .gitignore
│ ├── Jenkinsfile
│ ├── README.md
│ ├── asv.conf.json
│ ├── benchmarks/
│ │ ├── __init__.py
│ │ ├── api/
│ │ │ ├── __init__.py
│ │ │ ├── bench_add_self_loop.py
│ │ │ ├── bench_batch.py
│ │ │ ├── bench_builtin_apply_edges.py
│ │ │ ├── bench_builtin_apply_edges_hetero.py
│ │ │ ├── bench_builtin_multi_update_all.py
│ │ │ ├── bench_builtin_update_all_coo.py
│ │ │ ├── bench_builtin_update_all_csc.py
│ │ │ ├── bench_edge_ids.py
│ │ │ ├── bench_edge_subgraph.py
│ │ │ ├── bench_find_edges.py
│ │ │ ├── bench_format_conversion.py
│ │ │ ├── bench_fused_sample_neighbors.py
│ │ │ ├── bench_heterograph_construction.py
│ │ │ ├── bench_homograph_edge_construction.py
│ │ │ ├── bench_homograph_scipy_construction.py
│ │ │ ├── bench_in_degrees.py
│ │ │ ├── bench_in_edges.py
│ │ │ ├── bench_in_subgraph.py
│ │ │ ├── bench_khop.py
│ │ │ ├── bench_knn_graph.py
│ │ │ ├── bench_metis_partition.py
│ │ │ ├── bench_nn_graphconv.py
│ │ │ ├── bench_nn_heterographconv.py
│ │ │ ├── bench_node_subgraph.py
│ │ │ ├── bench_random_walk.py
│ │ │ ├── bench_readout.py
│ │ │ ├── bench_reverse.py
│ │ │ ├── bench_sample_neighbors.py
│ │ │ ├── bench_to_block.py
│ │ │ ├── bench_udf_apply_edges.py
│ │ │ ├── bench_udf_multi_update_all.py
│ │ │ ├── bench_udf_update_all.py
│ │ │ └── bench_unbatch.py
│ │ ├── kernel/
│ │ │ ├── __init__.py
│ │ │ ├── bench_edgesoftmax.py
│ │ │ ├── bench_gsddmm_u_dot_v.py
│ │ │ ├── bench_gspmm_copy_u.py
│ │ │ └── bench_gspmm_u_mul_e_sum.py
│ │ ├── model_acc/
│ │ │ ├── __init__.py
│ │ │ ├── bench_gat.py
│ │ │ ├── bench_gcn.py
│ │ │ ├── bench_gcn_udf.py
│ │ │ ├── bench_rgcn_base.py
│ │ │ ├── bench_rgcn_ns.py
│ │ │ ├── bench_sage.py
│ │ │ └── bench_sage_ns.py
│ │ ├── model_speed/
│ │ │ ├── __init__.py
│ │ │ ├── bench_gat.py
│ │ │ ├── bench_gat_ns.py
│ │ │ ├── bench_gcn_udf.py
│ │ │ ├── bench_pinsage.py
│ │ │ ├── bench_rgcn_base.py
│ │ │ ├── bench_rgcn_hetero_ns.py
│ │ │ ├── bench_rgcn_homogeneous_ns.py
│ │ │ ├── bench_sage.py
│ │ │ ├── bench_sage_ns.py
│ │ │ └── bench_sage_unsupervised_ns.py
│ │ ├── multigpu/
│ │ │ ├── __init__.py
│ │ │ ├── bench_multigpu_rgcn.py
│ │ │ ├── bench_multigpu_sage.py
│ │ │ └── rgcn_model.py
│ │ ├── rgcn.py
│ │ └── utils.py
│ ├── run.sh
│ ├── scripts/
│ │ ├── README.md
│ │ ├── build_dgl_asv.sh
│ │ ├── fix_ram_info.py
│ │ ├── generate_excel.py
│ │ ├── install_dgl_asv.sh
│ │ ├── publish.sh
│ │ ├── replace_branch.py
│ │ └── torch_gpu_pip.txt
│ └── task.json
├── cmake/
│ ├── modules/
│ │ ├── CUDA.cmake
│ │ └── FindMETIS.cmake
│ └── util/
│ ├── FindCUDA.cmake
│ ├── MshadowUtil.cmake
│ └── Util.cmake
├── conda/
│ └── dgl/
│ ├── README.md
│ ├── bld.bat
│ ├── build.sh
│ ├── conda_build_config.yaml
│ ├── meta.yaml
│ ├── run_test.bat
│ └── run_test.sh
├── dgl_sparse/
│ ├── CMakeLists.txt
│ ├── build.bat
│ ├── build.sh
│ ├── find_cmake.py
│ ├── include/
│ │ └── sparse/
│ │ ├── dgl_headers.h
│ │ ├── elementwise_op.h
│ │ ├── matrix_ops.h
│ │ ├── reduction.h
│ │ ├── sddmm.h
│ │ ├── softmax.h
│ │ ├── sparse_format.h
│ │ ├── sparse_matrix.h
│ │ ├── spmm.h
│ │ └── spspmm.h
│ └── src/
│ ├── cpu/
│ │ └── matrix_ops_impl.cc
│ ├── elemenwise_op.cc
│ ├── matmul.cc
│ ├── matmul.h
│ ├── matrix_ops.cc
│ ├── matrix_ops_impl.h
│ ├── python_binding.cc
│ ├── reduction.cc
│ ├── sddmm.cc
│ ├── softmax.cc
│ ├── sparse_format.cc
│ ├── sparse_matrix.cc
│ ├── sparse_matrix_coalesce.cc
│ ├── spmm.cc
│ ├── spspmm.cc
│ └── utils.h
├── dglgo/
│ ├── README.md
│ ├── dglgo/
│ │ ├── __init__.py
│ │ ├── apply_pipeline/
│ │ │ ├── __init__.py
│ │ │ ├── graphpred/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gen.py
│ │ │ │ └── graphpred.jinja-py
│ │ │ ├── nodepred/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gen.py
│ │ │ │ └── nodepred.jinja-py
│ │ │ └── nodepred_sample/
│ │ │ ├── __init__.py
│ │ │ ├── gen.py
│ │ │ └── nodepred-ns.jinja-py
│ │ ├── cli/
│ │ │ ├── __init__.py
│ │ │ ├── apply_cli.py
│ │ │ ├── cli.py
│ │ │ ├── config_apply_cli.py
│ │ │ ├── config_cli.py
│ │ │ ├── export_cli.py
│ │ │ ├── recipe_cli.py
│ │ │ └── train_cli.py
│ │ ├── model/
│ │ │ ├── __init__.py
│ │ │ ├── edge_encoder/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── bilinear.py
│ │ │ │ ├── dot.py
│ │ │ │ └── ele.py
│ │ │ ├── graph_encoder/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gin_ogbg.py
│ │ │ │ └── pna.py
│ │ │ └── node_encoder/
│ │ │ ├── __init__.py
│ │ │ ├── gat.py
│ │ │ ├── gcn.py
│ │ │ ├── gin.py
│ │ │ ├── sage.py
│ │ │ └── sgc.py
│ │ ├── pipeline/
│ │ │ ├── __init__.py
│ │ │ ├── graphpred/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gen.py
│ │ │ │ └── graphpred.jinja-py
│ │ │ ├── linkpred/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gen.py
│ │ │ │ └── linkpred.jinja-py
│ │ │ ├── nodepred/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gen.py
│ │ │ │ └── nodepred.jinja-py
│ │ │ └── nodepred_sample/
│ │ │ ├── __init__.py
│ │ │ ├── gen.py
│ │ │ └── nodepred-ns.jinja-py
│ │ └── utils/
│ │ ├── __init__.py
│ │ ├── base_model.py
│ │ ├── early_stop.py
│ │ ├── enter_config.py
│ │ ├── factory.py
│ │ └── yaml_dump.py
│ ├── recipes/
│ │ ├── __init__.py
│ │ ├── graphpred_hiv_gin.yaml
│ │ ├── graphpred_hiv_pna.yaml
│ │ ├── graphpred_pcba_gin.yaml
│ │ ├── linkpred_citation2_sage.yaml
│ │ ├── linkpred_collab_sage.yaml
│ │ ├── linkpred_cora_sage.yaml
│ │ ├── nodepred-ns_arxiv_gcn.yaml
│ │ ├── nodepred-ns_product_sage.yaml
│ │ ├── nodepred_citeseer_gat.yaml
│ │ ├── nodepred_citeseer_gcn.yaml
│ │ ├── nodepred_citeseer_sage.yaml
│ │ ├── nodepred_cora_gat.yaml
│ │ ├── nodepred_cora_gcn.yaml
│ │ ├── nodepred_cora_sage.yaml
│ │ ├── nodepred_pubmed_gat.yaml
│ │ ├── nodepred_pubmed_gcn.yaml
│ │ └── nodepred_pubmed_sage.yaml
│ ├── setup.py
│ └── tests/
│ ├── cfg.yml
│ ├── run_test.sh
│ └── test_pipeline.py
├── docker/
│ ├── Dockerfile.awscli
│ ├── Dockerfile.ci_benchmark
│ ├── Dockerfile.ci_cpu
│ ├── Dockerfile.ci_gpu
│ ├── Dockerfile.ci_lint
│ ├── README.md
│ ├── install/
│ │ ├── conda_env/
│ │ │ ├── kg_cpu.yml
│ │ │ ├── kg_gpu.yml
│ │ │ ├── mxnet_cpu.yml
│ │ │ ├── mxnet_gpu.yml
│ │ │ ├── tensorflow_cpu.yml
│ │ │ ├── tensorflow_gpu.yml
│ │ │ ├── torch_cpu.yml
│ │ │ ├── torch_cpu_pip.txt
│ │ │ ├── torch_gpu.yml
│ │ │ └── torch_gpu_pip.txt
│ │ ├── ubuntu_install_antlr.sh
│ │ ├── ubuntu_install_build.sh
│ │ ├── ubuntu_install_conda.sh
│ │ ├── ubuntu_install_core.sh
│ │ ├── ubuntu_install_java.sh
│ │ ├── ubuntu_install_mxnet_cpu.sh
│ │ ├── ubuntu_install_mxnet_gpu.sh
│ │ ├── ubuntu_install_python.sh
│ │ ├── ubuntu_install_python_package.sh
│ │ ├── ubuntu_install_torch.sh
│ │ └── ubuntu_install_torch_1.2.0.sh
│ └── pods/
│ ├── ci-compile-cpu.yaml
│ ├── ci-compile-gpu.yaml
│ ├── ci-cpu.yaml
│ ├── ci-gpu.yaml
│ └── ci-lint.yaml
├── docs/
│ ├── .gitignore
│ ├── Makefile
│ ├── README.md
│ ├── clean.sh
│ ├── migrate-guide-0.5.md
│ └── source/
│ ├── _static/
│ │ └── css/
│ │ └── custom.css
│ ├── _templates/
│ │ ├── classtemplate.rst
│ │ └── graphbolt_classtemplate.rst
│ ├── api/
│ │ └── python/
│ │ ├── dgl.DGLGraph.rst
│ │ ├── dgl.data.rst
│ │ ├── dgl.dataloading.rst
│ │ ├── dgl.distributed.rst
│ │ ├── dgl.function.rst
│ │ ├── dgl.geometry.rst
│ │ ├── dgl.graphbolt.rst
│ │ ├── dgl.multiprocessing.rst
│ │ ├── dgl.ops.rst
│ │ ├── dgl.optim.rst
│ │ ├── dgl.rst
│ │ ├── dgl.sampling.rst
│ │ ├── dgl.sparse_v0.rst
│ │ ├── index.rst
│ │ ├── knn_benchmark.rst
│ │ ├── nn-mxnet.rst
│ │ ├── nn-pytorch.rst
│ │ ├── nn-tensorflow.rst
│ │ ├── nn.functional.rst
│ │ ├── transforms.rst
│ │ └── udf.rst
│ ├── conf.py
│ ├── contribute.rst
│ ├── developer/
│ │ └── ffi.rst
│ ├── env_var.rst
│ ├── faq.rst
│ ├── features/
│ │ └── dataset.rst
│ ├── gen_dataset_stat.py
│ ├── graphtransformer/
│ │ ├── data.rst
│ │ ├── index.rst
│ │ └── model.rst
│ ├── guide/
│ │ ├── data-dataset.rst
│ │ ├── data-download.rst
│ │ ├── data-loadcsv.rst
│ │ ├── data-loadogb.rst
│ │ ├── data-process.rst
│ │ ├── data-savenload.rst
│ │ ├── data.rst
│ │ ├── distributed-apis.rst
│ │ ├── distributed-hetero.rst
│ │ ├── distributed-partition.rst
│ │ ├── distributed-preprocessing.rst
│ │ ├── distributed-tools.rst
│ │ ├── distributed.rst
│ │ ├── graph-basic.rst
│ │ ├── graph-external.rst
│ │ ├── graph-feature.rst
│ │ ├── graph-gpu.rst
│ │ ├── graph-graphs-nodes-edges.rst
│ │ ├── graph-heterogeneous.rst
│ │ ├── graph.rst
│ │ ├── index.rst
│ │ ├── message-api.rst
│ │ ├── message-efficient.rst
│ │ ├── message-heterograph.rst
│ │ ├── message-part.rst
│ │ ├── message.rst
│ │ ├── minibatch-custom-sampler.rst
│ │ ├── minibatch-edge.rst
│ │ ├── minibatch-gpu-sampling.rst
│ │ ├── minibatch-inference.rst
│ │ ├── minibatch-link.rst
│ │ ├── minibatch-nn.rst
│ │ ├── minibatch-node.rst
│ │ ├── minibatch-parallelism.rst
│ │ ├── minibatch-sparse.rst
│ │ ├── minibatch.rst
│ │ ├── mixed_precision.rst
│ │ ├── nn-construction.rst
│ │ ├── nn-forward.rst
│ │ ├── nn-heterograph.rst
│ │ ├── nn.rst
│ │ ├── training-edge.rst
│ │ ├── training-eweight.rst
│ │ ├── training-graph.rst
│ │ ├── training-link.rst
│ │ ├── training-node.rst
│ │ └── training.rst
│ ├── guide_cn/
│ │ ├── data-dataset.rst
│ │ ├── data-download.rst
│ │ ├── data-loadogb.rst
│ │ ├── data-process.rst
│ │ ├── data-savenload.rst
│ │ ├── data.rst
│ │ ├── distributed-apis.rst
│ │ ├── distributed-preprocessing.rst
│ │ ├── distributed-tools.rst
│ │ ├── distributed.rst
│ │ ├── graph-basic.rst
│ │ ├── graph-external.rst
│ │ ├── graph-feature.rst
│ │ ├── graph-gpu.rst
│ │ ├── graph-graphs-nodes-edges.rst
│ │ ├── graph-heterogeneous.rst
│ │ ├── graph.rst
│ │ ├── index.rst
│ │ ├── message-api.rst
│ │ ├── message-efficient.rst
│ │ ├── message-heterograph.rst
│ │ ├── message-part.rst
│ │ ├── message.rst
│ │ ├── minibatch-custom-sampler.rst
│ │ ├── minibatch-edge.rst
│ │ ├── minibatch-inference.rst
│ │ ├── minibatch-link.rst
│ │ ├── minibatch-nn.rst
│ │ ├── minibatch-node.rst
│ │ ├── minibatch.rst
│ │ ├── nn-construction.rst
│ │ ├── nn-forward.rst
│ │ ├── nn-heterograph.rst
│ │ ├── nn.rst
│ │ ├── training-edge.rst
│ │ ├── training-eweight.rst
│ │ ├── training-graph.rst
│ │ ├── training-link.rst
│ │ ├── training-node.rst
│ │ └── training.rst
│ ├── guide_ko/
│ │ ├── data-dataset.rst
│ │ ├── data-download.rst
│ │ ├── data-loadogb.rst
│ │ ├── data-process.rst
│ │ ├── data-savenload.rst
│ │ ├── data.rst
│ │ ├── distributed-apis.rst
│ │ ├── distributed-hetero.rst
│ │ ├── distributed-preprocessing.rst
│ │ ├── distributed-tools.rst
│ │ ├── distributed.rst
│ │ ├── graph-basic.rst
│ │ ├── graph-external.rst
│ │ ├── graph-feature.rst
│ │ ├── graph-gpu.rst
│ │ ├── graph-graphs-nodes-edges.rst
│ │ ├── graph-heterogeneous.rst
│ │ ├── graph.rst
│ │ ├── index.rst
│ │ ├── message-api.rst
│ │ ├── message-edge.rst
│ │ ├── message-efficient.rst
│ │ ├── message-heterograph.rst
│ │ ├── message-part.rst
│ │ ├── message.rst
│ │ ├── minibatch-custom-sampler.rst
│ │ ├── minibatch-edge.rst
│ │ ├── minibatch-gpu-sampling.rst
│ │ ├── minibatch-inference.rst
│ │ ├── minibatch-link.rst
│ │ ├── minibatch-nn.rst
│ │ ├── minibatch-node.rst
│ │ ├── minibatch.rst
│ │ ├── mixed_precision.rst
│ │ ├── nn-construction.rst
│ │ ├── nn-forward.rst
│ │ ├── nn-heterograph.rst
│ │ ├── nn.rst
│ │ ├── training-edge.rst
│ │ ├── training-graph.rst
│ │ ├── training-link.rst
│ │ ├── training-node.rst
│ │ └── training.rst
│ ├── index.rst
│ ├── install/
│ │ └── index.rst
│ ├── notebooks/
│ │ └── sparse/
│ │ ├── gcn.nblink
│ │ ├── graph_diffusion.nblink
│ │ ├── graph_transformer.nblink
│ │ ├── hgnn.nblink
│ │ ├── index.rst
│ │ └── quickstart.nblink
│ ├── performance.rst
│ ├── resources.rst
│ └── stochastic_training/
│ ├── index.rst
│ ├── link_prediction.nblink
│ ├── multigpu_node_classification.nblink
│ ├── neighbor_sampling_overview.nblink
│ ├── node_classification.nblink
│ ├── ondisk-dataset-specification.rst
│ ├── ondisk-dataset.rst
│ ├── ondisk_dataset_heterograph.nblink
│ └── ondisk_dataset_homograph.nblink
├── examples/
│ ├── README.md
│ ├── advanced/
│ │ └── cugraph/
│ │ ├── graphsage.py
│ │ └── rgcn.py
│ ├── core/
│ │ ├── Graphormer/
│ │ │ ├── README.md
│ │ │ ├── dataset.py
│ │ │ ├── main.py
│ │ │ └── model.py
│ │ ├── gat/
│ │ │ ├── README.md
│ │ │ └── train.py
│ │ ├── gated_gcn/
│ │ │ ├── README.md
│ │ │ └── train.py
│ │ ├── graphsage/
│ │ │ └── node_classification.py
│ │ └── rgcn/
│ │ ├── README.md
│ │ └── hetero_rgcn.py
│ ├── distributed/
│ │ ├── graphsage/
│ │ │ ├── README.md
│ │ │ ├── node_classification.py
│ │ │ ├── node_classification_unsupervised.py
│ │ │ └── partition_graph.py
│ │ └── rgcn/
│ │ ├── README.md
│ │ ├── lp_perf.py
│ │ ├── node_classification.py
│ │ └── partition_graph.py
│ ├── graphbolt/
│ │ ├── README.md
│ │ ├── disk_based_feature/
│ │ │ ├── README.md
│ │ │ └── node_classification.py
│ │ ├── lightning/
│ │ │ ├── README.md
│ │ │ └── node_classification.py
│ │ ├── link_prediction.py
│ │ ├── node_classification.py
│ │ ├── pyg/
│ │ │ ├── README.md
│ │ │ ├── hetero/
│ │ │ │ └── node_classification.py
│ │ │ ├── labor/
│ │ │ │ ├── README.md
│ │ │ │ ├── load_dataset.py
│ │ │ │ ├── node_classification.py
│ │ │ │ └── sage_conv.py
│ │ │ ├── link_prediction.py
│ │ │ ├── multigpu/
│ │ │ │ └── node_classification.py
│ │ │ ├── node_classification.py
│ │ │ └── node_classification_advanced.py
│ │ ├── quickstart/
│ │ │ ├── README.md
│ │ │ ├── link_prediction.py
│ │ │ └── node_classification.py
│ │ ├── rgcn/
│ │ │ ├── README.md
│ │ │ └── hetero_rgcn.py
│ │ ├── sparse/
│ │ │ └── graphsage.py
│ │ └── temporal_link_prediction.py
│ ├── legacy/
│ │ ├── README.md
│ │ ├── link_prediction.py
│ │ └── node_classification.py
│ ├── multigpu/
│ │ ├── README.md
│ │ ├── graphbolt/
│ │ │ ├── README.md
│ │ │ └── node_classification.py
│ │ └── node_classification_sage.py
│ ├── mxnet/
│ │ ├── README.md
│ │ ├── appnp/
│ │ │ ├── README.md
│ │ │ └── appnp.py
│ │ ├── gat/
│ │ │ ├── README.md
│ │ │ ├── gat.py
│ │ │ ├── train.py
│ │ │ └── utils.py
│ │ ├── gcn/
│ │ │ ├── README.md
│ │ │ ├── gcn.py
│ │ │ ├── gcn_concat.py
│ │ │ ├── gcn_mp.py
│ │ │ └── train.py
│ │ ├── gin/
│ │ │ ├── README.md
│ │ │ ├── dataloader.py
│ │ │ ├── gin.py
│ │ │ ├── main.py
│ │ │ └── parser.py
│ │ ├── graphsage/
│ │ │ ├── README.md
│ │ │ └── main.py
│ │ ├── monet/
│ │ │ ├── README.md
│ │ │ └── citation.py
│ │ ├── rgcn/
│ │ │ ├── README.md
│ │ │ ├── entity_classify.py
│ │ │ └── model.py
│ │ ├── scenegraph/
│ │ │ ├── README.md
│ │ │ ├── data/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── dataloader.py
│ │ │ │ ├── object.py
│ │ │ │ ├── prepare_visualgenome.py
│ │ │ │ └── relation.py
│ │ │ ├── demo_reldn.py
│ │ │ ├── model/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── faster_rcnn.py
│ │ │ │ └── reldn.py
│ │ │ ├── train_faster_rcnn.py
│ │ │ ├── train_faster_rcnn.sh
│ │ │ ├── train_freq_prior.py
│ │ │ ├── train_reldn.py
│ │ │ ├── train_reldn.sh
│ │ │ ├── utils/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── build_graph.py
│ │ │ │ ├── metric.py
│ │ │ │ ├── sampling.py
│ │ │ │ └── viz.py
│ │ │ ├── validate_reldn.py
│ │ │ └── validate_reldn.sh
│ │ ├── sgc/
│ │ │ ├── README.md
│ │ │ └── sgc.py
│ │ ├── tagcn/
│ │ │ ├── README.md
│ │ │ ├── tagcn.py
│ │ │ └── train.py
│ │ └── tree_lstm/
│ │ ├── README.md
│ │ ├── train.py
│ │ └── tree_lstm.py
│ ├── pytorch/
│ │ ├── GATNE-T/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ ├── scripts/
│ │ │ │ ├── run_example.sh
│ │ │ │ ├── run_example_sparse.sh
│ │ │ │ └── run_example_sparse_multi_gpus.sh
│ │ │ └── src/
│ │ │ ├── main.py
│ │ │ ├── main_sparse.py
│ │ │ ├── main_sparse_multi_gpus.py
│ │ │ └── utils.py
│ │ ├── GNN-FiLM/
│ │ │ ├── README.md
│ │ │ ├── data_loader.py
│ │ │ ├── main.py
│ │ │ └── utils.py
│ │ ├── NGCF/
│ │ │ ├── Data/
│ │ │ │ ├── load_amazon-book.sh
│ │ │ │ └── load_gowalla.sh
│ │ │ ├── NGCF/
│ │ │ │ ├── main.py
│ │ │ │ ├── model.py
│ │ │ │ └── utility/
│ │ │ │ ├── batch_test.py
│ │ │ │ ├── helper.py
│ │ │ │ ├── load_data.py
│ │ │ │ ├── metrics.py
│ │ │ │ └── parser.py
│ │ │ └── README.md
│ │ ├── P-GNN/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ └── utils.py
│ │ ├── TAHIN/
│ │ │ ├── TAHIN.py
│ │ │ ├── data_loader.py
│ │ │ ├── main.py
│ │ │ ├── readme.md
│ │ │ └── utils.py
│ │ ├── appnp/
│ │ │ ├── README.md
│ │ │ ├── appnp.py
│ │ │ └── train.py
│ │ ├── argo/
│ │ │ ├── README.md
│ │ │ ├── argo.py
│ │ │ ├── main.py
│ │ │ ├── ogb_example.py
│ │ │ └── ogb_example_ARGO.py
│ │ ├── arma/
│ │ │ ├── README.md
│ │ │ ├── citation.py
│ │ │ └── model.py
│ │ ├── bgnn/
│ │ │ ├── BGNN.py
│ │ │ ├── Readme.md
│ │ │ └── run.py
│ │ ├── bgrl/
│ │ │ ├── README.md
│ │ │ ├── eval_function.py
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ └── utils.py
│ │ ├── capsule/
│ │ │ ├── DGLDigitCapsule.py
│ │ │ ├── DGLRoutingLayer.py
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ └── simple_routing.py
│ │ ├── caregnn/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ ├── main_sampling.py
│ │ │ ├── model.py
│ │ │ ├── model_sampling.py
│ │ │ └── utils.py
│ │ ├── cluster_gcn/
│ │ │ ├── README.md
│ │ │ └── cluster_gcn.py
│ │ ├── compGCN/
│ │ │ ├── README.md
│ │ │ ├── data_loader.py
│ │ │ ├── get_fb15k-237.sh
│ │ │ ├── get_wn18rr.sh
│ │ │ ├── main.py
│ │ │ ├── models.py
│ │ │ └── utils.py
│ │ ├── correct_and_smooth/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ └── model.py
│ │ ├── dagnn/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ └── utils.py
│ │ ├── deepergcn/
│ │ │ ├── README.md
│ │ │ ├── layers.py
│ │ │ ├── main.py
│ │ │ ├── models.py
│ │ │ └── modules.py
│ │ ├── deepwalk/
│ │ │ └── README.md
│ │ ├── dgi/
│ │ │ ├── README.md
│ │ │ ├── dgi.py
│ │ │ ├── gcn.py
│ │ │ └── train.py
│ │ ├── dgmg/
│ │ │ ├── README.md
│ │ │ ├── configure.py
│ │ │ ├── cycles.py
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ └── utils.py
│ │ ├── diffpool/
│ │ │ ├── README.md
│ │ │ ├── data_utils.py
│ │ │ ├── model/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── dgl_layers/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── aggregator.py
│ │ │ │ │ ├── bundler.py
│ │ │ │ │ └── gnn.py
│ │ │ │ ├── encoder.py
│ │ │ │ ├── loss.py
│ │ │ │ ├── model_utils.py
│ │ │ │ └── tensorized_layers/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── assignment.py
│ │ │ │ ├── diffpool.py
│ │ │ │ └── graphsage.py
│ │ │ └── train.py
│ │ ├── dimenet/
│ │ │ ├── README.md
│ │ │ ├── config/
│ │ │ │ ├── convert.yaml
│ │ │ │ ├── dimenet.yaml
│ │ │ │ └── dimenet_pp.yaml
│ │ │ ├── convert_tf_ckpt_to_pytorch.py
│ │ │ ├── main.py
│ │ │ ├── modules/
│ │ │ │ ├── activations.py
│ │ │ │ ├── basis_utils.py
│ │ │ │ ├── bessel_basis_layer.py
│ │ │ │ ├── dimenet.py
│ │ │ │ ├── dimenet_pp.py
│ │ │ │ ├── embedding_block.py
│ │ │ │ ├── envelope.py
│ │ │ │ ├── initializers.py
│ │ │ │ ├── interaction_block.py
│ │ │ │ ├── interaction_pp_block.py
│ │ │ │ ├── output_block.py
│ │ │ │ ├── output_pp_block.py
│ │ │ │ ├── residual_layer.py
│ │ │ │ └── spherical_basis_layer.py
│ │ │ └── qm9.py
│ │ ├── dtgrnn/
│ │ │ ├── README.md
│ │ │ ├── dataloading.py
│ │ │ ├── dcrnn.py
│ │ │ ├── gaan.py
│ │ │ ├── model.py
│ │ │ ├── train.py
│ │ │ └── utils.py
│ │ ├── eeg-gcnn/
│ │ │ ├── EEGGraphDataset.py
│ │ │ ├── README.md
│ │ │ ├── deep_EEGGraphConvNet.py
│ │ │ ├── main.py
│ │ │ └── shallow_EEGGraphConvNet.py
│ │ ├── eges/
│ │ │ ├── .gitignore
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ ├── sampler.py
│ │ │ └── utils.py
│ │ ├── evolveGCN/
│ │ │ ├── README.md
│ │ │ ├── dataset.py
│ │ │ ├── model.py
│ │ │ ├── train.py
│ │ │ └── utils.py
│ │ ├── gas/
│ │ │ ├── README.md
│ │ │ ├── dataloader.py
│ │ │ ├── main.py
│ │ │ ├── main_sampling.py
│ │ │ ├── model.py
│ │ │ └── model_sampling.py
│ │ ├── gat/
│ │ │ ├── README.md
│ │ │ ├── train.py
│ │ │ └── train_ppi.py
│ │ ├── gatv2/
│ │ │ ├── README.md
│ │ │ ├── gatv2.py
│ │ │ └── train.py
│ │ ├── gcmc/
│ │ │ ├── README.md
│ │ │ ├── data.py
│ │ │ ├── model.py
│ │ │ ├── train.py
│ │ │ ├── train_sampling.py
│ │ │ └── utils.py
│ │ ├── gcn/
│ │ │ ├── README.md
│ │ │ └── train.py
│ │ ├── geniepath/
│ │ │ ├── README.md
│ │ │ ├── model.py
│ │ │ ├── ppi.py
│ │ │ └── pubmed.py
│ │ ├── ggnn/
│ │ │ ├── README.md
│ │ │ ├── data_utils.py
│ │ │ ├── ggnn_gc.py
│ │ │ ├── ggnn_ns.py
│ │ │ ├── ggsnn.py
│ │ │ ├── train_gc.py
│ │ │ ├── train_ns.py
│ │ │ └── train_path_finding.py
│ │ ├── gin/
│ │ │ ├── README.md
│ │ │ └── train.py
│ │ ├── gnn_explainer/
│ │ │ ├── README.md
│ │ │ ├── explain_main.py
│ │ │ ├── gnn_subgraph/
│ │ │ │ ├── 1/
│ │ │ │ │ ├── graph.json
│ │ │ │ │ ├── model_list.json
│ │ │ │ │ ├── subgraph_1.json
│ │ │ │ │ └── subgraph_list.json
│ │ │ │ └── dataset_list.json
│ │ │ ├── models.py
│ │ │ └── train_main.py
│ │ ├── grace/
│ │ │ ├── README.md
│ │ │ ├── aug.py
│ │ │ ├── dataset.py
│ │ │ ├── eval.py
│ │ │ ├── main.py
│ │ │ └── model.py
│ │ ├── grand/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ └── model.py
│ │ ├── graph_matching/
│ │ │ ├── README.md
│ │ │ ├── examples.py
│ │ │ └── ged.py
│ │ ├── graphsage/
│ │ │ ├── README.md
│ │ │ ├── advanced/
│ │ │ │ ├── README.md
│ │ │ │ ├── model.py
│ │ │ │ ├── negative_sampler.py
│ │ │ │ └── train_lightning_unsupervised.py
│ │ │ ├── lightning/
│ │ │ │ └── node_classification.py
│ │ │ ├── link_pred.py
│ │ │ ├── load_graph.py
│ │ │ ├── node_classification.py
│ │ │ └── train_full.py
│ │ ├── graphsaint/
│ │ │ ├── README.md
│ │ │ ├── config.py
│ │ │ ├── modules.py
│ │ │ ├── sampler.py
│ │ │ ├── train_sampling.py
│ │ │ └── utils.py
│ │ ├── graphsim/
│ │ │ ├── README.md
│ │ │ ├── dataloader.py
│ │ │ ├── models.py
│ │ │ ├── n_body_sim.py
│ │ │ ├── train.py
│ │ │ └── utils.py
│ │ ├── graphwriter/
│ │ │ ├── README.md
│ │ │ ├── graphwriter.py
│ │ │ ├── modules.py
│ │ │ ├── opts.py
│ │ │ ├── prepare_data.sh
│ │ │ ├── run.sh
│ │ │ ├── test.sh
│ │ │ ├── train.py
│ │ │ └── utlis.py
│ │ ├── gxn/
│ │ │ ├── README.md
│ │ │ ├── data_preprocess.py
│ │ │ ├── layers.py
│ │ │ ├── main.py
│ │ │ ├── main_early_stop.py
│ │ │ ├── networks.py
│ │ │ ├── scripts/
│ │ │ │ ├── run_gxn.sh
│ │ │ │ └── run_gxn_early_stop.sh
│ │ │ └── utils.py
│ │ ├── han/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ ├── model_hetero.py
│ │ │ ├── train_sampling.py
│ │ │ └── utils.py
│ │ ├── hardgat/
│ │ │ ├── README.md
│ │ │ ├── hgao.py
│ │ │ ├── train.py
│ │ │ └── utils.py
│ │ ├── hgp_sl/
│ │ │ ├── README.md
│ │ │ ├── functions.py
│ │ │ ├── layers.py
│ │ │ ├── main.py
│ │ │ ├── networks.py
│ │ │ └── utils.py
│ │ ├── hgt/
│ │ │ ├── README.md
│ │ │ ├── model.py
│ │ │ └── train_acm.py
│ │ ├── hilander/
│ │ │ ├── PSS/
│ │ │ │ ├── README.md
│ │ │ │ ├── Smooth_AP/
│ │ │ │ │ ├── README.md
│ │ │ │ │ └── src/
│ │ │ │ │ ├── auxiliaries.py
│ │ │ │ │ ├── datasets.py
│ │ │ │ │ ├── evaluate.py
│ │ │ │ │ ├── evaluate_model.py
│ │ │ │ │ ├── finetune_1head.py
│ │ │ │ │ ├── get_features.py
│ │ │ │ │ ├── losses.py
│ │ │ │ │ ├── main.py
│ │ │ │ │ └── netlib.py
│ │ │ │ ├── __init__.py
│ │ │ │ ├── test.sh
│ │ │ │ ├── test_subg_inat.py
│ │ │ │ ├── train.sh
│ │ │ │ └── train_subg_inat.py
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── checkpoint/
│ │ │ │ └── .gitkeep
│ │ │ ├── data/
│ │ │ │ └── .gitkeep
│ │ │ ├── models/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── focal_loss.py
│ │ │ │ ├── graphconv.py
│ │ │ │ └── lander.py
│ │ │ ├── scripts/
│ │ │ │ ├── test_deepglint_hannah.sh
│ │ │ │ ├── test_deepglint_imdb.sh
│ │ │ │ ├── test_deepglint_imdb_sampled_as_deepglint.sh
│ │ │ │ ├── test_inat.sh
│ │ │ │ ├── test_inat_train_on_resampled_1_in_6_per_class.sh
│ │ │ │ ├── train_deepglint.sh
│ │ │ │ ├── train_inat.sh
│ │ │ │ └── train_inat_resampled_1_in_6_per_class.sh
│ │ │ ├── test.py
│ │ │ ├── test_subg.py
│ │ │ ├── train.py
│ │ │ ├── train_subg.py
│ │ │ └── utils/
│ │ │ ├── __init__.py
│ │ │ ├── adjacency.py
│ │ │ ├── deduce.py
│ │ │ ├── density.py
│ │ │ ├── evaluate.py
│ │ │ ├── faiss_gpu.py
│ │ │ ├── faiss_search.py
│ │ │ ├── knn.py
│ │ │ ├── metrics.py
│ │ │ └── misc.py
│ │ ├── infograph/
│ │ │ ├── README.md
│ │ │ ├── evaluate_embedding.py
│ │ │ ├── model.py
│ │ │ ├── semisupervised.py
│ │ │ ├── unsupervised.py
│ │ │ └── utils.py
│ │ ├── jknet/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ └── model.py
│ │ ├── jtnn/
│ │ │ ├── README.md
│ │ │ ├── jtnn/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── chemutils.py
│ │ │ │ ├── datautils.py
│ │ │ │ ├── jtmpn.py
│ │ │ │ ├── jtnn_dec.py
│ │ │ │ ├── jtnn_enc.py
│ │ │ │ ├── jtnn_vae.py
│ │ │ │ ├── line_profiler_integration.py
│ │ │ │ ├── mol_tree.py
│ │ │ │ ├── mol_tree_nx.py
│ │ │ │ ├── mpn.py
│ │ │ │ └── nnutils.py
│ │ │ └── vaetrain_dgl.py
│ │ ├── label_propagation/
│ │ │ ├── README.md
│ │ │ └── main.py
│ │ ├── labor/
│ │ │ ├── README.md
│ │ │ ├── ladies_sampler.py
│ │ │ ├── load_graph.py
│ │ │ ├── model.py
│ │ │ └── train_lightning.py
│ │ ├── lda/
│ │ │ ├── README.md
│ │ │ ├── example_20newsgroups.py
│ │ │ └── lda_model.py
│ │ ├── line_graph/
│ │ │ ├── README.md
│ │ │ ├── gnn.py
│ │ │ └── train.py
│ │ ├── metapath2vec/
│ │ │ ├── README.md
│ │ │ ├── download.py
│ │ │ ├── metapath2vec.py
│ │ │ ├── model.py
│ │ │ ├── reading_data.py
│ │ │ ├── sampler.py
│ │ │ └── test.py
│ │ ├── mixhop/
│ │ │ ├── README.md
│ │ │ └── main.py
│ │ ├── model_zoo/
│ │ │ ├── README.md
│ │ │ ├── citation_network/
│ │ │ │ ├── README.md
│ │ │ │ ├── conf.py
│ │ │ │ ├── models.py
│ │ │ │ └── run.py
│ │ │ └── geometric/
│ │ │ ├── .gitignore
│ │ │ ├── README.md
│ │ │ ├── coarsening.py
│ │ │ ├── coordinate.py
│ │ │ ├── grid_graph.py
│ │ │ └── mnist.py
│ │ ├── monet/
│ │ │ ├── README.md
│ │ │ └── citation.py
│ │ ├── multigpu/
│ │ │ ├── README.md
│ │ │ ├── multi_gpu_graph_prediction.py
│ │ │ ├── multi_gpu_link_prediction.py
│ │ │ └── multi_gpu_node_classification.py
│ │ ├── mvgrl/
│ │ │ ├── README.md
│ │ │ ├── graph/
│ │ │ │ ├── dataset.py
│ │ │ │ ├── main.py
│ │ │ │ ├── model.py
│ │ │ │ └── utils.py
│ │ │ └── node/
│ │ │ ├── dataset.py
│ │ │ ├── main.py
│ │ │ ├── main_sample.py
│ │ │ └── model.py
│ │ ├── node2vec/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ └── utils.py
│ │ ├── ogb/
│ │ │ ├── README.md
│ │ │ ├── cluster-gat/
│ │ │ │ ├── README.md
│ │ │ │ ├── main.py
│ │ │ │ ├── partition_utils.py
│ │ │ │ └── sampler.py
│ │ │ ├── cluster-sage/
│ │ │ │ ├── README.md
│ │ │ │ ├── main.py
│ │ │ │ ├── partition_utils.py
│ │ │ │ └── sampler.py
│ │ │ ├── deepwalk/
│ │ │ │ ├── README.md
│ │ │ │ ├── deepwalk.py
│ │ │ │ ├── load_dataset.py
│ │ │ │ ├── model.py
│ │ │ │ ├── reading_data.py
│ │ │ │ └── utils.py
│ │ │ ├── directional_GSN/
│ │ │ │ ├── README.md
│ │ │ │ ├── main.py
│ │ │ │ └── preprocessing.py
│ │ │ ├── line/
│ │ │ │ ├── README.md
│ │ │ │ ├── line.py
│ │ │ │ ├── load_dataset.py
│ │ │ │ ├── model.py
│ │ │ │ ├── reading_data.py
│ │ │ │ └── utils.py
│ │ │ ├── ngnn/
│ │ │ │ ├── README.md
│ │ │ │ └── main.py
│ │ │ ├── ngnn_seal/
│ │ │ │ ├── README.md
│ │ │ │ ├── main.py
│ │ │ │ ├── models.py
│ │ │ │ └── utils.py
│ │ │ ├── ogbn-arxiv/
│ │ │ │ ├── README.md
│ │ │ │ ├── correct_and_smooth.py
│ │ │ │ ├── gat.py
│ │ │ │ ├── gcn.py
│ │ │ │ └── models.py
│ │ │ ├── ogbn-mag/
│ │ │ │ ├── README.md
│ │ │ │ └── hetero_rgcn.py
│ │ │ ├── ogbn-products/
│ │ │ │ ├── gat/
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── gat.py
│ │ │ │ │ ├── main.py
│ │ │ │ │ └── models.py
│ │ │ │ ├── graphsage/
│ │ │ │ │ ├── README.md
│ │ │ │ │ └── main.py
│ │ │ │ └── mlp/
│ │ │ │ ├── README.md
│ │ │ │ ├── mlp.py
│ │ │ │ └── models.py
│ │ │ ├── ogbn-proteins/
│ │ │ │ ├── README.md
│ │ │ │ ├── configure.py
│ │ │ │ ├── gat.py
│ │ │ │ ├── main_proteins_full_dgl.py
│ │ │ │ ├── models.py
│ │ │ │ └── utils.py
│ │ │ ├── seal_ogbl/
│ │ │ │ ├── README.md
│ │ │ │ └── main.py
│ │ │ └── sign/
│ │ │ ├── .gitignore
│ │ │ ├── README.md
│ │ │ ├── dataset.py
│ │ │ └── sign.py
│ │ ├── ogb_lsc/
│ │ │ ├── MAG240M/
│ │ │ │ ├── README.md
│ │ │ │ ├── preprocess.py
│ │ │ │ ├── train.py
│ │ │ │ └── train_multi_gpus.py
│ │ │ ├── PCQM4M/
│ │ │ │ ├── README.md
│ │ │ │ ├── conv.py
│ │ │ │ ├── gnn.py
│ │ │ │ ├── main.py
│ │ │ │ └── test_inference.py
│ │ │ └── README.md
│ │ ├── ogc/
│ │ │ ├── README.md
│ │ │ ├── ogc.py
│ │ │ ├── train.py
│ │ │ └── utils.py
│ │ ├── pagerank.py
│ │ ├── pinsage/
│ │ │ ├── README.md
│ │ │ ├── builder.py
│ │ │ ├── data_utils.py
│ │ │ ├── evaluation.py
│ │ │ ├── layers.py
│ │ │ ├── model.py
│ │ │ ├── model_sparse.py
│ │ │ ├── process_movielens1m.py
│ │ │ ├── process_nowplaying_rs.py
│ │ │ └── sampler.py
│ │ ├── pointcloud/
│ │ │ ├── bipointnet/
│ │ │ │ ├── ModelNetDataLoader.py
│ │ │ │ ├── README.md
│ │ │ │ ├── basic.py
│ │ │ │ ├── bipointnet2.py
│ │ │ │ ├── bipointnet_cls.py
│ │ │ │ └── train_cls.py
│ │ │ ├── edgeconv/
│ │ │ │ ├── README.md
│ │ │ │ ├── main.py
│ │ │ │ ├── model.py
│ │ │ │ └── modelnet.py
│ │ │ ├── pct/
│ │ │ │ ├── ModelNetDataLoader.py
│ │ │ │ ├── README.md
│ │ │ │ ├── ShapeNet.py
│ │ │ │ ├── helper.py
│ │ │ │ ├── pct.py
│ │ │ │ ├── provider.py
│ │ │ │ ├── train_cls.py
│ │ │ │ └── train_partseg.py
│ │ │ ├── point_transformer/
│ │ │ │ ├── ModelNetDataLoader.py
│ │ │ │ ├── README.md
│ │ │ │ ├── ShapeNet.py
│ │ │ │ ├── helper.py
│ │ │ │ ├── point_transformer.py
│ │ │ │ ├── provider.py
│ │ │ │ ├── train_cls.py
│ │ │ │ └── train_partseg.py
│ │ │ └── pointnet/
│ │ │ ├── ModelNetDataLoader.py
│ │ │ ├── README.md
│ │ │ ├── ShapeNet.py
│ │ │ ├── pointnet2.py
│ │ │ ├── pointnet2_partseg.py
│ │ │ ├── pointnet_cls.py
│ │ │ ├── pointnet_partseg.py
│ │ │ ├── provider.py
│ │ │ ├── train_cls.py
│ │ │ └── train_partseg.py
│ │ ├── rect/
│ │ │ ├── README.md
│ │ │ ├── classify.py
│ │ │ ├── label_utils.py
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ └── utils.py
│ │ ├── rgat/
│ │ │ ├── README.md
│ │ │ └── train.py
│ │ ├── rgcn/
│ │ │ ├── README.md
│ │ │ ├── entity.py
│ │ │ ├── entity_sample.py
│ │ │ ├── entity_sample_multi_gpu.py
│ │ │ ├── entity_utils.py
│ │ │ ├── experimental/
│ │ │ │ ├── README.md
│ │ │ │ ├── entity_classify_dist.py
│ │ │ │ ├── get_mag_data.py
│ │ │ │ ├── partition_graph.py
│ │ │ │ ├── preprocessing_dist_training/
│ │ │ │ │ ├── edges/
│ │ │ │ │ │ ├── identity1/
│ │ │ │ │ │ │ └── sample.csv
│ │ │ │ │ │ ├── identity2/
│ │ │ │ │ │ │ └── sample.csv
│ │ │ │ │ │ └── identity3/
│ │ │ │ │ │ └── sample.csv
│ │ │ │ │ ├── metis_creation.py
│ │ │ │ │ ├── nodes/
│ │ │ │ │ │ └── order/
│ │ │ │ │ │ └── sample.csv
│ │ │ │ │ └── pre_process_dist_training.sh
│ │ │ │ ├── verify_mag_partitions.py
│ │ │ │ └── write_mag.py
│ │ │ ├── link.py
│ │ │ └── model.py
│ │ ├── rgcn-hetero/
│ │ │ ├── .gitignore
│ │ │ ├── README.md
│ │ │ ├── entity_classify.py
│ │ │ ├── entity_classify_heteroAPI.py
│ │ │ ├── entity_classify_mb.py
│ │ │ ├── model.py
│ │ │ └── test_classify.py
│ │ ├── rrn/
│ │ │ ├── README.md
│ │ │ ├── ckpt/
│ │ │ │ └── rrn-sudoku.pkl
│ │ │ ├── rrn.py
│ │ │ ├── sudoku.py
│ │ │ ├── sudoku_data.py
│ │ │ ├── sudoku_solver.py
│ │ │ └── train_sudoku.py
│ │ ├── sagpool/
│ │ │ ├── README.md
│ │ │ ├── grid_search.py
│ │ │ ├── grid_search_config.json
│ │ │ ├── layer.py
│ │ │ ├── main.py
│ │ │ ├── network.py
│ │ │ └── utils.py
│ │ ├── seal/
│ │ │ ├── README.md
│ │ │ ├── logger.py
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ ├── sampler.py
│ │ │ └── utils.py
│ │ ├── sgc/
│ │ │ ├── README.md
│ │ │ ├── sgc.py
│ │ │ └── sgc_reddit.py
│ │ ├── sign/
│ │ │ ├── README.md
│ │ │ ├── dataset.py
│ │ │ └── sign.py
│ │ ├── stgcn_wave/
│ │ │ ├── README.md
│ │ │ ├── load_data.py
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ ├── sensors2graph.py
│ │ │ └── utils.py
│ │ ├── tagcn/
│ │ │ ├── README.md
│ │ │ ├── tagcn.py
│ │ │ └── train.py
│ │ ├── tgn/
│ │ │ └── README.md
│ │ ├── tree_lstm/
│ │ │ ├── README.md
│ │ │ ├── train.py
│ │ │ └── tree_lstm.py
│ │ ├── vgae/
│ │ │ ├── README.md
│ │ │ ├── input_data.py
│ │ │ ├── model.py
│ │ │ ├── preprocess.py
│ │ │ └── train.py
│ │ └── vrgcn/
│ │ ├── README.md
│ │ ├── train_cv.py
│ │ └── train_cv_multi_gpu.py
│ ├── sparse/
│ │ ├── appnp.py
│ │ ├── c_and_s.py
│ │ ├── gat.py
│ │ ├── gcn.py
│ │ ├── gcnii.py
│ │ ├── graph_transformer.py
│ │ ├── han.py
│ │ ├── hetero-rgcn.py
│ │ ├── hgnn.py
│ │ ├── hypergraphatt.py
│ │ ├── pagerank.py
│ │ ├── sampling/
│ │ │ ├── graphsage.py
│ │ │ └── ladies.py
│ │ ├── sgc.py
│ │ ├── sign.py
│ │ └── twirls.py
│ └── tensorflow/
│ ├── dgi/
│ │ ├── README.md
│ │ ├── dgi.py
│ │ ├── gcn.py
│ │ └── train.py
│ ├── gat/
│ │ ├── README.md
│ │ ├── gat.py
│ │ ├── train.py
│ │ └── utils.py
│ ├── gcn/
│ │ ├── README.md
│ │ ├── gcn.py
│ │ ├── gcn_builtin.py
│ │ ├── gcn_mp.py
│ │ └── train.py
│ ├── rgcn/
│ │ ├── README.md
│ │ ├── entity_classify.py
│ │ ├── model.py
│ │ └── utils.py
│ └── sgc/
│ ├── README.md
│ └── sgc.py
├── graphbolt/
│ ├── CMakeLists.txt
│ ├── build.bat
│ ├── build.sh
│ ├── find_cmake.py
│ ├── include/
│ │ └── graphbolt/
│ │ ├── async.h
│ │ ├── continuous_seed.h
│ │ ├── cuda_ops.h
│ │ ├── cuda_sampling_ops.h
│ │ ├── fused_csc_sampling_graph.h
│ │ ├── fused_sampled_subgraph.h
│ │ ├── isin.h
│ │ ├── serialize.h
│ │ ├── shared_memory.h
│ │ └── unique_and_compact.h
│ └── src/
│ ├── cache_policy.cc
│ ├── cache_policy.h
│ ├── circular_queue.h
│ ├── cnumpy.cc
│ ├── cnumpy.h
│ ├── concurrent_id_hash_map.cc
│ ├── concurrent_id_hash_map.h
│ ├── cuda/
│ │ ├── common.h
│ │ ├── cooperative_minibatching_utils.cu
│ │ ├── cooperative_minibatching_utils.cuh
│ │ ├── cooperative_minibatching_utils.h
│ │ ├── cumsum.cu
│ │ ├── expand_indptr.cu
│ │ ├── extension/
│ │ │ ├── gpu_cache.cu
│ │ │ ├── gpu_cache.h
│ │ │ ├── gpu_graph_cache.cu
│ │ │ ├── gpu_graph_cache.h
│ │ │ ├── unique_and_compact.h
│ │ │ └── unique_and_compact_map.cu
│ │ ├── gather.cu
│ │ ├── index_select_csc_impl.cu
│ │ ├── index_select_impl.cu
│ │ ├── insubgraph.cu
│ │ ├── isin.cu
│ │ ├── max_uva_threads.cc
│ │ ├── max_uva_threads.h
│ │ ├── neighbor_sampler.cu
│ │ ├── sampling_utils.cu
│ │ ├── sort_impl.cu
│ │ ├── unique_and_compact_impl.cu
│ │ └── utils.h
│ ├── expand_indptr.cc
│ ├── expand_indptr.h
│ ├── feature_cache.cc
│ ├── feature_cache.h
│ ├── fused_csc_sampling_graph.cc
│ ├── index_select.cc
│ ├── index_select.h
│ ├── io_uring.cc
│ ├── io_uring.h
│ ├── isin.cc
│ ├── macro.h
│ ├── partitioned_cache_policy.cc
│ ├── partitioned_cache_policy.h
│ ├── python_binding.cc
│ ├── random.cc
│ ├── random.h
│ ├── serialize.cc
│ ├── shared_memory.cc
│ ├── shared_memory_helper.cc
│ ├── shared_memory_helper.h
│ ├── unique_and_compact.cc
│ ├── utils.cc
│ └── utils.h
├── include/
│ └── dgl/
│ ├── array.h
│ ├── array_iterator.h
│ ├── aten/
│ │ ├── array_ops.h
│ │ ├── coo.h
│ │ ├── csr.h
│ │ ├── macro.h
│ │ ├── spmat.h
│ │ └── types.h
│ ├── base_heterograph.h
│ ├── bcast.h
│ ├── env_variable.h
│ ├── graph.h
│ ├── graph_interface.h
│ ├── graph_op.h
│ ├── graph_serializer.h
│ ├── graph_traversal.h
│ ├── immutable_graph.h
│ ├── kernel.h
│ ├── lazy.h
│ ├── nodeflow.h
│ ├── packed_func_ext.h
│ ├── random.h
│ ├── runtime/
│ │ ├── bfloat16.h
│ │ ├── c_backend_api.h
│ │ ├── c_object_api.h
│ │ ├── c_runtime_api.h
│ │ ├── config.h
│ │ ├── container.h
│ │ ├── device_api.h
│ │ ├── dlpack_convert.h
│ │ ├── module.h
│ │ ├── ndarray.h
│ │ ├── object.h
│ │ ├── packed_func.h
│ │ ├── parallel_for.h
│ │ ├── registry.h
│ │ ├── serializer.h
│ │ ├── shared_mem.h
│ │ ├── smart_ptr_serializer.h
│ │ ├── tensordispatch.h
│ │ ├── threading_backend.h
│ │ └── util.h
│ ├── sampler.h
│ ├── sampling/
│ │ ├── negative.h
│ │ ├── neighbor.h
│ │ └── randomwalks.h
│ ├── scheduler.h
│ ├── transform.h
│ └── zerocopy_serializer.h
├── notebooks/
│ ├── graphbolt/
│ │ └── walkthrough.ipynb
│ ├── sparse/
│ │ ├── gcn.ipynb
│ │ ├── graph_diffusion.ipynb
│ │ ├── graph_transformer.ipynb
│ │ ├── hgnn.ipynb
│ │ └── quickstart.ipynb
│ └── stochastic_training/
│ ├── link_prediction.ipynb
│ ├── multigpu_node_classification.ipynb
│ ├── neighbor_sampling_overview.ipynb
│ ├── node_classification.ipynb
│ ├── ondisk_dataset_heterograph.ipynb
│ └── ondisk_dataset_homograph.ipynb
├── pyproject.toml
├── python/
│ ├── dgl/
│ │ ├── __init__.py
│ │ ├── _api_internal.py
│ │ ├── _ffi/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── _ctypes/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── function.py
│ │ │ │ ├── ndarray.py
│ │ │ │ ├── object.py
│ │ │ │ └── types.py
│ │ │ ├── _cy2/
│ │ │ │ └── __init__.py
│ │ │ ├── _cy3/
│ │ │ │ └── __init__.py
│ │ │ ├── _cython/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── base.pxi
│ │ │ │ ├── core.pyx
│ │ │ │ ├── function.pxi
│ │ │ │ ├── ndarray.pxi
│ │ │ │ └── object.pxi
│ │ │ ├── base.py
│ │ │ ├── capi.py
│ │ │ ├── function.py
│ │ │ ├── libinfo.py
│ │ │ ├── ndarray.py
│ │ │ ├── object.py
│ │ │ ├── object_generic.py
│ │ │ ├── runtime_ctypes.py
│ │ │ └── streams.py
│ │ ├── _sparse_ops.py
│ │ ├── backend/
│ │ │ ├── __init__.py
│ │ │ ├── backend.py
│ │ │ ├── mxnet/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── sparse.py
│ │ │ │ ├── sparse_optim.py
│ │ │ │ └── tensor.py
│ │ │ ├── pytorch/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── sparse.py
│ │ │ │ └── tensor.py
│ │ │ ├── set_default_backend.py
│ │ │ └── tensorflow/
│ │ │ ├── __init__.py
│ │ │ ├── sparse.py
│ │ │ ├── sparse_optim.py
│ │ │ └── tensor.py
│ │ ├── base.py
│ │ ├── batch.py
│ │ ├── container.py
│ │ ├── convert.py
│ │ ├── core.py
│ │ ├── cuda/
│ │ │ ├── __init__.py
│ │ │ ├── gpu_cache.py
│ │ │ └── nccl.py
│ │ ├── data/
│ │ │ ├── __init__.py
│ │ │ ├── actor.py
│ │ │ ├── adapter.py
│ │ │ ├── bitcoinotc.py
│ │ │ ├── citation_graph.py
│ │ │ ├── cluster.py
│ │ │ ├── csv_dataset.py
│ │ │ ├── csv_dataset_base.py
│ │ │ ├── dgl_dataset.py
│ │ │ ├── fakenews.py
│ │ │ ├── flickr.py
│ │ │ ├── fraud.py
│ │ │ ├── gdelt.py
│ │ │ ├── geom_gcn.py
│ │ │ ├── gindt.py
│ │ │ ├── gnn_benchmark.py
│ │ │ ├── graph_serialize.py
│ │ │ ├── heterograph_serialize.py
│ │ │ ├── heterophilous_graphs.py
│ │ │ ├── icews18.py
│ │ │ ├── karate.py
│ │ │ ├── knowledge_graph.py
│ │ │ ├── lrgb.py
│ │ │ ├── minigc.py
│ │ │ ├── movielens.py
│ │ │ ├── pattern.py
│ │ │ ├── ppi.py
│ │ │ ├── qm7b.py
│ │ │ ├── qm9.py
│ │ │ ├── qm9_edge.py
│ │ │ ├── rdf.py
│ │ │ ├── reddit.py
│ │ │ ├── sbm.py
│ │ │ ├── superpixel.py
│ │ │ ├── synthetic.py
│ │ │ ├── tensor_serialize.py
│ │ │ ├── tree.py
│ │ │ ├── tu.py
│ │ │ ├── utils.py
│ │ │ ├── wikics.py
│ │ │ ├── yelp.py
│ │ │ └── zinc.py
│ │ ├── dataloading/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── capped_neighbor_sampler.py
│ │ │ ├── cluster_gcn.py
│ │ │ ├── dataloader.py
│ │ │ ├── graphsaint.py
│ │ │ ├── labor_sampler.py
│ │ │ ├── negative_sampler.py
│ │ │ ├── neighbor_sampler.py
│ │ │ ├── shadow.py
│ │ │ └── spot_target.py
│ │ ├── distgnn/
│ │ │ ├── __init__.py
│ │ │ ├── partition/
│ │ │ │ ├── __init__.py
│ │ │ │ └── libra_partition.py
│ │ │ └── tools/
│ │ │ ├── __init__.py
│ │ │ └── tools.py
│ │ ├── distributed/
│ │ │ ├── __init__.py
│ │ │ ├── constants.py
│ │ │ ├── dist_context.py
│ │ │ ├── dist_dataloader.py
│ │ │ ├── dist_graph.py
│ │ │ ├── dist_tensor.py
│ │ │ ├── graph_partition_book.py
│ │ │ ├── graph_services.py
│ │ │ ├── id_map.py
│ │ │ ├── kvstore.py
│ │ │ ├── nn/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── mxnet/
│ │ │ │ │ └── __init__.py
│ │ │ │ ├── pytorch/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── sparse_emb.py
│ │ │ │ └── tensorflow/
│ │ │ │ └── __init__.py
│ │ │ ├── optim/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── mxnet/
│ │ │ │ │ └── __init__.py
│ │ │ │ ├── pytorch/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── sparse_optim.py
│ │ │ │ │ └── utils.py
│ │ │ │ └── tensorflow/
│ │ │ │ └── __init__.py
│ │ │ ├── partition.py
│ │ │ ├── role.py
│ │ │ ├── rpc.py
│ │ │ ├── rpc_client.py
│ │ │ ├── rpc_server.py
│ │ │ ├── server_state.py
│ │ │ ├── shared_mem_utils.py
│ │ │ └── standalone_kvstore.py
│ │ ├── frame.py
│ │ ├── function/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── message.py
│ │ │ └── reducer.py
│ │ ├── generators.py
│ │ ├── geometry/
│ │ │ ├── __init__.py
│ │ │ ├── capi.py
│ │ │ ├── edge_coarsening.py
│ │ │ └── fps.py
│ │ ├── global_config.py
│ │ ├── graph_index.py
│ │ ├── graphbolt/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── dataloader.py
│ │ │ ├── datapipes/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── utils.py
│ │ │ │ └── visualization.py
│ │ │ ├── dataset.py
│ │ │ ├── external_utils.py
│ │ │ ├── feature_fetcher.py
│ │ │ ├── feature_store.py
│ │ │ ├── impl/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── basic_feature_store.py
│ │ │ │ ├── cooperative_conv.py
│ │ │ │ ├── cpu_cached_feature.py
│ │ │ │ ├── cpu_feature_cache.py
│ │ │ │ ├── fused_csc_sampling_graph.py
│ │ │ │ ├── gpu_cached_feature.py
│ │ │ │ ├── gpu_feature_cache.py
│ │ │ │ ├── gpu_graph_cache.py
│ │ │ │ ├── in_subgraph_sampler.py
│ │ │ │ ├── legacy_dataset.py
│ │ │ │ ├── neighbor_sampler.py
│ │ │ │ ├── ondisk_dataset.py
│ │ │ │ ├── ondisk_metadata.py
│ │ │ │ ├── sampled_subgraph_impl.py
│ │ │ │ ├── temporal_neighbor_sampler.py
│ │ │ │ ├── torch_based_feature_store.py
│ │ │ │ └── uniform_negative_sampler.py
│ │ │ ├── internal/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── item_sampler_utils.py
│ │ │ │ ├── sample_utils.py
│ │ │ │ └── utils.py
│ │ │ ├── internal_utils.py
│ │ │ ├── item_sampler.py
│ │ │ ├── itemset.py
│ │ │ ├── minibatch.py
│ │ │ ├── minibatch_transformer.py
│ │ │ ├── negative_sampler.py
│ │ │ ├── sampled_subgraph.py
│ │ │ ├── sampling_graph.py
│ │ │ └── subgraph_sampler.py
│ │ ├── heterograph.py
│ │ ├── heterograph_index.py
│ │ ├── homophily.py
│ │ ├── init.py
│ │ ├── label_informativeness.py
│ │ ├── logging.py
│ │ ├── merge.py
│ │ ├── mpops/
│ │ │ ├── __init__.py
│ │ │ ├── edgewise.py
│ │ │ ├── fused.py
│ │ │ └── nodewise.py
│ │ ├── multiprocessing/
│ │ │ ├── __init__.py
│ │ │ └── pytorch.py
│ │ ├── ndarray.py
│ │ ├── nn/
│ │ │ ├── __init__.py
│ │ │ ├── functional/
│ │ │ │ └── __init__.py
│ │ │ ├── mxnet/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── conv/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── agnnconv.py
│ │ │ │ │ ├── appnpconv.py
│ │ │ │ │ ├── chebconv.py
│ │ │ │ │ ├── densechebconv.py
│ │ │ │ │ ├── densegraphconv.py
│ │ │ │ │ ├── densesageconv.py
│ │ │ │ │ ├── edgeconv.py
│ │ │ │ │ ├── gatconv.py
│ │ │ │ │ ├── gatedgraphconv.py
│ │ │ │ │ ├── ginconv.py
│ │ │ │ │ ├── gmmconv.py
│ │ │ │ │ ├── graphconv.py
│ │ │ │ │ ├── nnconv.py
│ │ │ │ │ ├── relgraphconv.py
│ │ │ │ │ ├── sageconv.py
│ │ │ │ │ ├── sgconv.py
│ │ │ │ │ └── tagconv.py
│ │ │ │ ├── glob.py
│ │ │ │ ├── hetero.py
│ │ │ │ ├── softmax.py
│ │ │ │ └── utils.py
│ │ │ ├── pytorch/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── conv/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── agnnconv.py
│ │ │ │ │ ├── appnpconv.py
│ │ │ │ │ ├── atomicconv.py
│ │ │ │ │ ├── cfconv.py
│ │ │ │ │ ├── chebconv.py
│ │ │ │ │ ├── cugraph_base.py
│ │ │ │ │ ├── cugraph_gatconv.py
│ │ │ │ │ ├── cugraph_relgraphconv.py
│ │ │ │ │ ├── cugraph_sageconv.py
│ │ │ │ │ ├── densechebconv.py
│ │ │ │ │ ├── densegraphconv.py
│ │ │ │ │ ├── densesageconv.py
│ │ │ │ │ ├── dgnconv.py
│ │ │ │ │ ├── dotgatconv.py
│ │ │ │ │ ├── edgeconv.py
│ │ │ │ │ ├── edgegatconv.py
│ │ │ │ │ ├── egatconv.py
│ │ │ │ │ ├── egnnconv.py
│ │ │ │ │ ├── gatconv.py
│ │ │ │ │ ├── gatedgcnconv.py
│ │ │ │ │ ├── gatedgraphconv.py
│ │ │ │ │ ├── gatv2conv.py
│ │ │ │ │ ├── gcn2conv.py
│ │ │ │ │ ├── ginconv.py
│ │ │ │ │ ├── gineconv.py
│ │ │ │ │ ├── gmmconv.py
│ │ │ │ │ ├── graphconv.py
│ │ │ │ │ ├── grouprevres.py
│ │ │ │ │ ├── hgtconv.py
│ │ │ │ │ ├── nnconv.py
│ │ │ │ │ ├── pnaconv.py
│ │ │ │ │ ├── relgraphconv.py
│ │ │ │ │ ├── sageconv.py
│ │ │ │ │ ├── sgconv.py
│ │ │ │ │ ├── tagconv.py
│ │ │ │ │ └── twirlsconv.py
│ │ │ │ ├── explain/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── gnnexplainer.py
│ │ │ │ │ ├── pgexplainer.py
│ │ │ │ │ └── subgraphx.py
│ │ │ │ ├── factory.py
│ │ │ │ ├── glob.py
│ │ │ │ ├── gt/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── biased_mha.py
│ │ │ │ │ ├── degree_encoder.py
│ │ │ │ │ ├── egt.py
│ │ │ │ │ ├── graphormer.py
│ │ │ │ │ ├── lap_pos_encoder.py
│ │ │ │ │ ├── path_encoder.py
│ │ │ │ │ └── spatial_encoder.py
│ │ │ │ ├── hetero.py
│ │ │ │ ├── linear.py
│ │ │ │ ├── link/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── edgepred.py
│ │ │ │ │ ├── transe.py
│ │ │ │ │ └── transr.py
│ │ │ │ ├── network_emb.py
│ │ │ │ ├── softmax.py
│ │ │ │ ├── sparse_emb.py
│ │ │ │ └── utils.py
│ │ │ └── tensorflow/
│ │ │ ├── __init__.py
│ │ │ ├── conv/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── appnpconv.py
│ │ │ │ ├── chebconv.py
│ │ │ │ ├── densechebconv.py
│ │ │ │ ├── edgeconv.py
│ │ │ │ ├── gatconv.py
│ │ │ │ ├── ginconv.py
│ │ │ │ ├── graphconv.py
│ │ │ │ ├── relgraphconv.py
│ │ │ │ ├── sageconv.py
│ │ │ │ └── sgconv.py
│ │ │ ├── glob.py
│ │ │ ├── hetero.py
│ │ │ ├── softmax.py
│ │ │ └── utils.py
│ │ ├── ops/
│ │ │ ├── __init__.py
│ │ │ ├── edge_softmax.py
│ │ │ ├── gather_mm.py
│ │ │ ├── sddmm.py
│ │ │ ├── segment.py
│ │ │ └── spmm.py
│ │ ├── optim/
│ │ │ ├── __init__.py
│ │ │ ├── mxnet/
│ │ │ │ └── __init__.py
│ │ │ ├── pytorch/
│ │ │ │ ├── __init__.py
│ │ │ │ └── sparse_optim.py
│ │ │ └── tensorflow/
│ │ │ └── __init__.py
│ │ ├── partition.py
│ │ ├── propagate.py
│ │ ├── random.py
│ │ ├── readout.py
│ │ ├── sampling/
│ │ │ ├── __init__.py
│ │ │ ├── labor.py
│ │ │ ├── negative.py
│ │ │ ├── neighbor.py
│ │ │ ├── node2vec_randomwalk.py
│ │ │ ├── pinsage.py
│ │ │ ├── randomwalks.py
│ │ │ └── utils.py
│ │ ├── sparse/
│ │ │ ├── __init__.py
│ │ │ ├── broadcast.py
│ │ │ ├── elementwise_op.py
│ │ │ ├── elementwise_op_sp.py
│ │ │ ├── matmul.py
│ │ │ ├── reduction.py
│ │ │ ├── sddmm.py
│ │ │ ├── softmax.py
│ │ │ ├── sparse_matrix.py
│ │ │ ├── unary_op.py
│ │ │ └── utils.py
│ │ ├── storages/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── numpy.py
│ │ │ ├── pytorch_tensor.py
│ │ │ └── tensor.py
│ │ ├── subgraph.py
│ │ ├── transforms/
│ │ │ ├── __init__.py
│ │ │ ├── functional.py
│ │ │ ├── module.py
│ │ │ └── to_block.py
│ │ ├── traversal.py
│ │ ├── udf.py
│ │ ├── utils/
│ │ │ ├── __init__.py
│ │ │ ├── checks.py
│ │ │ ├── data.py
│ │ │ ├── exception.py
│ │ │ ├── filter.py
│ │ │ ├── internal.py
│ │ │ ├── pin_memory.py
│ │ │ └── shared_mem.py
│ │ └── view.py
│ ├── setup.py
│ └── update_version.py
├── readthedocs.yml
├── script/
│ ├── build_dgl.sh
│ ├── build_doc.sh
│ ├── create_dev_conda_env.sh
│ ├── dgl_dev.yml.template
│ └── run_pytest.sh
├── src/
│ ├── api/
│ │ ├── api_container.cc
│ │ └── api_test.cc
│ ├── array/
│ │ ├── arith.h
│ │ ├── array.cc
│ │ ├── array_arith.cc
│ │ ├── array_op.h
│ │ ├── check.h
│ │ ├── cpu/
│ │ │ ├── array_cumsum.cc
│ │ │ ├── array_index_select.cc
│ │ │ ├── array_nonzero.cc
│ │ │ ├── array_op_impl.cc
│ │ │ ├── array_pack.cc
│ │ │ ├── array_repeat.cc
│ │ │ ├── array_scatter.cc
│ │ │ ├── array_sort.cc
│ │ │ ├── array_utils.h
│ │ │ ├── concurrent_id_hash_map.cc
│ │ │ ├── concurrent_id_hash_map.h
│ │ │ ├── coo_coalesce.cc
│ │ │ ├── coo_linegraph.cc
│ │ │ ├── coo_remove.cc
│ │ │ ├── coo_sort.cc
│ │ │ ├── csr_get_data.cc
│ │ │ ├── csr_mm.cc
│ │ │ ├── csr_remove.cc
│ │ │ ├── csr_sort.cc
│ │ │ ├── csr_sum.cc
│ │ │ ├── csr_to_simple.cc
│ │ │ ├── csr_union.cc
│ │ │ ├── disjoint_union.cc
│ │ │ ├── gather_mm.cc
│ │ │ ├── gather_mm.h
│ │ │ ├── labor_pick.h
│ │ │ ├── labor_sampling.cc
│ │ │ ├── negative_sampling.cc
│ │ │ ├── rowwise_pick.h
│ │ │ ├── rowwise_sampling.cc
│ │ │ ├── rowwise_topk.cc
│ │ │ ├── sddmm.cc
│ │ │ ├── sddmm.h
│ │ │ ├── segment_reduce.cc
│ │ │ ├── segment_reduce.h
│ │ │ ├── spmat_op_impl_coo.cc
│ │ │ ├── spmat_op_impl_csr.cc
│ │ │ ├── spmm.cc
│ │ │ ├── spmm.h
│ │ │ ├── spmm_binary_ops.h
│ │ │ ├── spmm_blocking_libxsmm.h
│ │ │ ├── traversal.cc
│ │ │ └── traversal.h
│ │ ├── cuda/
│ │ │ ├── array_cumsum.cu
│ │ │ ├── array_index_select.cu
│ │ │ ├── array_index_select.cuh
│ │ │ ├── array_nonzero.cu
│ │ │ ├── array_op_impl.cu
│ │ │ ├── array_scatter.cu
│ │ │ ├── array_sort.cu
│ │ │ ├── atomic.cuh
│ │ │ ├── bf16.cuh
│ │ │ ├── coo2csr.cu
│ │ │ ├── coo_sort.cu
│ │ │ ├── csr2coo.cu
│ │ │ ├── csr_get_data.cu
│ │ │ ├── csr_mm.cu
│ │ │ ├── csr_sort.cu
│ │ │ ├── csr_sum.cu
│ │ │ ├── csr_transpose.cc
│ │ │ ├── cuda_filter.cu
│ │ │ ├── cusparse_dispatcher.cuh
│ │ │ ├── disjoint_union.cu
│ │ │ ├── fp16.cuh
│ │ │ ├── functor.cuh
│ │ │ ├── gather_mm.cu
│ │ │ ├── ge_spmm.cuh
│ │ │ ├── labor_sampling.cu
│ │ │ ├── macro.cuh
│ │ │ ├── negative_sampling.cu
│ │ │ ├── rowwise_sampling.cu
│ │ │ ├── rowwise_sampling_prob.cu
│ │ │ ├── sddmm.cu
│ │ │ ├── sddmm.cuh
│ │ │ ├── sddmm_hetero_coo.cu
│ │ │ ├── sddmm_hetero_csr.cu
│ │ │ ├── segment_reduce.cu
│ │ │ ├── segment_reduce.cuh
│ │ │ ├── spmat_op_impl_coo.cu
│ │ │ ├── spmat_op_impl_csr.cu
│ │ │ ├── spmm.cu
│ │ │ ├── spmm.cuh
│ │ │ ├── spmm_hetero.cu
│ │ │ ├── utils.cu
│ │ │ ├── utils.h
│ │ │ └── uvm/
│ │ │ ├── array_index_select_uvm.cu
│ │ │ └── array_index_select_uvm.cuh
│ │ ├── filter.cc
│ │ ├── filter.h
│ │ ├── kernel.cc
│ │ ├── kernel_decl.h
│ │ ├── libra_partition.cc
│ │ ├── selector.h
│ │ ├── union_partition.cc
│ │ ├── uvm_array.cc
│ │ └── uvm_array_op.h
│ ├── bcast.cc
│ ├── c_api_common.cc
│ ├── c_api_common.h
│ ├── geometry/
│ │ ├── cpu/
│ │ │ └── geometry_op_impl.cc
│ │ ├── cuda/
│ │ │ ├── edge_coarsening_impl.cu
│ │ │ └── geometry_op_impl.cu
│ │ ├── geometry.cc
│ │ └── geometry_op.h
│ ├── graph/
│ │ ├── creators.cc
│ │ ├── gk_ops.cc
│ │ ├── graph.cc
│ │ ├── graph_apis.cc
│ │ ├── graph_op.cc
│ │ ├── graph_traversal.cc
│ │ ├── heterograph.cc
│ │ ├── heterograph.h
│ │ ├── heterograph_capi.cc
│ │ ├── immutable_graph.cc
│ │ ├── metis_partition.cc
│ │ ├── nodeflow.cc
│ │ ├── pickle.cc
│ │ ├── sampler.cc
│ │ ├── sampling/
│ │ │ ├── negative/
│ │ │ │ └── global_uniform.cc
│ │ │ ├── neighbor/
│ │ │ │ └── neighbor.cc
│ │ │ └── randomwalks/
│ │ │ ├── frequency_hashmap.cu
│ │ │ ├── frequency_hashmap.cuh
│ │ │ ├── get_node_types_cpu.cc
│ │ │ ├── get_node_types_gpu.cu
│ │ │ ├── metapath_randomwalk.h
│ │ │ ├── node2vec.cc
│ │ │ ├── node2vec_cpu.cc
│ │ │ ├── node2vec_impl.h
│ │ │ ├── node2vec_randomwalk.h
│ │ │ ├── randomwalk_cpu.cc
│ │ │ ├── randomwalk_gpu.cu
│ │ │ ├── randomwalk_with_restart_cpu.cc
│ │ │ ├── randomwalks.cc
│ │ │ ├── randomwalks_cpu.h
│ │ │ └── randomwalks_impl.h
│ │ ├── serialize/
│ │ │ ├── dglgraph_data.h
│ │ │ ├── dglgraph_serialize.cc
│ │ │ ├── dglstream.h
│ │ │ ├── graph_serialize.cc
│ │ │ ├── graph_serialize.h
│ │ │ ├── heterograph_data.h
│ │ │ ├── heterograph_serialize.cc
│ │ │ ├── tensor_serialize.cc
│ │ │ └── zerocopy_serializer.cc
│ │ ├── shared_mem_manager.cc
│ │ ├── shared_mem_manager.h
│ │ ├── subgraph.cc
│ │ ├── transform/
│ │ │ ├── compact.cc
│ │ │ ├── compact.h
│ │ │ ├── cpu/
│ │ │ │ ├── kdtree_ndarray_adapter.h
│ │ │ │ └── knn.cc
│ │ │ ├── cuda/
│ │ │ │ ├── cuda_compact_graph.cu
│ │ │ │ ├── cuda_map_edges.cuh
│ │ │ │ ├── cuda_to_block.cu
│ │ │ │ └── knn.cu
│ │ │ ├── knn.cc
│ │ │ ├── knn.h
│ │ │ ├── line_graph.cc
│ │ │ ├── metis_partition_hetero.cc
│ │ │ ├── partition_hetero.cc
│ │ │ ├── remove_edges.cc
│ │ │ ├── to_block.cc
│ │ │ ├── to_block.h
│ │ │ ├── to_simple.cc
│ │ │ └── union_partition.cc
│ │ ├── traversal.cc
│ │ ├── traversal.h
│ │ ├── unit_graph.cc
│ │ └── unit_graph.h
│ ├── partition/
│ │ ├── cuda/
│ │ │ └── partition_op.cu
│ │ ├── ndarray_partition.cc
│ │ ├── ndarray_partition.h
│ │ └── partition_op.h
│ ├── random/
│ │ ├── continuous_seed.h
│ │ ├── cpu/
│ │ │ ├── choice.cc
│ │ │ └── sample_utils.h
│ │ └── random.cc
│ ├── rpc/
│ │ ├── network/
│ │ │ ├── common.cc
│ │ │ ├── common.h
│ │ │ ├── communicator.h
│ │ │ ├── msg_queue.cc
│ │ │ ├── msg_queue.h
│ │ │ ├── socket_communicator.cc
│ │ │ ├── socket_communicator.h
│ │ │ ├── socket_pool.cc
│ │ │ ├── socket_pool.h
│ │ │ ├── tcp_socket.cc
│ │ │ └── tcp_socket.h
│ │ ├── rpc.cc
│ │ ├── rpc.h
│ │ ├── rpc_msg.h
│ │ └── server_state.h
│ ├── runtime/
│ │ ├── c_object_api.cc
│ │ ├── c_runtime_api.cc
│ │ ├── config.cc
│ │ ├── cpu_device_api.cc
│ │ ├── cuda/
│ │ │ ├── cuda_common.h
│ │ │ ├── cuda_device_api.cc
│ │ │ ├── cuda_hashtable.cu
│ │ │ ├── cuda_hashtable.cuh
│ │ │ └── gpu_cache.cu
│ │ ├── dlpack_convert.cc
│ │ ├── dso_module.cc
│ │ ├── file_util.cc
│ │ ├── file_util.h
│ │ ├── meta_data.h
│ │ ├── module.cc
│ │ ├── module_util.cc
│ │ ├── module_util.h
│ │ ├── ndarray.cc
│ │ ├── object.cc
│ │ ├── pack_args.h
│ │ ├── parallel_for.cpp
│ │ ├── registry.cc
│ │ ├── resource_manager.cc
│ │ ├── resource_manager.h
│ │ ├── runtime_base.h
│ │ ├── semaphore_wrapper.cc
│ │ ├── semaphore_wrapper.h
│ │ ├── shared_mem.cc
│ │ ├── system_lib_module.cc
│ │ ├── tensordispatch.cc
│ │ ├── thread_pool.cc
│ │ ├── thread_storage_scope.h
│ │ ├── threading_backend.cc
│ │ ├── utils.cc
│ │ ├── workspace.h
│ │ ├── workspace_pool.cc
│ │ └── workspace_pool.h
│ └── scheduler/
│ ├── scheduler.cc
│ └── scheduler_apis.cc
├── tensoradapter/
│ ├── include/
│ │ ├── tensoradapter.h
│ │ └── tensoradapter_exports.h
│ └── pytorch/
│ ├── CMakeLists.txt
│ ├── build.bat
│ ├── build.sh
│ ├── find_cmake.py
│ └── torch.cpp
├── tests/
│ ├── README.md
│ ├── backend/
│ │ ├── __init__.py
│ │ ├── backend_unittest.py
│ │ ├── mxnet/
│ │ │ └── __init__.py
│ │ ├── pytorch/
│ │ │ └── __init__.py
│ │ └── tensorflow/
│ │ └── __init__.py
│ ├── cpp/
│ │ ├── common.h
│ │ ├── graph_index_test.cc
│ │ ├── message_queue_test.cc
│ │ ├── socket_communicator_test.cc
│ │ ├── string_test.cc
│ │ ├── test_aten.cc
│ │ ├── test_concurrent_id_hash_map.cc
│ │ ├── test_csrmm.cc
│ │ ├── test_partition.cc
│ │ ├── test_rowwise.cc
│ │ ├── test_sampler.cc
│ │ ├── test_serialize.cc
│ │ ├── test_smart_ptr_serialize.cc
│ │ ├── test_spmat_coo.cc
│ │ ├── test_spmat_csr.cc
│ │ ├── test_spmm.cc
│ │ ├── test_unit_graph.cc
│ │ └── test_zerocopy_serialize.cc
│ ├── cugraph/
│ │ ├── cugraph-ops/
│ │ │ ├── test_cugraph_gatconv.py
│ │ │ ├── test_cugraph_relgraphconv.py
│ │ │ └── test_cugraph_sageconv.py
│ │ └── test_basics.py
│ ├── dist/
│ │ ├── python/
│ │ │ ├── rpc_basic.py
│ │ │ └── run_dist_objects.py
│ │ ├── test_dist_objects.py
│ │ ├── test_rpc.py
│ │ └── utils.py
│ ├── distributed/
│ │ ├── test_dist_graph_store.py
│ │ ├── test_dist_tensor.py
│ │ ├── test_distributed_sampling.py
│ │ ├── test_mp_dataloader.py
│ │ ├── test_new_kvstore.py
│ │ ├── test_partition.py
│ │ ├── test_rpc.py
│ │ └── utils.py
│ ├── examples/
│ │ ├── test_sampling_examples.py
│ │ └── test_sparse_examples.py
│ ├── go/
│ │ ├── test_model.py
│ │ └── test_pipeline.py
│ ├── integration/
│ │ └── test_data.py
│ ├── lint/
│ │ ├── clangformat_linter.py
│ │ ├── lint.py
│ │ ├── pip_init.py
│ │ ├── pylintrc
│ │ └── ufmt_linter.py
│ ├── python/
│ │ ├── common/
│ │ │ ├── backend/
│ │ │ │ ├── test_set_default_backend.py
│ │ │ │ └── test_tensor.py
│ │ │ ├── cuda/
│ │ │ │ └── test_gpu_cache.py
│ │ │ ├── data/
│ │ │ │ ├── data/
│ │ │ │ │ ├── 1.npy
│ │ │ │ │ ├── 2.npy
│ │ │ │ │ ├── graph_0.9a220622.dgl
│ │ │ │ │ └── test_heterophilous_graphs.py
│ │ │ │ ├── test_actor.py
│ │ │ │ ├── test_data.py
│ │ │ │ ├── test_geom_gcn.py
│ │ │ │ ├── test_movielens.py
│ │ │ │ ├── test_serialize.py
│ │ │ │ └── test_utils.py
│ │ │ ├── dataloading/
│ │ │ │ └── test_dataloader.py
│ │ │ ├── function/
│ │ │ │ └── test_basics.py
│ │ │ ├── ops/
│ │ │ │ ├── test_edge_softmax.py
│ │ │ │ └── test_ops.py
│ │ │ ├── sampling/
│ │ │ │ └── test_sampling.py
│ │ │ ├── test_batch-graph.py
│ │ │ ├── test_batch-heterograph.py
│ │ │ ├── test_convert.py
│ │ │ ├── test_ffi.py
│ │ │ ├── test_frame.py
│ │ │ ├── test_generators.py
│ │ │ ├── test_heterograph-apply-edges.py
│ │ │ ├── test_heterograph-index.py
│ │ │ ├── test_heterograph-kernel.py
│ │ │ ├── test_heterograph-misc.py
│ │ │ ├── test_heterograph-pickle.py
│ │ │ ├── test_heterograph-remove.py
│ │ │ ├── test_heterograph-shared-memory.py
│ │ │ ├── test_heterograph-specialization.py
│ │ │ ├── test_heterograph-update-all.py
│ │ │ ├── test_heterograph.py
│ │ │ ├── test_homophily.py
│ │ │ ├── test_label_informativeness.py
│ │ │ ├── test_merge.py
│ │ │ ├── test_partition.py
│ │ │ ├── test_propagate.py
│ │ │ ├── test_random.py
│ │ │ ├── test_readout.py
│ │ │ ├── test_sparse_ops-csr.py
│ │ │ ├── test_subgraph.py
│ │ │ ├── test_traversal.py
│ │ │ ├── transforms/
│ │ │ │ ├── test_functional-sort.py
│ │ │ │ ├── test_to_block.py
│ │ │ │ └── test_transform.py
│ │ │ └── utils/
│ │ │ ├── test_filter.py
│ │ │ └── test_pin_memory.py
│ │ ├── mxnet/
│ │ │ ├── ip_config.txt
│ │ │ ├── test_geometry.py
│ │ │ └── test_nn.py
│ │ ├── pytorch/
│ │ │ ├── cuda/
│ │ │ │ └── test_nccl.py
│ │ │ ├── dataloading/
│ │ │ │ ├── test_dataloader.py
│ │ │ │ └── test_spot_target.py
│ │ │ ├── distributed/
│ │ │ │ └── optim/
│ │ │ │ └── test_dist_optim.py
│ │ │ ├── geometry/
│ │ │ │ └── test_geometry.py
│ │ │ ├── graphbolt/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gb_test_utils.py
│ │ │ │ ├── impl/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── test_basic_feature_store.py
│ │ │ │ │ ├── test_cooperative_minibatching_utils.py
│ │ │ │ │ ├── test_cpu_cached_feature.py
│ │ │ │ │ ├── test_disk_based_feature_store.py
│ │ │ │ │ ├── test_feature_cache.py
│ │ │ │ │ ├── test_fused_csc_sampling_graph.py
│ │ │ │ │ ├── test_gpu_cached_feature.py
│ │ │ │ │ ├── test_gpu_graph_cache.py
│ │ │ │ │ ├── test_hetero_cached_feature.py
│ │ │ │ │ ├── test_in_subgraph_sampler.py
│ │ │ │ │ ├── test_legacy_dataset.py
│ │ │ │ │ ├── test_negative_sampler.py
│ │ │ │ │ ├── test_neighbor_sampler.py
│ │ │ │ │ ├── test_ondisk_dataset.py
│ │ │ │ │ ├── test_sampled_subgraph_impl.py
│ │ │ │ │ └── test_torch_based_feature_store.py
│ │ │ │ ├── internal/
│ │ │ │ │ ├── test_sample_utils.py
│ │ │ │ │ └── test_utils.py
│ │ │ │ ├── test_base.py
│ │ │ │ ├── test_dataloader.py
│ │ │ │ ├── test_dataset.py
│ │ │ │ ├── test_feature_fetcher.py
│ │ │ │ ├── test_graphbolt_utils.py
│ │ │ │ ├── test_integration.py
│ │ │ │ ├── test_item_sampler.py
│ │ │ │ ├── test_itemset.py
│ │ │ │ ├── test_minibatch.py
│ │ │ │ ├── test_subgraph_sampler.py
│ │ │ │ └── test_utils.py
│ │ │ ├── ip_config.txt
│ │ │ ├── mpops/
│ │ │ │ └── test_edgewise.py
│ │ │ ├── nn/
│ │ │ │ ├── conv/
│ │ │ │ │ └── test_gatedgcnconv.py
│ │ │ │ ├── test_nn.py
│ │ │ │ └── test_sparse_emb.py
│ │ │ ├── optim/
│ │ │ │ └── test_optim.py
│ │ │ ├── sparse/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── test_broadcast.py
│ │ │ │ ├── test_elementwise_op.py
│ │ │ │ ├── test_elementwise_op_sp.py
│ │ │ │ ├── test_matmul.py
│ │ │ │ ├── test_matrix_op.py
│ │ │ │ ├── test_reduction.py
│ │ │ │ ├── test_sddmm.py
│ │ │ │ ├── test_softmax.py
│ │ │ │ ├── test_sparse_matrix.py
│ │ │ │ ├── test_unary_op.py
│ │ │ │ └── utils.py
│ │ │ ├── test_ffi-stream.py
│ │ │ ├── test_heterograph-pickle.py
│ │ │ ├── test_multiprocessing-ipc.py
│ │ │ └── utils/
│ │ │ └── test_pin_memory.py
│ │ ├── tensorflow/
│ │ │ ├── test_basic.py
│ │ │ └── test_nn.py
│ │ └── test_dgl_import.py
│ ├── scripts/
│ │ ├── build_dgl.bat
│ │ ├── build_dgl.sh
│ │ ├── ci_report/
│ │ │ ├── report.py
│ │ │ └── status.py
│ │ ├── cugraph_unit_test.sh
│ │ ├── task_cpp_unit_test.bat
│ │ ├── task_cpp_unit_test.sh
│ │ ├── task_dist_test.sh
│ │ ├── task_distributed_test.sh
│ │ ├── task_example_test.bat
│ │ ├── task_example_test.sh
│ │ ├── task_go_test.sh
│ │ ├── task_lint.sh
│ │ ├── task_pytorch_tutorial_test.sh
│ │ ├── task_unit_test.bat
│ │ └── task_unit_test.sh
│ ├── tools/
│ │ ├── pytest_utils.py
│ │ ├── test_array_readwriter.py
│ │ ├── test_change_etype_to_canonical_etype.py
│ │ ├── test_convert_partition.py
│ │ ├── test_dist_lookup.py
│ │ ├── test_dist_part.py
│ │ ├── test_dist_partition_graphbolt.py
│ │ ├── test_launch.py
│ │ ├── test_parmetis.py
│ │ └── test_parmetis_preproc.py
│ └── utils/
│ ├── __init__.py
│ ├── checks.py
│ └── graph_cases.py
├── third_party/
│ └── HugeCTR/
│ └── gpu_cache/
│ ├── ReadMe.md
│ ├── include/
│ │ ├── gpu_cache_api.hpp
│ │ ├── hash_functions.cuh
│ │ ├── nv_gpu_cache.hpp
│ │ └── nv_util.h
│ └── src/
│ └── nv_gpu_cache.cu
├── tools/
│ ├── README.md
│ ├── change_etype_to_canonical_etype.py
│ ├── chunk_graph.py
│ ├── copy_files.py
│ ├── dispatch_data.py
│ ├── distgraphlaunch.py
│ ├── distpartitioning/
│ │ ├── README.md
│ │ ├── array_readwriter/
│ │ │ ├── __init__.py
│ │ │ ├── csv.py
│ │ │ ├── numpy_array.py
│ │ │ ├── parquet.py
│ │ │ └── registry.py
│ │ ├── constants.py
│ │ ├── convert_partition.py
│ │ ├── data_proc_pipeline.py
│ │ ├── data_shuffle.py
│ │ ├── dataset_utils.py
│ │ ├── dist_lookup.py
│ │ ├── globalids.py
│ │ ├── gloo_wrapper.py
│ │ ├── parmetis_postprocess.py
│ │ ├── parmetis_preprocess.py
│ │ ├── parmetis_wrapper.py
│ │ └── utils.py
│ ├── files.py
│ ├── launch.py
│ ├── partition_algo/
│ │ ├── base.py
│ │ └── random_partition.py
│ ├── verification_utils.py
│ └── verify_partitions.py
└── tutorials/
├── blitz/
│ ├── .gitignore
│ ├── 1_introduction.py
│ ├── 2_dglgraph.py
│ ├── 3_message_passing.py
│ ├── 4_link_predict.py
│ ├── 5_graph_classification.py
│ ├── 6_load_data.py
│ └── README.txt
├── cpu/
│ ├── README.txt
│ ├── argo_tutorial.py
│ └── cpu_best_practises.py
├── models/
│ ├── 1_gnn/
│ │ ├── 1_gcn.py
│ │ ├── 4_rgcn.py
│ │ ├── 6_line_graph.py
│ │ ├── 9_gat.py
│ │ └── README.txt
│ ├── 2_small_graph/
│ │ ├── 3_tree-lstm.py
│ │ └── README.txt
│ ├── 3_generative_model/
│ │ ├── 5_dgmg.py
│ │ └── README.txt
│ ├── 4_old_wines/
│ │ ├── 2_capsule.py
│ │ ├── 7_transformer.py
│ │ └── README.txt
│ └── README.txt
├── multi/
│ ├── 1_graph_classification.py
│ ├── 2_node_classification.py
│ └── README.txt
└── requirements.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .clang-format
================================================
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: AlwaysBreak
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: true
AlignConsecutiveBitFields:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignEscapedNewlines: Left
AlignOperands: Align
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterExternBlock: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAfterJavaFieldAnnotations: false
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 3
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '([-_](test|unittest))?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: None
IndentRequiresClause: true
IndentWidth: 2
IndentWrappedFunctionNames: false
InsertBraces: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: NextLine
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
PPIndentWidth: -1
QualifierAlignment: Leave
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
- ParseTestProto
- ParsePartialTestProto
CanonicalDelimiter: pb
BasedOnStyle: google
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RequiresClausePosition: OwnLine
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInSquareBrackets: false
Standard: Auto
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE
...
================================================
FILE: .github/ISSUE_TEMPLATE/--work-item--dev-only-.md
================================================
---
name: "\U0001F528Work Item (DEV ONLY)"
about: Work item issue for tracking progress. Dev team only.
title: ''
labels: Work Item
assignees: ''
---
## 🔨Work Item
**IMPORTANT:**
* This template is only for dev team to track project progress. For feature request or bug report, please use the corresponding issue templates.
* DO NOT create a new work item if the purpose is to fix an existing issue or feature request. We will directly use the issue in the project tracker.
Project tracker: https://github.com/orgs/dmlc/projects/2
## Description
<!-- short description of the work item -->
## Depending work items or issues
<!-- what must be done before this -->
================================================
FILE: .github/ISSUE_TEMPLATE/bug-report.md
================================================
---
name: "\U0001F41B Bug Report"
about: Submit a bug report to help us improve DGL
title: ''
labels: ''
assignees: ''
---
## 🐛 Bug
<!-- A clear and concise description of what the bug is. -->
## To Reproduce
Steps to reproduce the behavior:
1.
1.
1.
<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->
## Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
## Environment
- DGL Version (e.g., 1.0):
- Backend Library & Version (e.g., PyTorch 0.4.1, MXNet/Gluon 1.3):
- OS (e.g., Linux):
- How you installed DGL (`conda`, `pip`, source):
- Build command you used (if compiling from source):
- Python version:
- CUDA/cuDNN version (if applicable):
- GPU models and configuration (e.g. V100):
- Any other relevant information:
## Additional context
<!-- Add any other context about the problem here. -->
================================================
FILE: .github/ISSUE_TEMPLATE/documentation.md
================================================
---
name: "\U0001F4DA Documentation"
about: Report an issue related to docs.dgl.ai
title: ''
labels: ''
assignees: ''
---
## 📚 Documentation
<!-- Please specify whether it's tutorial part or API reference part-->
<!-- Describe the issue.-->
================================================
FILE: .github/ISSUE_TEMPLATE/feature-request.md
================================================
---
name: "\U0001F680Feature Request"
about: Submit a proposal/request for a new DGL feature
title: ''
labels: ''
assignees: ''
---
## 🚀 Feature
<!-- A brief description of the feature proposal -->
## Motivation
<!-- Please outline the motivation for the proposal. Is your feature request
related to a problem? e.g., I'm always frustrated when [...]. If this is
related to another GitHub issue, please link here too -->
## Alternatives
<!-- A clear and concise description of any alternative solutions or features you've considered, if any. -->
## Pitch
<!-- A clear and concise description of what you want to happen. -->
## Additional context
<!-- Add any other context or screenshots about the feature request here. -->
================================================
FILE: .github/ISSUE_TEMPLATE/questions-help-support.md
================================================
---
name: "❓Questions/Help/Support"
about: Do you need support? We have resources.
title: ''
labels: ''
assignees: ''
---
## ❓ Questions and Help
Before proceeding, please note that we recommend
using our discussion forum (https://discuss.dgl.ai) for
general questions. As a result, this issue will
likely be CLOSED shortly.
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
## Description
<!-- Brief description. Refer to the related issues if existed.
It'll be great if relevant reviewers can be assigned as well.-->
## Checklist
Please feel free to remove inapplicable items for your PR.
- [ ] The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
- [ ] I've leverage the [tools](https://docs.google.com/document/d/1iHyj7zlmygKSk5gBPsqIqL5ASPzJSPREaNT_QdsiYA4/edit) to beautify the python and c++ code.
- [ ] The PR is complete and small, read the [Google eng practice (CL equals to PR)](https://google.github.io/eng-practices/review/developer/small-cls.html) to understand more about small PR. In DGL, we consider PRs with less than 200 lines of core code change are small (example, test and documentation could be exempted).
- [ ] 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
- [ ] If the PR is for a new model/paper, I've updated the example index [here](../examples/README.md).
## Changes
<!-- You could use following template
- [ ] Feature1, tests, (and when applicable, API doc)
- [ ] Feature2, tests, (and when applicable, API doc)
-->
================================================
FILE: .github/workflows/lint.yml
================================================
name: Lint
on: [pull_request]
jobs:
lintrunner:
runs-on: ubuntu-latest
steps:
- name: Pull DGL
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout master and HEAD
run: |
git checkout -t origin/master
git checkout ${{ github.event.pull_request.head.sha }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install lintrunner --user
- name: Initialize lint dependencies
run: lintrunner init
- name: Run lintrunner on all changed files
run: |
set +e
if ! lintrunner --force-color -m master --tee-json=lint.json; then
echo ""
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner\`.\e[0m"
echo -e "\e[1m\e[36mSee https://github.com/pytorch/pytorch/wiki/lintrunner for setup instructions.\e[0m"
exit 1
fi
- name: Store annotations
if: always() && github.event_name == 'pull_request'
# Don't show this as an error; the above step will have already failed.
continue-on-error: true
run: |
# Use jq to massage the JSON lint output into GitHub Actions workflow commands.
jq --raw-output \
'"::\(if .severity == "advice" or .severity == "disabled" then "warning" else .severity end) file=\(.path),line=\(.line),col=\(.char),title=\(.code) \(.name)::" + (.description | gsub("\\n"; "%0A"))' \
lint.json
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true
================================================
FILE: .github/workflows/stale.yml
================================================
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests
on:
schedule:
- cron: '0 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v4.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: 30
days-before-issue-close: -1 # disable issue close
days-before-pr-stale: -1 # disable stale bot on pr
days-before-pr-close: -1 # disable stale bot on pr
stale-issue-message: 'This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you'
close-issue-message: 'This issue is closed due to lack of activity. Feel free to reopen it if you still have questions.'
stale-issue-label: 'stale-issue'
exempt-issue-labels: 'bug:confirmed,feature request,help wanted,Work Item'
exempt-all-issue-milestones: true
================================================
FILE: .gitignore
================================================
# IDE
.idea
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
dataset/
datasets/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# Whitelist some distribution / package non-related directories
!tests/dist
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
examples/pytorch/data/ind.pubmed.y
examples/pytorch/data/ind.pubmed.x
examples/pytorch/data/ind.pubmed.ty
examples/pytorch/data/ind.pubmed.tx
examples/pytorch/data/ind.pubmed.test.index
examples/pytorch/data/ind.pubmed.graph
examples/pytorch/data/ind.pubmed.ally
examples/pytorch/data/ind.pubmed.allx
examples/pytorch/data/ind.cora.y
examples/pytorch/data/ind.cora.x
examples/pytorch/data/ind.cora.ty
examples/pytorch/data/ind.cora.tx
examples/pytorch/data/ind.cora.test.index
examples/pytorch/data/ind.cora.graph
examples/pytorch/data/ind.cora.ally
examples/pytorch/data/ind.cora.allx
examples/pytorch/data/ind.citeseer.y
examples/pytorch/data/ind.citeseer.x
examples/pytorch/data/ind.citeseer.ty
examples/pytorch/data/ind.citeseer.tx
examples/pytorch/data/ind.citeseer.test.index
examples/pytorch/data/ind.citeseer.graph
examples/pytorch/data/ind.citeseer.ally
examples/pytorch/data/ind.citeseer.allx
examples/pytorch/.DS_Store
examples/.DS_Store
examples/pytorch/generative_graph/*.p
.DS_Store
# data directory
_download
# CTags & CScope
tags
cscope.*
# Vim
*.swp
*.swo
*.un~
*~
# parameters
*.params
# vscode
.clangd
.vscode
# asv
.asv
.ycm_extra_conf.py
**.png
# model file
*.pth
================================================
FILE: .gitmodules
================================================
[submodule "third_party/dmlc-core"]
path = third_party/dmlc-core
url = https://github.com/dmlc/dmlc-core.git
[submodule "third_party/dlpack"]
path = third_party/dlpack
url = https://github.com/dmlc/dlpack.git
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://github.com/google/googletest.git
[submodule "third_party/METIS"]
path = third_party/METIS
url = https://github.com/KarypisLab/METIS.git
[submodule "third_party/nanoflann"]
path = third_party/nanoflann
url = https://github.com/jlblancoc/nanoflann
[submodule "third_party/libxsmm"]
path = third_party/libxsmm
url = https://github.com/hfp/libxsmm.git
[submodule "third_party/pcg"]
path = third_party/pcg
url = https://github.com/imneme/pcg-cpp.git
[submodule "third_party/cccl"]
path = third_party/cccl
url = https://github.com/NVIDIA/cccl.git
[submodule "third_party/liburing"]
path = third_party/liburing
url = https://github.com/axboe/liburing.git
[submodule "third_party/cuco"]
path = third_party/cuco
url = https://github.com/NVIDIA/cuCollections.git
[submodule "third_party/GKlib"]
path = third_party/GKlib
url = https://github.com/KarypisLab/GKlib.git
[submodule "third_party/taskflow"]
path = third_party/taskflow
url = https://github.com/taskflow/taskflow.git
[submodule "third_party/tsl_robin_map"]
path = third_party/tsl_robin_map
url = https://github.com/Tessil/robin-map.git
================================================
FILE: .lintrunner.toml
================================================
# Black + usort
[[linter]]
code = 'UFMT'
include_patterns = [
'**/*.py',
]
command = [
'python3',
'tests/lint/ufmt_linter.py',
'--',
'@{{PATHSFILE}}'
]
exclude_patterns = [
'.github/*',
'build/*',
'cmake/*',
'conda/*',
'docker/*',
'third_party/*',
]
init_command = [
'python3',
'tests/lint/pip_init.py',
'--dry-run={{DRYRUN}}',
'black==22.10.0',
'ufmt==2.0.1',
'usort==1.0.5',
]
is_formatter = true
[[linter]]
code = 'CLANGFORMAT'
include_patterns = [
'**/*.h',
'**/*.c',
'**/*.cc',
'**/*.cpp',
'**/*.cuh',
'**/*.cu',
]
exclude_patterns = [
'third_party/**',
]
init_command = [
'python3',
'tests/lint/pip_init.py',
'--dry-run={{DRYRUN}}',
'clang-format==15.0.4',
]
command = [
'python3',
'tests/lint/clangformat_linter.py',
'--binary=clang-format',
'--',
'@{{PATHSFILE}}'
]
is_formatter = true
================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.18)
########################################
# Borrowed and adapted from TVM project
########################################
project(dgl C CXX)
message(STATUS "Start configuring project ${PROJECT_NAME}")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# cmake utils
include(cmake/util/Util.cmake)
include(cmake/util/MshadowUtil.cmake)
include(cmake/util/FindCUDA.cmake)
# Options for building DGL.
# NOTE: Please avoid editing this file to change build type. Instead, using
# bash script/build_dgl.sh -e -t release to overwrite the value.
dgl_option(BUILD_TYPE "Type of the build: dev, dogfood or release" "dev")
message(STATUS "Build for ${BUILD_TYPE}")
dgl_option(USE_CUDA "Build with CUDA" OFF)
dgl_option(TORCH_PYTHON_INTERPS "Python interpreter for building sub-components" python3)
# Conda build related options.
dgl_option(EXTERNAL_DLPACK_PATH "Path to external dlpack" OFF)
dgl_option(EXTERNAL_DMLC_PATH "Path to external dmlc-core" OFF)
dgl_option(EXTERNAL_DMLC_LIB_PATH "Path to external dmlc-core library" OFF)
dgl_option(EXTERNAL_PHMAP_PATH "Path to external parallel-hashmap" OFF)
dgl_option(EXTERNAL_NANOFLANN_PATH "Path to use external nanoflann" OFF)
dgl_option(EXTERNAL_METIS_PATH "Path to external metis" OFF)
dgl_option(EXTERNAL_METIS_LIB_PATH "Path to external metis library" OFF)
dgl_option(EXTERNAL_GKLIB_PATH "Path to external gklib" OFF)
# Options for building DGL features: "none," "dev," "dogfood," "release," and
# "all."
# "none" - The feature is OFF for all build types. This is used when
# disabling a feature.
# "dev" - The feature is ON for dev build. The default build from source
# and the build for unit tests are using this build type.
# "dogfood" - The major function of this feature is done. The regression and
# benchmark framework are using this build type.
# "release" - The feature will be build for release.
# "all" - The feature is ON for all build types. Equivalent to set ["dev"
# "dogfood" "release"].
# NOTE: Please avoid editing this file to change feature options for a local
# build. Instead, using bash script/build_dgl.sh -e '-DFEATURE_NAME=ON/OFF' to
# overwrite the value.
dgl_feature_option(
BUILD_SPARSE
"Build DGL sparse library"
"all"
)
dgl_feature_option(
BUILD_TORCH
"Build the PyTorch plugin"
"all"
)
dgl_feature_option(
USE_EPOLL
"Build with epoll for socket communicator"
"all"
)
dgl_feature_option(
USE_LIBXSMM
"Build with LIBXSMM library optimization"
"all"
)
dgl_feature_option(
USE_OPENMP
"Build with OpenMP"
"all"
)
dgl_feature_option(
BUILD_GRAPHBOLT
"Build Graphbolt library"
"all"
)
dgl_feature_option(
LIBCXX_ENABLE_PARALLEL_ALGORITHMS
"Enable the parallel algorithms library. This requires the PSTL to be available."
"none"
)
dgl_feature_option(
REBUILD_LIBXSMM
"Clean LIBXSMM build cache at every build"
"none"
)
dgl_feature_option(
USE_HDFS
"Build with HDFS support"
"none"
) # Set env HADOOP_HDFS_HOME if needed
dgl_feature_option(
USE_S3
"Build with S3 support"
"none"
)
# Only build C++ tests for unit testing purposes in dev build.
dgl_feature_option(
BUILD_CPP_TEST
"Build cpp unittest executables"
"dev"
)
if (EXTERNAL_DLPACK_PATH OR EXTERNAL_DMLC_PATH OR EXTERNAL_NANOFLANN_PATH OR EXTERNAL_NANOFLANN_PATH OR EXTERNAL_METIS_PATH OR EXTERNAL_GKLIB_PATH)
message(STATUS "Using at least one external library")
set(USE_EXTERNAL_LIBS ON)
if (BUILD_CPP_TEST)
message(FATAL_ERROR "Cannot build cpp unittests with external libraries")
endif(BUILD_CPP_TEST)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
# Set optimization options for different build types.
if (${BUILD_TYPE} STREQUAL "dev")
if (MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Od")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Od")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g3 -ggdb")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g3 -ggdb")
endif()
else()
if (MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /O2 /DNDEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /O2 /DNDEBUG")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -DNDEBUG")
endif()
endif()
if(USE_CUDA)
message(STATUS "Build with CUDA support")
project(dgl C CXX)
include(cmake/modules/CUDA.cmake)
message(STATUS "Use external CCCL library for a consistent API and performance.")
cuda_include_directories(BEFORE "${CMAKE_SOURCE_DIR}/third_party/cccl/thrust")
cuda_include_directories(BEFORE "${CMAKE_SOURCE_DIR}/third_party/cccl/cub")
cuda_include_directories(BEFORE "${CMAKE_SOURCE_DIR}/third_party/cccl/libcudacxx/include")
endif(USE_CUDA)
# initial variables
if(NOT MSVC)
set(DGL_LINKER_LIBS "dl")
endif(NOT MSVC)
if(MSVC OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(DGL_RUNTIME_LINKER_LIBS "")
else(MSVC OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(DGL_RUNTIME_LINKER_LIBS "rt")
endif(MSVC OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# Generic compilation options
if(MSVC)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
add_definitions(-DNOMINMAX)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS 1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj")
if(USE_MSVC_MT)
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
endif()
else(MSVC)
include(CheckCXXCompilerFlag)
set(CMAKE_C_FLAGS "-Wall -fPIC ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -fPIC ${CMAKE_CXX_FLAGS}")
if(NOT APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--warn-common ${CMAKE_SHARED_LINKER_FLAGS}")
endif(NOT APPLE)
endif(MSVC)
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
message(STATUS "Disabling LIBXSMM on ${CMAKE_SYSTEM_PROCESSOR}.")
set(USE_LIBXSMM OFF)
endif()
# Source file lists
file(GLOB DGL_SRC
src/*.cc
src/array/*.cc
src/array/cpu/*.cc
src/random/*.cc
src/random/cpu/*.cc
src/runtime/*.cc
src/geometry/*.cc
src/geometry/cpu/*.cc
src/partition/*.cc
)
file(GLOB_RECURSE DGL_SRC_1
src/api/*.cc
src/graph/*.cc
src/scheduler/*.cc
)
list(APPEND DGL_SRC ${DGL_SRC_1})
if (NOT MSVC)
file(GLOB_RECURSE DGL_RPC_SRC src/rpc/*.cc)
else()
file(GLOB_RECURSE DGL_RPC_SRC src/rpc/network/*.cc)
endif()
list(APPEND DGL_SRC ${DGL_RPC_SRC})
if(USE_OPENMP)
find_package(OpenMP REQUIRED)
list(APPEND DGL_LINKER_LIBS OpenMP::OpenMP_CXX)
message(STATUS "Build with OpenMP.")
endif(USE_OPENMP)
# Configure cuda
if(USE_CUDA)
file(GLOB_RECURSE DGL_CUDA_SRC
src/array/cuda/*.cc
src/array/cuda/*.cu
src/array/cuda/uvm/*.cc
src/array/cuda/uvm/*.cu
src/kernel/cuda/*.cc
src/kernel/cuda/*.cu
src/partition/cuda/*.cu
src/runtime/cuda/*.cc
src/runtime/cuda/*.cu
src/geometry/cuda/*.cu
src/graph/transform/cuda/*.cu
src/graph/sampling/randomwalks/*.cu
)
list(APPEND DGL_SRC ${DGL_CUDA_SRC})
dgl_config_cuda(DGL_LINKER_LIBS)
cuda_add_library(dgl SHARED ${DGL_SRC})
else(USE_CUDA)
add_library(dgl SHARED ${DGL_SRC})
endif(USE_CUDA)
if ((NOT MSVC) AND USE_EPOLL)
INCLUDE(CheckIncludeFile)
check_include_file("sys/epoll.h" EPOLL_AVAILABLE)
if (EPOLL_AVAILABLE)
target_compile_definitions(dgl PRIVATE USE_EPOLL)
else()
message(WARNING "EPOLL is not available on this platform...")
endif()
endif ()
# include directories
target_include_directories(dgl PRIVATE "include")
# check for conda includes
if("$ENV{CONDA_BUILD}" STREQUAL "1")
set(in_conda_build TRUE)
message(STATUS "Conda build environment detected")
elseif(DEFINED ENV{CONDA_PREFIX})
set(in_conda_prefix TRUE)
message(STATUS "Conda environment detected: $ENV{CONDA_PREFIX}")
endif()
if (USE_CONDA_INCLUDES)
if(in_conda_build)
message(STATUS "Using Conda build environment includes: $ENV{PREFIX}")
target_include_directories(dgl PRIVATE "$ENV{PREFIX}/include" "$ENV{BUILD_PREFIX}/include")
elseif(in_conda_prefix)
message(STATUS "Using Conda environment includes: $ENV{CONDA_PREFIX}")
target_include_directories(dgl PRIVATE "$ENV{CONDA_PREFIX}/include")
else()
message(FATAL_ERROR "Conda environment not detected")
endif()
endif()
if(EXTERNAL_DLPACK_PATH)
message(STATUS "looking for dlpack headers in ${EXTERNAL_DLPACK_PATH}")
include_directories(SYSTEM ${EXTERNAL_DLPACK_PATH})
else(EXTERNAL_DLPACK_PATH)
target_include_directories(dgl PRIVATE "third_party/dlpack/include")
endif(EXTERNAL_DLPACK_PATH)
if(EXTERNAL_DMLC_PATH)
if (USE_HDFS)
message(FATAL_ERROR "Cannot use HDFS and external dmlc-core at the same time")
endif()
message(STATUS "looking for dmlc headers in ${EXTERNAL_DMLC_PATH}")
include_directories(SYSTEM ${EXTERNAL_DMLC_PATH})
if (NOT EXTERNAL_DMLC_LIB_PATH)
message(FATAL_ERROR "EXTERNAL_DMLC_LIB_PATH must be set if EXTERNAL_DMLC_PATH is set")
endif()
message(STATUS "looking for dmlc library in ${EXTERNAL_DMLC_LIB_PATH}")
find_package(dmlc
REQUIRED
HINTS ${EXTERNAL_DMLC_LIB_PATH}
)
if(NOT dmlc_FOUND)
message(FATAL_ERROR "Failed to find DMLC library")
endif()
list(APPEND DGL_LINKER_LIBS dmlc::dmlc)
else(EXTERNAL_DMLC_PATH)
target_include_directories(dgl PRIVATE "third_party/dmlc-core/include")
# For serialization
if (USE_HDFS)
option(DMLC_HDFS_SHARED "dgl has to build with dynamic hdfs library" ON)
endif()
add_subdirectory("third_party/dmlc-core")
list(APPEND DGL_LINKER_LIBS dmlc)
set(GOOGLE_TEST 0) # Turn off dmlc-core test
endif(EXTERNAL_DMLC_PATH)
target_include_directories(dgl PRIVATE "tensoradapter/include")
target_include_directories(dgl PRIVATE "third_party/pcg/include")
target_include_directories(dgl PRIVATE "third_party/tsl_robin_map/include")
if(EXTERNAL_NANOFLANN_PATH)
include_directories(SYSTEM ${EXTERNAL_NANOFLANN_PATH})
else(EXTERNAL_NANOFLANN_PATH)
target_include_directories(dgl PRIVATE "third_party/nanoflann/include")
endif(EXTERNAL_NANOFLANN_PATH)
if (USE_LIBXSMM)
target_compile_definitions(dgl PRIVATE USE_LIBXSMM DGL_CPU_LLC_SIZE=40000000 __BLAS=0)
target_include_directories(dgl PRIVATE "third_party/libxsmm/include")
message(STATUS "Build with LIBXSMM optimization.")
endif()
# To compile METIS correct for DGL.
add_compile_definitions(IDXTYPEWIDTH=64 REALTYPEWIDTH=32)
if (EXTERNAL_METIS_PATH)
# To compile METIS correct for DGL.
if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DIDXTYPEWIDTH=64 /DREALTYPEWIDTH=32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DIDXTYPEWIDTH=64 /DREALTYPEWIDTH=32")
else(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DIDXTYPEWIDTH=64 -DREALTYPEWIDTH=32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIDXTYPEWIDTH=64 -DREALTYPEWIDTH=32")
endif(MSVC)
find_package(METIS REQUIRED)
message(STATUS "Found METIS library")
target_include_directories(dgl SYSTEM PUBLIC ${METIS_INCLUDE_DIR})
list(APPEND DGL_LINKER_LIBS ${METIS_LIBRARIES})
else(EXTERNAL_METIS_PATH)
target_include_directories(dgl PRIVATE "third_party/METIS/include")
# Compile METIS
if(NOT MSVC)
set(GKLIB_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/GKlib")
include(${GKLIB_PATH}/GKlibSystem.cmake)
include_directories(${GKLIB_PATH})
add_library(GKlib ${GKlib_sources})
include_directories("third_party/METIS/include/")
add_subdirectory("third_party/METIS/libmetis/")
# When building on ubi7, it fails with the following error:
# /usr/include/signal.h:156:29: error: unknown type name 'siginfo_t'.
# So I(Rui) define _POSIX_C_SOURCE to 200809L for GKlib and metis to avoid the error.
target_compile_definitions(GKlib PRIVATE _POSIX_C_SOURCE=200809L)
target_compile_definitions(metis PRIVATE _POSIX_C_SOURCE=200809L)
list(APPEND DGL_LINKER_LIBS metis GKlib)
endif(NOT MSVC)
endif(EXTERNAL_METIS_PATH)
# Avoid exposing third-party symbols when using DGL as a library.
if((NOT MSVC) AND (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--exclude-libs,ALL")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--exclude-libs,ALL")
endif()
# Compile gpu_cache
if(USE_CUDA)
# Manually build gpu_cache because CMake always builds it as shared
file(GLOB gpu_cache_src
third_party/HugeCTR/gpu_cache/src/nv_gpu_cache.cu
)
cuda_add_library(gpu_cache STATIC ${gpu_cache_src})
target_include_directories(gpu_cache PRIVATE "third_party/HugeCTR/gpu_cache/include")
target_include_directories(dgl PRIVATE "third_party/HugeCTR/gpu_cache/include")
list(APPEND DGL_LINKER_LIBS gpu_cache)
message(STATUS "Build with HugeCTR GPU embedding cache.")
endif(USE_CUDA)
# support PARALLEL_ALGORITHMS
if (LIBCXX_ENABLE_PARALLEL_ALGORITHMS)
target_compile_definitions(dgl PRIVATE PARALLEL_ALGORITHMS)
endif(LIBCXX_ENABLE_PARALLEL_ALGORITHMS)
target_link_libraries(dgl ${DGL_LINKER_LIBS} ${DGL_RUNTIME_LINKER_LIBS})
if(MSVC)
add_custom_command(
TARGET dgl POST_BUILD COMMAND
${CMAKE_COMMAND} -E copy "$<TARGET_FILE:dgl>" "$<TARGET_FILE_DIR:dgl>/..")
endif(MSVC)
# Tensor adapter libraries
# Linking against LibTorch involves linking against a bunch of other libraries
# returned by PyTorch's CMake (e.g. C10 or NVTools). Because CMake caches
# the found libraries in find_library(), often times CMake will look into the libraries
# of the wrong version when I build everything in the same CMake process. As
# a result, I (BarclayII) am launching an individual CMake build for every PyTorch version.
if(BUILD_TORCH)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR} BINDIR)
file(TO_NATIVE_PATH ${CMAKE_COMMAND} CMAKE_CMD)
if(MSVC)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tensoradapter/pytorch/build.bat BUILD_SCRIPT)
add_custom_target(
tensoradapter_pytorch
${CMAKE_COMMAND} -E env
CMAKE_COMMAND=${CMAKE_CMD}
CUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}
USE_CUDA=${USE_CUDA}
EXTERNAL_DMLC_LIB_PATH=${EXTERNAL_DMLC_LIB_PATH}
BINDIR=${BINDIR}
cmd /e:on /c ${BUILD_SCRIPT} ${TORCH_PYTHON_INTERPS}
DEPENDS ${BUILD_SCRIPT}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tensoradapter/pytorch)
else(MSVC)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tensoradapter/pytorch/build.sh BUILD_SCRIPT)
add_custom_target(
tensoradapter_pytorch
${CMAKE_COMMAND} -E env
CMAKE_COMMAND=${CMAKE_CMD}
CUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}
USE_CUDA=${USE_CUDA}
EXTERNAL_DMLC_LIB_PATH=${EXTERNAL_DMLC_LIB_PATH}
BINDIR=${CMAKE_CURRENT_BINARY_DIR}
bash ${BUILD_SCRIPT} ${TORCH_PYTHON_INTERPS}
DEPENDS ${BUILD_SCRIPT}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tensoradapter/pytorch)
endif(MSVC)
add_dependencies(dgl tensoradapter_pytorch)
endif(BUILD_TORCH)
# Installation rules
install(TARGETS dgl DESTINATION lib${LIB_SUFFIX})
# Testing
if(BUILD_CPP_TEST)
message(STATUS "Build with unittest")
add_subdirectory(./third_party/googletest)
enable_testing()
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
include_directories("include")
include_directories("third_party/dlpack/include")
include_directories("third_party/dmlc-core/include")
include_directories("third_party/tsl_robin_map/include")
include_directories("third_party/libxsmm/include")
include_directories("third_party/pcg/include")
file(GLOB_RECURSE TEST_SRC_FILES ${PROJECT_SOURCE_DIR}/tests/cpp/*.cc)
add_executable(runUnitTests ${TEST_SRC_FILES})
target_link_libraries(runUnitTests gtest gtest_main)
target_link_libraries(runUnitTests dgl)
add_test(UnitTests runUnitTests)
endif(BUILD_CPP_TEST)
if(BUILD_SPARSE)
message(STATUS "Configuring DGL sparse library")
file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR} BINDIR)
file(TO_NATIVE_PATH ${CMAKE_COMMAND} CMAKE_CMD)
get_target_property(DGL_INCLUDE_DIRS dgl INCLUDE_DIRECTORIES)
message(STATUS "DGL include directories: ${DGL_INCLUDE_DIRS}")
message(STATUS "DGL link directories: ${DGL_INCLUDE_DIRS}")
if(MSVC)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/dgl_sparse/build.bat BUILD_SCRIPT)
add_custom_target(
dgl_sparse
ALL
${CMAKE_COMMAND} -E env
CMAKE_COMMAND=${CMAKE_CMD}
CUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}
USE_CUDA=${USE_CUDA}
BINDIR=${BINDIR}
INCLUDEDIR="${DGL_INCLUDE_DIRS}"
CFLAGS=${CMAKE_C_FLAGS}
CXXFLAGS=${CMAKE_CXX_FLAGS}
LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}
cmd /e:on /c ${BUILD_SCRIPT} ${TORCH_PYTHON_INTERPS}
DEPENDS ${BUILD_SCRIPT}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/dgl_sparse)
else(MSVC)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/dgl_sparse/build.sh BUILD_SCRIPT)
add_custom_target(
dgl_sparse
ALL
${CMAKE_COMMAND} -E env
CMAKE_COMMAND=${CMAKE_CMD}
CUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}
USE_CUDA=${USE_CUDA}
BINDIR=${CMAKE_CURRENT_BINARY_DIR}
INCLUDEDIR="${DGL_INCLUDE_DIRS}"
CFLAGS=${CMAKE_C_FLAGS}
CXXFLAGS=${CMAKE_CXX_FLAGS}
LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}
bash ${BUILD_SCRIPT} ${TORCH_PYTHON_INTERPS}
DEPENDS ${BUILD_SCRIPT}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/dgl_sparse)
endif(MSVC)
add_dependencies(dgl_sparse dgl)
endif(BUILD_SPARSE)
if(BUILD_GRAPHBOLT)
message(STATUS "Configuring graphbolt library")
string(REPLACE ";" "\\;" CUDA_ARCHITECTURES_ESCAPED "${CUDA_ARCHITECTURES}")
file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR} BINDIR)
file(TO_NATIVE_PATH ${CMAKE_COMMAND} CMAKE_CMD)
if(MSVC)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/graphbolt/build.bat BUILD_SCRIPT)
add_custom_target(
graphbolt
ALL
${CMAKE_COMMAND} -E env
CMAKE_COMMAND=${CMAKE_CMD}
CUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}
USE_CUDA=${USE_CUDA}
BINDIR=${BINDIR}
CFLAGS=${CMAKE_C_FLAGS}
CXXFLAGS=${CMAKE_CXX_FLAGS}
CUDAARCHS="${CUDA_ARCHITECTURES_ESCAPED}"
LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}
cmd /e:on /c ${BUILD_SCRIPT} ${TORCH_PYTHON_INTERPS}
DEPENDS ${BUILD_SCRIPT}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/graphbolt)
else(MSVC)
file(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/graphbolt/build.sh BUILD_SCRIPT)
add_custom_target(
graphbolt
ALL
${CMAKE_COMMAND} -E env
CMAKE_COMMAND=${CMAKE_CMD}
CUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}
USE_CUDA=${USE_CUDA}
USE_LIBURING=${USE_LIBURING}
BINDIR=${CMAKE_CURRENT_BINARY_DIR}
CFLAGS=${CMAKE_C_FLAGS}
CXXFLAGS=${CMAKE_CXX_FLAGS}
CUDAARCHS="${CUDA_ARCHITECTURES_ESCAPED}"
LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}
bash ${BUILD_SCRIPT} ${TORCH_PYTHON_INTERPS}
DEPENDS ${BUILD_SCRIPT}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/graphbolt)
endif(MSVC)
endif(BUILD_GRAPHBOLT)
================================================
FILE: CONTRIBUTORS.md
================================================
## Contributing to DGL
Contribution is always welcomed. A good starting place is the roadmap issue, where
you can find our current milestones. All contributions must go through pull requests
and be reviewed by the committers. See our [contribution
guide](https://docs.dgl.ai/contribute.html) for more details.
Once your contribution is accepted and merged, congratulations, you are now a
contributor to the DGL project. We will put your name in the list below.
Contributors
------------
* [Minjie Wang](https://github.com/jermainewang) from AWS
* [Da Zheng](https://github.com/zheng-da) from AWS
* [Quan Gan](https://github.com/BarclayII) from AWS
* [Mufei Li](https://github.com/mufeili) from AWS
* [Jinjing Zhou](https://github.com/VoVAllen) from AWS
* [Xiang Song](https://github.com/classicsong) from AWS
* [Tianjun Xiao](https://github.com/sneakerkg) from AWS
* [Tong He](https://github.com/hetong007) from AWS
* [Jian Zhang](https://github.com/zhjwy9343) from AWS
* [Qipeng Guo](https://github.com/QipengGuo) from AWS
* [Xiangkun Hu](https://github.com/HuXiangkun) from AWS
* [Ying Rui](https://github.com/Rhett-Ying) from AWS
* [Israt Nisa](https://github.com/isratnisa) from AWS
* [Zheng Zhang](https://github.com/zzhang-cn) from AWS
* [Zihao Ye](https://github.com/yzh119) from University of Washington
* [Chao Ma](https://github.com/aksnzhy)
* [Qidong](https://github.com/soodoshll)
* [Lingfan Yu](https://github.com/lingfanyu) from New York University
* [Yu Gai](https://github.com/GaiYu0) from University of California, Berkeyley
* [Qi Huang]() from New York University
* [Dominique LaSalle](https://github.com/nv-dlasalle) from Nvidia
* [Pawel Piotrowcz](https://github.com/pawelpiotrowicz) from Intel
* [Michal Szarmach](https://github.com/mszarma) from Intel
* [Izabela Mazur](https://github.com/IzabelaMazur) from Intel
* [Sanchit Misra](https://github.com/sanchit-misra) from Intel
* [Andrzej Kotlowski](https://github.com/anko-intel) from Intel
* [Sheng Zha](https://github.com/szha) from AWS
* [Yifei Ma](https://github.com/yifeim) from AWS
* [Yizhi Liu](https://github.com/yzhliu) from AWS
* [Kay Liu](https://github.com/kayzliu) from UIC
* [Tianqi Zhang](https://github.com/lygztq) from SJTU
* [Hengrui Zhang](https://github.com/hengruizhang98)
* [Seung Won Min](https://github.com/davidmin7) from UIUC
* [@hbsun2113](https://github.com/hbsun2113): GraphSAGE in PyTorch
* [Tianyi Zhang](https://github.com/Tiiiger): SGC in PyTorch
* [Jun Chen](https://github.com/kitaev-chen): GIN in PyTorch
* [Aymen Waheb](https://github.com/aymenwah): APPNP in PyTorch
* [Chengqiang Lu](https://github.com/geekinglcq): MGCN, SchNet and MPNN in PyTorch
* [Gongze Cao](https://github.com/Zardinality): Cluster GCN
* [Yicheng Wu](https://github.com/MilkshakeForReal): RotatE in PyTorch
* [Hao Xiong](https://github.com/ShawXh): DeepWalk in PyTorch
* [Zhi Lin](https://github.com/kira-lin): Integrate FeatGraph into DGL
* [Andrew Tsesis](https://github.com/noncomputable): Framework-Agnostic Graph Ops
* [Brett Koonce](https://github.com/brettkoonce)
* [@giuseppefutia](https://github.com/giuseppefutia)
* [@mori97](https://github.com/mori97)
* [@xnuohz](https://github.com/xnuohz)
* [Hao Jin](https://github.com/haojin2) from Amazon
* [Xin Yao](https://github.com/yaox12) from Nvidia
* [Abdurrahman Yasar](https://github.com/ayasar70) from Nvidia
* [Shaked Brody](https://github.com/shakedbr) from Technion
* [Jiahui Liu](https://github.com/paoxiaode) from Nvidia
* [Neil Dickson](https://github.com/ndickson-nvidia) from Nvidia
* [Chang Liu](https://github.com/chang-l) from Nvidia
* [Muhammed Fatih Balin](https://github.com/mfbalin) from Nvidia and Georgia Tech
================================================
FILE: Jenkinsfile
================================================
#!/usr/bin/env groovy
// CI tests are executed within Docker containers as the 'root' user. However,
// communications between Jenkins nodes are done with the 'ubuntu' user(login
// via root is disallowed on AWS EC2 instances). Therefore, we need to change
// the file permission to allow 'ubuntu' user to access the files created by
// the 'root' user. This is achieved by running 'chmod -R 777 .'.
// Summary of Jenkins nodes:
// - linux-benchmark-node: Linux CPU node for authentication and lint check.
// number of nodes: 1
// instance type: m5.2xlarge(8 vCPUs, 32 GB memory)
// number of executors per node: 6
// number of jobs running on this node per CI run: 3
// - dgl-ci-linux-cpu: Linux CPU node for building and testing.
// number of nodes: 4
// instance type: m6i.24xlarge(96 vCPUs, 384 GB memory)
// number of executors per node: 6
// number of jobs running on this node per CI run: 8
// - dgl-ci-linux-gpu: Linux GPU node for building and testing.
// number of nodes: 4
// instance type: g4dn.4xlarge(16 vCPUs, 64 GB memory, 1 GPU)
// number of executors per node: 1
// number of jobs running on this node per CI run: 4
// - dgl-ci-windows-cpu: Windows CPU node for building and testing.
// number of nodes: 4
// instance type: m6i.8xlarge(32 vCPUs, 128 GB memory)
// number of executors per node: 2
// number of jobs running on this node per CI run: 3
dgl_linux_libs = 'build/libdgl.so, build/runUnitTests, python/dgl/_ffi/_cy3/core.cpython-*-x86_64-linux-gnu.so, build/tensoradapter/pytorch/*.so, build/dgl_sparse/*.so, build/graphbolt/*.so'
// Currently DGL on Windows is not working with Cython yet
dgl_win64_libs = "build\\dgl.dll, build\\runUnitTests.exe, build\\tensoradapter\\pytorch\\*.dll, build\\dgl_sparse\\*.dll, build\\graphbolt\\*.dll"
def init_git() {
sh "chmod -R 777 ." // Fix permission issue
sh 'rm -rf *'
sh "git config --global --add safe.directory '*'"
checkout scm
sh 'git submodule update --recursive --init'
}
def init_git_win64() {
checkout scm
bat 'git submodule update --recursive --init'
}
// pack libraries for later use
def pack_lib(name, libs) {
echo "Packing ${libs} into ${name}"
stash includes: libs, name: name
}
// unpack libraries saved before
def unpack_lib(name, libs) {
unstash name
echo "Unpacked ${libs} from ${name}"
}
def build_dgl_linux(dev) {
init_git()
sh "bash tests/scripts/build_dgl.sh ${dev}"
sh 'ls -lh /usr/lib/x86_64-linux-gnu/'
pack_lib("dgl-${dev}-linux", dgl_linux_libs)
}
def build_dgl_win64(dev) {
/* Assuming that Windows slaves are already configured with MSBuild VS2017,
* CMake and Python/pip/setuptools etc. */
init_git_win64()
bat "CALL tests\\scripts\\build_dgl.bat"
pack_lib("dgl-${dev}-win64", dgl_win64_libs)
}
def cpp_unit_test_linux(dev) {
init_git()
unpack_lib("dgl-${dev}-linux", dgl_linux_libs)
sh 'bash tests/scripts/task_cpp_unit_test.sh'
}
def cpp_unit_test_win64() {
init_git_win64()
unpack_lib('dgl-cpu-win64', dgl_win64_libs)
bat "CALL tests\\scripts\\task_cpp_unit_test.bat"
}
def unit_test_linux(backend, dev) {
init_git()
unpack_lib("dgl-${dev}-linux", dgl_linux_libs)
timeout(time: 40, unit: 'MINUTES') {
sh "bash tests/scripts/task_unit_test.sh ${backend} ${dev}"
}
}
def unit_distributed_linux(backend, dev) {
init_git()
unpack_lib("dgl-${dev}-linux", dgl_linux_libs)
timeout(time: 40, unit: 'MINUTES') {
sh "bash tests/scripts/task_distributed_test.sh ${backend} ${dev}"
}
}
def unit_test_cugraph(backend, dev) {
init_git()
unpack_lib("dgl-${dev}-linux", dgl_linux_libs)
timeout(time: 15, unit: 'MINUTES') {
sh "bash tests/scripts/cugraph_unit_test.sh ${backend}"
}
}
def unit_test_win64(backend, dev) {
init_git_win64()
unpack_lib("dgl-${dev}-win64", dgl_win64_libs)
timeout(time: 50, unit: 'MINUTES') {
bat "CALL tests\\scripts\\task_unit_test.bat ${backend}"
}
}
def example_test_linux(backend, dev) {
init_git()
unpack_lib("dgl-${dev}-linux", dgl_linux_libs)
timeout(time: 20, unit: 'MINUTES') {
sh "bash tests/scripts/task_example_test.sh ${dev}"
}
}
def example_test_win64(backend, dev) {
init_git_win64()
unpack_lib("dgl-${dev}-win64", dgl_win64_libs)
timeout(time: 20, unit: 'MINUTES') {
bat "CALL tests\\scripts\\task_example_test.bat ${dev}"
}
}
def tutorial_test_linux(backend) {
init_git()
unpack_lib('dgl-cpu-linux', dgl_linux_libs)
timeout(time: 20, unit: 'MINUTES') {
sh "bash tests/scripts/task_${backend}_tutorial_test.sh"
}
}
def go_test_linux() {
init_git()
unpack_lib('dgl-cpu-linux', dgl_linux_libs)
timeout(time: 20, unit: 'MINUTES') {
sh "bash tests/scripts/task_go_test.sh"
}
}
def is_authorized(name) {
def devs = [
// System:
'dgl-bot', 'noreply',
// Core:
'Rhett-Ying', 'BarclayII', 'jermainewang', 'mufeili', 'isratnisa',
'rudongyu', 'classicsong', 'HuXiangkun', 'hetong007', 'kylasa',
'frozenbugs', 'peizhou001', 'zheng-da', 'czkkkkkk', 'thvasilo',
// Intern:
'pyynb', 'az15240', 'BowenYao18', 'kec020', 'Liu-rj',
// Friends:
'nv-dlasalle', 'yaox12', 'chang-l', 'Kh4L', 'VibhuJawa', 'kkranen',
'TristonC', 'mfbalin',
'bgawrych', 'itaraban', 'daniil-sizov', 'anko-intel', 'Kacper-Pietkun',
'hankaj', 'agrabows', 'DominikaJedynak', 'RafLit', 'CfromBU',
// Emeritus:
'VoVAllen',
]
return (name in devs)
}
def is_admin(name) {
def admins = ['dgl-bot', 'Rhett-Ying', 'BarclayII', 'jermainewang']
return (name in admins)
}
def regression_test_done = false
pipeline {
agent any
triggers {
issueCommentTrigger('@dgl-bot.*')
}
stages {
// Below 2 stages are to authenticate the change/comment author.
// Only core developers are allowed to trigger CI.
// Such authentication protects CI from malicious code which may bring CI instances down.
stage('Authentication') {
agent {
docker {
label 'linux-benchmark-node'
image 'dgllib/dgl-ci-lint'
alwaysPull true
}
}
when { not { triggeredBy 'IssueCommentCause' } }
steps {
script {
def author = env.CHANGE_AUTHOR
def prOpenTriggerCause = currentBuild.getBuildCauses('jenkins.branch.BranchEventCause')
def first_run = prOpenTriggerCause && env.BUILD_ID == '1'
if (author && !is_authorized(author)) {
pullRequest.comment("Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment: \n - `@dgl-bot`")
error("Authentication failed.")
}
if (first_run) {
pullRequest.comment('To trigger regression tests: \n - `@dgl-bot run [instance-type] [which tests] [compare-with-branch]`; \n For example: `@dgl-bot run g4dn.4xlarge all dmlc/master` or `@dgl-bot run c5.9xlarge kernel,api dmlc/master`')
}
}
}
}
stage('AuthenticationComment') {
agent {
docker {
label 'linux-benchmark-node'
image 'dgllib/dgl-ci-lint'
alwaysPull true
}
}
when { triggeredBy 'IssueCommentCause' }
steps {
script {
def author = env.GITHUB_COMMENT_AUTHOR
if (!is_authorized(author)) {
pullRequest.comment("Not authorized to trigger CI via issuing comment.")
error("Authentication failed.")
}
}
}
}
stage('Regression Test') {
agent {
docker {
label 'linux-benchmark-node'
image 'dgllib/dgl-ci-lint'
alwaysPull true
}
}
when { triggeredBy 'IssueCommentCause' }
steps {
checkout scm
script {
def comment = env.GITHUB_COMMENT
def command_lists = comment.split(' ')
if (command_lists.size() == 1) {
// CI command, not for regression
return
}
if (command_lists.size() != 5) {
pullRequest.comment('Cannot run the regression test due to unknown command')
error('Unknown command')
}
def author = env.GITHUB_COMMENT_AUTHOR
echo("${env.GIT_URL}")
echo("${env}")
if (!is_admin(author)) {
error('Not authorized to launch regression tests')
}
dir('benchmark_scripts_repo') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']],
userRemoteConfigs: [[credentialsId: 'github', url: 'https://github.com/dglai/DGL_scripts.git']]])
}
sh('cp benchmark_scripts_repo/benchmark/* benchmarks/scripts/')
def instance_type = command_lists[2].replace('.', '')
pullRequest.comment("Start the Regression test. View at ${RUN_DISPLAY_URL}")
def prNumber = env.BRANCH_NAME.replace('PR-', '')
dir('benchmarks/scripts') {
sh('python3 -m pip install boto3')
sh("PYTHONUNBUFFERED=1 GIT_PR_ID=${prNumber} GIT_URL=${env.GIT_URL} GIT_BRANCH=${env.CHANGE_BRANCH} python3 run_reg_test.py --data-folder ${env.GIT_COMMIT}_${instance_type} --run-cmd '${comment}'")
}
pullRequest.comment("Finished the Regression test. Result table is at https://dgl-asv-data.s3-us-west-2.amazonaws.com/${env.GIT_COMMIT}_${instance_type}/results/result.csv. Jenkins job link is ${RUN_DISPLAY_URL}. ")
currentBuild.result = 'SUCCESS'
regression_test_done = true
}
}
}
stage('CI') {
when { expression { !regression_test_done } }
stages {
stage('Abort Previous CI') {
steps {
script {
if (env.BRANCH_NAME != "master") {
// Jenkins will abort an older build if a newer build already
// passed a higher milestone.
// https://www.jenkins.io/doc/pipeline/steps/pipeline-milestone-step/
def buildNumber = env.BUILD_NUMBER as int
for (int i = 1; i <= buildNumber; i++) {
milestone(i)
}
}
}
}
}
stage('Lint Check') {
agent {
docker {
label "linux-benchmark-node"
image "dgllib/dgl-ci-lint"
alwaysPull true
}
}
steps {
init_git()
sh 'bash tests/scripts/task_lint.sh'
}
post {
always {
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('Build') {
parallel {
stage('CPU Build') {
agent {
docker {
label "dgl-ci-linux-cpu"
image "dgllib/dgl-ci-cpu:v240511_1440"
args "-u root"
alwaysPull true
}
}
steps {
build_dgl_linux('cpu')
}
post {
always {
sh "chmod -R 777 ." // Fix permission issue
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('GPU Build') {
agent {
docker {
label "dgl-ci-linux-cpu"
image "dgllib/dgl-ci-gpu:cu121_v240511_1440"
args "-u root"
alwaysPull true
}
}
steps {
// sh "nvidia-smi"
build_dgl_linux('gpu')
}
post {
always {
sh "chmod -R 777 ." // Fix permission issue
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('PyTorch Cugraph GPU Build') {
agent {
docker {
label "dgl-ci-linux-cpu"
image "rapidsai/cugraph_stable_torch-cuda:11.8-base-ubuntu20.04-py3.10-pytorch2.0.0-rapids23.04"
args "-u root"
alwaysPull true
}
}
steps {
build_dgl_linux('cugraph')
}
post {
always {
sh "chmod -R 777 ." // Fix permission issue
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('CPU Build (Win64)') {
agent { label 'dgl-ci-windows-cpu' }
steps {
build_dgl_win64('cpu')
}
post {
always {
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
// Currently we don't have Windows GPU build machines
}
}
stage('Test') {
parallel {
stage('C++ CPU') {
agent {
docker {
label "dgl-ci-linux-cpu"
image "dgllib/dgl-ci-cpu:v240511_1440"
args "-u root"
alwaysPull true
}
}
steps {
cpp_unit_test_linux('cpu')
}
post {
always {
sh "chmod -R 777 ." // Fix permission issue
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('C++ GPU') {
agent {
docker {
label "dgl-ci-linux-gpu"
image "dgllib/dgl-ci-gpu:cu121_v240511_1440"
args "-u root --runtime nvidia"
alwaysPull true
}
}
steps {
cpp_unit_test_linux('gpu')
}
post {
always {
sh "chmod -R 777 ." // Fix permission issue
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('C++ CPU (Win64)') {
agent { label 'dgl-ci-windows-cpu' }
steps {
cpp_unit_test_win64()
}
post {
always {
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('Tensorflow CPU') {
agent {
docker {
label "dgl-ci-linux-cpu"
image "dgllib/dgl-ci-cpu:v230810"
args "-u root"
alwaysPull true
}
}
stages {
stage('Tensorflow CPU Unit test') {
steps {
unit_test_linux('tensorflow', 'cpu')
}
// Tensorflow is deprecated.
when { expression { false } }
}
}
post {
always {
sh "chmod -R 777 ." // Fix permission issue
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('Tensorflow GPU') {
agent {
docker {
label "dgl-ci-linux-gpu"
image "dgllib/dgl-ci-gpu:cu121_v240511_1440"
args "-u root --runtime nvidia"
alwaysPull true
}
}
stages {
stage('Tensorflow GPU Unit test') {
steps {
unit_test_linux('tensorflow', 'gpu')
}
// Tensorflow does not support cuda 11.6 yet.
when { expression { false } }
}
}
post {
always {
sh "chmod -R 777 ." // Fix permission issue
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('Torch CPU') {
agent {
docker {
label "dgl-ci-linux-cpu"
image "dgllib/dgl-ci-cpu:v240511_1440"
args "-u root --shm-size=4gb"
alwaysPull true
}
}
stages {
stage('Torch CPU Unit test') {
steps {
unit_test_linux('pytorch', 'cpu')
}
}
stage('Torch CPU Example test') {
steps {
example_test_linux('pytorch', 'cpu')
}
}
stage('Torch CPU Tutorial test') {
steps {
tutorial_test_linux('pytorch')
}
}
}
post {
always {
sh "chmod -R 777 ." // Fix permission issue
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('Torch CPU (Win64)') {
agent { label 'dgl-ci-windows-cpu' }
stages {
stage('Torch CPU (Win64) Unit test') {
steps {
unit_test_win64('pytorch', 'cpu')
}
}
stage('Torch CPU (Win64) Example test') {
steps {
example_test_win64('pytorch', 'cpu')
}
}
}
post {
always {
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('Torch GPU') {
agent {
docker {
label "dgl-ci-linux-gpu"
image "dgllib/dgl-ci-gpu:cu121_v240511_1440"
args "-u root --runtime nvidia --shm-size=8gb"
alwaysPull true
}
}
stages {
stage('Torch GPU Unit test') {
steps {
sh 'nvidia-smi'
unit_test_linux('pytorch', 'gpu')
}
}
stage('Torch GPU Example test') {
steps {
example_test_linux('pytorch', 'gpu')
}
}
}
post {
always {
sh "chmod -R 777 ." // Fix permission issue
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('Distributed') {
agent {
docker {
label "dgl-ci-linux-cpu"
image "dgllib/dgl-ci-cpu:v240511_1440"
args "-u root --shm-size=8gb"
alwaysPull true
}
}
stages {
stage('Distributed Torch CPU Unit test') {
steps {
unit_distributed_linux('pytorch', 'cpu')
}
}
}
post {
always {
sh "chmod -R 777 ." // Fix permission issue
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('PyTorch Cugraph GPU') {
agent {
docker {
label "dgl-ci-linux-gpu"
image "rapidsai/cugraph_stable_torch-cuda:11.8-base-ubuntu20.04-py3.10-pytorch2.0.0-rapids23.04"
args "-u root --runtime nvidia --shm-size=8gb"
alwaysPull true
}
}
stages {
stage('PyTorch Cugraph GPU Unit test') {
steps {
sh 'nvidia-smi'
unit_test_cugraph('pytorch', 'cugraph')
}
// Cugraph is under refactoring. Skip the test for now.
when { expression { false } }
}
}
post {
always {
sh "chmod -R 777 ." // Fix permission issue
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
stage('DGL-Go') {
agent {
docker {
label "dgl-ci-linux-cpu"
image "dgllib/dgl-ci-cpu:v240511_1440"
args "-u root"
alwaysPull true
}
}
stages {
stage('DGL-Go CPU test') {
steps {
go_test_linux()
}
}
}
post {
always {
sh "chmod -R 777 ." // Fix permission issue
cleanWs disableDeferredWipeout: true, deleteDirs: true
}
}
}
}
}
}
}
}
post {
always {
script {
node("dglci-post-linux") {
docker.image('dgllib/dgl-ci-awscli:v220418').inside("--pull always --entrypoint=''") {
sh("rm -rf ci_tmp")
dir('ci_tmp') {
sh("curl -k -o cireport.log ${BUILD_URL}consoleText")
sh("curl -o report.py https://raw.githubusercontent.com/dmlc/dgl/master/tests/scripts/ci_report/report.py")
sh("curl -o status.py https://raw.githubusercontent.com/dmlc/dgl/master/tests/scripts/ci_report/status.py")
sh("curl -k -L ${BUILD_URL}wfapi")
sh("cat status.py")
sh("pytest --html=report.html --self-contained-html report.py || true")
sh("aws s3 sync ./ s3://dgl-ci-result/${JOB_NAME}/${BUILD_NUMBER}/${BUILD_ID}/logs/ --exclude '*' --include '*.log' --acl public-read --content-type text/plain")
sh("aws s3 sync ./ s3://dgl-ci-result/${JOB_NAME}/${BUILD_NUMBER}/${BUILD_ID}/logs/ --exclude '*.log' --acl public-read")
def comment = sh(returnStdout: true, script: "python3 status.py --result ${currentBuild.currentResult}").trim()
echo(comment)
if ((env.BRANCH_NAME).startsWith('PR-')) {
pullRequest.comment(comment)
}
}
}
}
node('dgl-ci-windows-cpu') {
bat(script: "rmvirtualenv ${BUILD_TAG}", returnStatus: true)
}
}
}
}
}
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: NEWS.md
================================================
DGL release and change logs
==========
Refer to the roadmap issue for the on-going versions and features.
0.2
---
Major release that includes many features, bugfix and performance improvement.
Speed of GCN model on Pubmed dataset has been improved by **4.19x**! Speed of
RGCN model on Mutag dataset has been improved by **7.35x**! Important new
feature: **graph sampling APIs**.
Update details:
# Model examples
- [x] TreeLSTM w/ MXNet (PR #279 by @szha )
- [x] GraphSage (@ZiyueHuang )
- [x] Improve GAT model speed (PR #348 by @jermainewang )
# Core system improvement
- [x] Immutable CSR graph structure (PR #342 by @zheng-da )
- [x] Finish remaining functionality (Issue #369, PR #404 by @yzh119)
- [x] Nodeflow data structure (PR #361 by @zheng-da )
- [x] Neighbor sampler (PR #322 )
- [x] Layer-wise sampler (PR #362 by @GaiYu0 )
- [x] Multi-GPU support by data parallelism (PR #356 #338 by @ylfdq1118 )
- [x] More dataset:
- [x] Reddit dataset loader (PR #372 by @ZiyueHuang )
- [x] PPI dataset loader (PR #395 by @sufeidechabei )
- [x] Mini graph classification dataset (PR #364 by @mufeili )
- [x] NN modules (PR #406 by @jermainewang @mufeili)
- [x] GraphConv layer
- [x] Edge softmax layer
- [x] Edge group apply API (PR #358 by @VoVAllen )
- [x] Reversed graph and transform.py module (PR #331 by @mufeili )
- [x] Max readout (PR #341 by @mufeili )
- [x] Random walk APIs (PR #392 by @BarclayII )
# Tutorial/Blog
- [x] Batched graph classification in DGL (PR #360 by @mufeili )
- [x] Understanding GAT (@sufeidechabei )
# Project improvement
- [x] Python lint check (PR #330 by @jermainewang )
- [x] Win CI (PR #324 by @BarclayII )
- [x] Auto doc build (by @VoVAllen )
- [x] Unify tests for different backends (PR #333 by @BarclayII )
0.1.3
-----
Bug fix
* Compatible with Pytorch v1.0
* Bug fix in networkx graph conversion.
0.1.2
-----
First open release.
* Basic graph APIs.
* Basic message passing APIs.
* Pytorch backend.
* MXNet backend.
* Optimization using SPMV.
* Model examples w/ Pytorch:
- GCN
- GAT
- JTNN
- DGMG
- Capsule
- LGNN
- RGCN
- Transformer
- TreeLSTM
* Model examples w/ MXNet:
- GCN
- GAT
- RGCN
- SSE
================================================
FILE: README.md
================================================
<p align="center">
<img src="http://data.dgl.ai/asset/logo.jpg" height="200">
</p>
[](https://github.com/dmlc/dgl/releases)
[](https://anaconda.org/dglteam/dgl)
[](https://ci.dgl.ai/job/DGL/job/master/)
[](https://asv.dgl.ai/)
[](./LICENSE)
[](https://twitter.com/GraphDeep)
[Website](https://www.dgl.ai) | [A Blitz Introduction to DGL](https://docs.dgl.ai/tutorials/blitz/index.html) | Documentation ([Latest](https://www.dgl.ai/dgl_docs/) | [Official Examples](examples/README.md) | [Discussion Forum](https://discuss.dgl.ai) | [Slack Channel](https://join.slack.com/t/deep-graph-library/shared_invite/zt-eb4ict1g-xcg3PhZAFAB8p6dtKuP6xQ)
DGL is an easy-to-use, high performance and scalable Python package for deep learning on graphs. DGL is framework agnostic, meaning if a deep graph model is a component of an end-to-end application, the rest of the logics can be implemented in any major frameworks, such as PyTorch, Apache MXNet or TensorFlow.
<p align="center">
<img src="http://data.dgl.ai/asset/image/DGL-Arch.png" alt="DGL v0.4 architecture" width="600">
<br>
<b>Figure</b>: DGL Overall Architecture
</p>
## Highlighted Features
### A GPU-ready graph library
DGL provides a powerful graph object that can reside on either CPU or GPU. It bundles structural data as well as features for better control. We provide a variety of functions for computing with graph objects including efficient and customizable message passing primitives for Graph Neural Networks.
### A versatile tool for GNN researchers and practitioners
The field of graph deep learning is still rapidly evolving and many research ideas emerge by standing on the shoulders of giants. To ease the process, [DGl-Go](https://github.com/dmlc/dgl/tree/master/dglgo) is a command-line interface to get started with training, using and studying state-of-the-art GNNs.
DGL collects a rich set of [example implementations](https://github.com/dmlc/dgl/tree/master/examples) of popular GNN models of a wide range of topics. Researchers can [search](https://www.dgl.ai/) for related models to innovate new ideas from or use them as baselines for experiments. Moreover, DGL provides many state-of-the-art [GNN layers and modules](https://docs.dgl.ai/api/python/nn.html) for users to build new model architectures. DGL is one of the preferred platforms for many standard graph deep learning benchmarks including [OGB](https://ogb.stanford.edu/) and [GNNBenchmarks](https://github.com/graphdeeplearning/benchmarking-gnns).
### Easy to learn and use
DGL provides plenty of learning materials for all kinds of users from ML researchers to domain experts. The [Blitz Introduction to DGL](https://docs.dgl.ai/tutorials/blitz/index.html) is a 120-minute tour of the basics of graph machine learning. The [User Guide](https://docs.dgl.ai/guide/index.html) explains in more details the concepts of graphs as well as the training methodology. All of them include code snippets in DGL that are runnable and ready to be plugged into one’s own pipeline.
### Scalable and efficient
It is convenient to train models using DGL on large-scale graphs across **multiple GPUs** or **multiple machines**. DGL extensively optimizes the whole stack to reduce the overhead in communication, memory consumption and synchronization. As a result, DGL can easily scale to billion-sized graphs. Get started with the [tutorials](https://docs.dgl.ai/en/tutorials/dist/index.html) and [user guide](https://docs.dgl.ai/en/latest/guide/distributed.html) for distributed training. See the [system performance note](https://docs.dgl.ai/performance.html) for the comparison with other tools.
## Get Started
Users can install DGL from [pip and conda](https://www.dgl.ai/pages/start.html). You can also download GPU enabled DGL docker [containers](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/dgl) (backended by PyTorch) from NVIDIA NGC for both x86 and ARM based linux systems. Advanced users can follow the [instructions](https://docs.dgl.ai/install/index.html#install-from-source) to install from source.
For absolute beginners, start with [the Blitz Introduction to DGL](https://docs.dgl.ai/tutorials/blitz/index.html). It covers the basic concepts of common graph machine learning tasks and a step-by-step on building Graph Neural Networks (GNNs) to solve them.
For acquainted users who wish to learn more,
* Experience state-of-the-art GNN models in only two command-lines using [DGL-Go](https://github.com/dmlc/dgl/tree/master/dglgo).
* Learn DGL by [example implementations](https://www.dgl.ai/) of popular GNN models.
* Read the [User Guide](https://docs.dgl.ai/guide/index.html) ([中文版链接](https://docs.dgl.ai/guide_cn/index.html)), which explains the concepts and usage of DGL in much more details.
* Go through the tutorials for advanced features like [stochastic training of GNNs](https://docs.dgl.ai/tutorials/large/index.html), training on [multi-GPU](https://docs.dgl.ai/tutorials/multi/index.html) or [multi-machine](https://docs.dgl.ai/tutorials/dist/index.html).
* [Study classical papers](https://docs.dgl.ai/tutorials/models/index.html) on graph machine learning alongside DGL.
* Search for the usage of a specific API in the [API reference manual](https://docs.dgl.ai/api/python/index.html), which organizes all DGL APIs by their namespace.
All the learning materials are available at our [documentation site](https://docs.dgl.ai/). If you are new to deep learning in general,
check out the open source book [Dive into Deep Learning](https://d2l.ai/).
## Community
### Get connected
We provide multiple channels to connect you to the community of the DGL developers, users, and the general GNN academic researchers:
* Our Slack channel, [click to join](https://join.slack.com/t/deep-graph-library/shared_invite/zt-eb4ict1g-xcg3PhZAFAB8p6dtKuP6xQ)
* Our discussion forum: https://discuss.dgl.ai/
* Our [Zhihu blog (in Chinese)](https://www.zhihu.com/column/c_1070749881013936128)
* Monthly GNN User Group online seminar ([event link](https://www.eventbrite.com/e/graph-neural-networks-user-group-tickets-137512275919?utm-medium=discovery&utm-campaign=social&utm-content=attendeeshare&aff=escb&utm-source=cp&utm-term=listing) | [past videos](https://www.youtube.com/channel/UCnmuSDY1pTlaFH1WRQElfTg))
Take the survey [here](https://forms.gle/Ej3jHCocACmb49Gp8) and leave any feedback to make DGL better fit for your needs. Thanks!
### DGL-powered projects
* DGL-LifeSci: a DGL-based package for various applications in life science with graph neural networks. https://github.com/awslabs/dgl-lifesci
* DGL-KE: a high performance, easy-to-use, and scalable package for learning large-scale knowledge graph embeddings. https://github.com/awslabs/dgl-ke
* Benchmarking GNN: https://github.com/graphdeeplearning/benchmarking-gnns
* OGB: a collection of realistic, large-scale, and diverse benchmark datasets for machine learning on graphs. https://ogb.stanford.edu/
* Graph4NLP: an easy-to-use library for R&D at the intersection of Deep Learning on Graphs and Natural Language Processing. https://github.com/graph4ai/graph4nlp
* GNN-RecSys: https://github.com/je-dbl/GNN-RecSys
* Amazon Neptune ML: a new capability of Neptune that uses Graph Neural Networks (GNNs), a machine learning technique purpose-built for graphs, to make easy, fast, and more accurate predictions using graph data. https://aws.amazon.com/cn/neptune/machine-learning/
* GNNLens2: Visualization tool for Graph Neural Networks. https://github.com/dmlc/GNNLens2
* RNAGlib: A package to facilitate construction, analysis, visualization and machine learning on RNA 2.5D Graphs. Includes a pre-built dataset: https://rnaglib.cs.mcgill.ca
* OpenHGNN: Model zoo and benchmarks for Heterogeneous Graph Neural Networks. https://github.com/BUPT-GAMMA/OpenHGNN
* TGL: A graph learning framework for large-scale temporal graphs. https://github.com/amazon-research/tgl
* gtrick: Bag of Tricks for Graph Neural Networks. https://github.com/sangyx/gtrick
* ArangoDB-DGL Adapter: Import [ArangoDB](https://github.com/arangodb/arangodb) graphs into DGL and vice-versa. https://github.com/arangoml/dgl-adapter
* DGLD: [DGLD](https://github.com/EagleLab-ZJU/DGLD) is an open-source library for Deep Graph Anomaly Detection based on pytorch and DGL.
### Awesome Papers Using DGL
1. [**Benchmarking Graph Neural Networks**](https://arxiv.org/pdf/2003.00982.pdf), *Vijay Prakash Dwivedi, Chaitanya K. Joshi, Thomas Laurent, Yoshua Bengio, Xavier Bresson*
1. [**Open Graph Benchmarks: Datasets for Machine Learning on Graphs**](https://arxiv.org/pdf/2005.00687.pdf), NeurIPS'20, *Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, Jure Leskovec*
1. [**DropEdge: Towards Deep Graph Convolutional Networks on Node Classification**](https://openreview.net/pdf?id=Hkx1qkrKPr), ICLR'20, *Yu Rong, Wenbing Huang, Tingyang Xu, Junzhou Huan*
1. [**Discourse-Aware Neural Extractive Text Summarization**](https://www.aclweb.org/anthology/2020.acl-main.451/), ACL'20, *Jiacheng Xu, Zhe Gan, Yu Cheng, Jingjing Liu*
1. [**GCC: Graph Contrastive Coding for Graph Neural Network Pre-Training**](https://dl.acm.org/doi/pdf/10.1145/3394486.3403168?casa_token=EClsH2Vc4DcAAAAA:LIB8cbtr6yTDbYuv4cTLwTIYeDq5Y2dhj_ktcWdKpzdPLGeiuL0o8GlcN4QIOnpsAnmGeGVZ), KDD'20, *Jiezhong Qiu, Qibin Chen, Yuxiao Dong, Jing Zhang, Hongxia Yang, Ming Ding, Kuansan Wang, Jie Tang*
1. [**DGL-KE: Training Knowledge Graph Embeddings at Scale**](https://arxiv.org/pdf/2004.08532), SIGIR'20, *Da Zheng, Xiang Song, Chao Ma, Zeyuan Tan, Zihao Ye, Jin Dong, Hao Xiong, Zheng Zhang, George Karypis*
1. [**Improving Graph Neural Network Expressivity via Subgraph Isomorphism Counting**](https://arxiv.org/pdf/2006.09252.pdf), *Giorgos Bouritsas, Fabrizio Frasca, Stefanos Zafeiriou, Michael M. Bronstein*
1. [**INT: An Inequality Benchmark for Evaluating Generalization in Theorem Proving**](https://arxiv.org/pdf/2007.02924.pdf), *Yuhuai Wu, Albert Q. Jiang, Jimmy Ba, Roger Grosse*
1. [**Finding Patient Zero: Learning Contagion Source with Graph Neural Networks**](https://arxiv.org/pdf/2006.11913.pdf), *Chintan Shah, Nima Dehmamy, Nicola Perra, Matteo Chinazzi, Albert-László Barabási, Alessandro Vespignani, Rose Yu*
1. [**FeatGraph: A Flexible and Efficient Backend for Graph Neural Network Systems**](https://arxiv.org/pdf/2008.11359.pdf), SC'20, *Yuwei Hu, Zihao Ye, Minjie Wang, Jiali Yu, Da Zheng, Mu Li, Zheng Zhang, Zhiru Zhang, Yida Wang*
<details><summary>more</summary>
11. [**BP-Transformer: Modelling Long-Range Context via Binary Partitioning.**](https://arxiv.org/pdf/1911.04070.pdf), *Zihao Ye, Qipeng Guo, Quan Gan, Xipeng Qiu, Zheng Zhang*
12. [**OptiMol: Optimization of Binding Affinities in Chemical Space for Drug Discovery**](https://www.biorxiv.org/content/biorxiv/early/2020/06/16/2020.05.23.112201.full.pdf), *Jacques Boitreaud,Vincent Mallet, Carlos Oliver, Jérôme Waldispühl*
1. [**JAKET: Joint Pre-training of Knowledge Graph and Language Understanding**](https://arxiv.org/pdf/2010.00796.pdf), *Donghan Yu, Chenguang Zhu, Yiming Yang, Michael Zeng*
1. [**Architectural Implications of Graph Neural Networks**](https://arxiv.org/pdf/2009.00804.pdf), *Zhihui Zhang, Jingwen Leng, Lingxiao Ma, Youshan Miao, Chao Li, Minyi Guo*
1. [**Combining Reinforcement Learning and Constraint Programming for Combinatorial Optimization**](https://arxiv.org/pdf/2006.01610.pdf), *Quentin Cappart, Thierry Moisan, Louis-Martin Rousseau1, Isabeau Prémont-Schwarz, and Andre Cire*
1. [**Therapeutics Data Commons: Machine Learning Datasets and Tasks for Therapeutics**](https://arxiv.org/abs/2102.09548) ([code repo](https://github.com/mims-harvard/TDC)), *Kexin Huang, Tianfan Fu, Wenhao Gao, Yue Zhao, Yusuf Roohani, Jure Leskovec, Connor W. Coley, Cao Xiao, Jimeng Sun, Marinka Zitnik*
1. [**Sparse Graph Attention Networks**](https://arxiv.org/abs/1912.00552), *Yang Ye, Shihao Ji*
1. [**On Self-Distilling Graph Neural Network**](https://arxiv.org/pdf/2011.02255.pdf), *Yuzhao Chen, Yatao Bian, Xi Xiao, Yu Rong, Tingyang Xu, Junzhou Huang*
1. [**Learning Robust Node Representations on Graphs**](https://arxiv.org/pdf/2008.11416.pdf), *Xu Chen, Ya Zhang, Ivor Tsang, and Yuangang Pan*
1. [**Recurrent Event Network: Autoregressive Structure Inference over Temporal Knowledge Graphs**](https://arxiv.org/abs/1904.05530), *Woojeong Jin, Meng Qu, Xisen Jin, Xiang Ren*
1. [**Graph Neural Ordinary Differential Equations**](https://arxiv.org/abs/1911.07532), *Michael Poli, Stefano Massaroli, Junyoung Park, Atsushi Yamashita, Hajime Asama, Jinkyoo Park*
1. [**FusedMM: A Unified SDDMM-SpMM Kernel for Graph Embedding and Graph Neural Networks**](https://arxiv.org/pdf/2011.06391.pdf), *Md. Khaledur Rahman, Majedul Haque Sujon, , Ariful Azad*
1. [**An Efficient Neighborhood-based Interaction Model for Recommendation on Heterogeneous Graph**](https://arxiv.org/pdf/2007.00216.pdf), KDD'20 *Jiarui Jin, Jiarui Qin, Yuchen Fang, Kounianhua Du, Weinan Zhang, Yong Yu, Zheng Zhang, Alexander J. Smola*
1. [**Learning Interaction Models of Structured Neighborhood on Heterogeneous Information Network**](https://arxiv.org/pdf/2011.12683.pdf), *Jiarui Jin, Kounianhua Du, Weinan Zhang, Jiarui Qin, Yuchen Fang, Yong Yu, Zheng Zhang, Alexander J. Smola*
1. [**Graphein - a Python Library for Geometric Deep Learning and Network Analysis on Protein Structures**](https://www.biorxiv.org/content/10.1101/2020.07.15.204701v1), *Arian R. Jamasb, Pietro Lió, Tom L. Blundell*
1. [**Graph Policy Gradients for Large Scale Robot Control**](https://arxiv.org/abs/1907.03822), *Arbaaz Khan, Ekaterina Tolstaya, Alejandro Ribeiro, Vijay Kumar*
1. [**Heterogeneous Molecular Graph Neural Networks for Predicting Molecule Properties**](https://arxiv.org/abs/2009.12710), *Zeren Shui, George Karypis*
1. [**Could Graph Neural Networks Learn Better Molecular Representation for Drug Discovery? A Comparison Study of Descriptor-based and Graph-based Models**](https://assets.researchsquare.com/files/rs-81439/v1_stamped.pdf), *Dejun Jiang, Zhenxing Wu, Chang-Yu Hsieh, Guangyong Chen, Ben Liao, Zhe Wang, Chao Shen, Dongsheng Cao, Jian Wu, Tingjun Hou*
1. [**Principal Neighbourhood Aggregation for Graph Nets**](https://arxiv.org/abs/2004.05718), *Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Liò, Petar Veličković*
1. [**Collective Multi-type Entity Alignment Between Knowledge Graphs**](https://dl.acm.org/doi/abs/10.1145/3366423.3380289), *Qi Zhu, Hao Wei, Bunyamin Sisman, Da Zheng, Christos Faloutsos, Xin Luna Dong, Jiawei Han*
1. [**Graph Representation Forecasting of Patient's Medical Conditions: towards A Digital Twin**](https://arxiv.org/abs/2009.08299), *Pietro Barbiero, Ramon Viñas Torné, Pietro Lió*
1. [**Relational Graph Learning on Visual and Kinematics Embeddings for Accurate Gesture Recognition in Robotic Surgery**](https://arxiv.org/abs/2011.01619), *Yong-Hao Long, Jie-Ying Wu, Bo Lu, Yue-Ming Jin, Mathias Unberath, Yun-Hui Liu, Pheng-Ann Heng and Qi Dou*
1. [**Dark Reciprocal-Rank: Boosting Graph-Convolutional Self-Localization Network via Teacher-to-student Knowledge Transfer**](https://arxiv.org/abs/2011.00402), *Takeda Koji, Tanaka Kanji*
1. [**Graph InfoClust: Leveraging Cluster-Level Node Information For Unsupervised Graph Representation Learning**](https://arxiv.org/abs/2009.06946), *Costas Mavromatis, George Karypis*
1. [**GraphSeam: Supervised Graph Learning Framework for Semantic UV Mapping**](https://arxiv.org/abs/2011.13748), *Fatemeh Teimury, Bruno Roy, Juan Sebastian Casallas, David macdonald, Mark Coates*
1. [**Comprehensive Study on Molecular Supervised Learning with Graph Neural Networks**](https://pubs.acs.org/doi/10.1021/acs.jcim.0c00416), *Doyeong Hwang, Soojung Yang, Yongchan Kwon, Kyung Hoon Lee, Grace Lee, Hanseok Jo, Seyeol Yoon, and Seongok Ryu*
1. [**A graph auto-encoder model for miRNA-disease associations prediction**](https://academic.oup.com/bib/advance-article-abstract/doi/10.1093/bib/bbaa240/5929824?redirectedFrom=fulltext), *Zhengwei Li, Jiashu Li, Ru Nie, Zhu-Hong You, Wenzheng Bao*
1. [**Graph convolutional regression of cardiac depolarization from sparse endocardial maps**](https://arxiv.org/abs/2009.14068), STACOM 2020 workshop, *Felix Meister, Tiziano Passerini, Chloé Audigier, Èric Lluch, Viorel Mihalef, Hiroshi Ashikaga, Andreas Maier, Henry Halperin, Tommaso Mansi*
1. [**AttnIO: Knowledge Graph Exploration with In-and-Out Attention Flow for Knowledge-Grounded Dialogue**](https://www.aclweb.org/anthology/2020.emnlp-main.280/), EMNLP'20, *Jaehun Jung, Bokyung Son, Sungwon Lyu*
1. [**Learning from Non-Binary Constituency Trees via Tensor Decomposition**](https://github.com/danielecastellana22/tensor-tree-nn), COLING'20, *Daniele Castellana, Davide Bacciu*
1. [**Inducing Alignment Structure with Gated Graph Attention Networks for Sentence Matching**](https://arxiv.org/abs/2010.07668), *Peng Cui, Le Hu, Yuanchao Liu*
1. [**Enhancing Extractive Text Summarization with Topic-Aware Graph Neural Networks**](https://arxiv.org/abs/2010.06253), COLING'20, *Peng Cui, Le Hu, Yuanchao Liu*
1. [**Double Graph Based Reasoning for Document-level Relation Extraction**](https://arxiv.org/abs/2009.13752), EMNLP'20, *Shuang Zeng, Runxin Xu, Baobao Chang, Lei Li*
1. [**Systematic Generalization on gSCAN with Language Conditioned Embedding**](https://arxiv.org/abs/2009.05552), AACL-IJCNLP'20, *Tong Gao, Qi Huang, Raymond J. Mooney*
1. [**Automatic selection of clustering algorithms using supervised graph embedding**](https://arxiv.org/pdf/2011.08225.pdf), *Noy Cohen-Shapira, Lior Rokach*
1. [**Improving Learning to Branch via Reinforcement Learning**](https://openreview.net/forum?id=z4D7-PTxTb), *Haoran Sun, Wenbo Chen, Hui Li, Le Song*
1. [**A Practical Guide to Graph Neural Networks**](https://arxiv.org/pdf/2010.05234.pdf), *Isaac Ronald Ward, Jack Joyner, Casey Lickfold, Stash Rowe, Yulan Guo, Mohammed Bennamoun*, [code](https://github.com/isolabs/gnn-tutorial)
1. [**APAN: Asynchronous Propagation Attention Network for Real-time Temporal Graph Embedding**](https://arxiv.org/pdf/2011.11545.pdf), SIGMOD'21, *Xuhong Wang, Ding Lyu, Mengjian Li, Yang Xia, Qi Yang, Xinwen Wang, Xinguang Wang, Ping Cui, Yupu Yang, Bowen Sun, Zhenyu Guo, Junkui Li*
1. [**Uncertainty-Matching Graph Neural Networks to Defend Against Poisoning Attacks**](https://arxiv.org/pdf/2009.14455.pdf), *Uday Shankar Shanthamallu, Jayaraman J. Thiagarajan, Andreas Spanias*
1. [**Computing Graph Neural Networks: A Survey from Algorithms to Accelerators**](https://arxiv.org/pdf/2010.00130.pdf), *Sergi Abadal, Akshay Jain, Robert Guirado, Jorge López-Alonso, Eduard Alarcón*
1. [**NHK_STRL at WNUT-2020 Task 2: GATs with Syntactic Dependencies as Edges and CTC-based Loss for Text Classification**](https://www.aclweb.org/anthology/2020.wnut-1.43.pdf), *Yuki Yasuda, Taichi Ishiwatari, Taro Miyazaki, Jun Goto*
1. [**Relation-aware Graph Attention Networks with Relational Position Encodings for Emotion Recognition in Conversations**](https://www.aclweb.org/anthology/2020.emnlp-main.597.pdf), *Taichi Ishiwatari, Yuki Yasuda, Taro Miyazaki, Jun Goto*
1. [**PGM-Explainer: Probabilistic Graphical Model Explanations for Graph Neural Networks**](https://proceedings.neurips.cc/paper/2020/file/8fb134f258b1f7865a6ab2d935a897c9-Paper.pdf), *Minh N. Vu, My T. Thai*
1. [**A Generalization of Transformer Networks to Graphs**](https://arxiv.org/pdf/2012.09699.pdf), *Vijay Prakash Dwivedi, Xavier Bresson*
1. [**Discourse-Aware Neural Extractive Text Summarization**](https://www.aclweb.org/anthology/2020.acl-main.451.pdf), ACL'20, *Jiacheng Xu, Zhe Gan, Yu Cheng, Jingjing Liu*
1. [**Learning Robust Node Representations on Graphs**](https://arxiv.org/abs/2008.11416), *Xu Chen, Ya Zhang, Ivor Tsang, Yuangang Pan*
1. [**Adaptive Graph Diffusion Networks with Hop-wise Attention**](https://arxiv.org/abs/2012.15024), *Chuxiong Sun, Guoshi Wu*
1. [**The Photoswitch Dataset: A Molecular Machine Learning Benchmark for the Advancement of Synthetic Chemistry**](https://arxiv.org/abs/2008.03226), *Aditya R. Thawani, Ryan-Rhys Griffiths, Arian Jamasb, Anthony Bourached, Penelope Jones, William McCorkindale, Alexander A. Aldrick, Alpha A. Lee*
1. [**A community-powered search of machine learning strategy space to find NMR property prediction models**](https://arxiv.org/abs/2008.05994), *Lars A. Bratholm, Will Gerrard, Brandon Anderson, Shaojie Bai, Sunghwan Choi, Lam Dang, Pavel Hanchar, Addison Howard, Guillaume Huard, Sanghoon Kim, Zico Kolter, Risi Kondor, Mordechai Kornbluth, Youhan Lee, Youngsoo Lee, Jonathan P. Mailoa, Thanh Tu Nguyen, Milos Popovic, Goran Rakocevic, Walter Reade, Wonho Song, Luka Stojanovic, Erik H. Thiede, Nebojsa Tijanic, Andres Torrubia, Devin Willmott, Craig P. Butts, David R. Glowacki, Kaggle participants*
1. [**Adaptive Layout Decomposition with Graph Embedding Neural Networks**](http://www.cse.cuhk.edu.hk/~byu/papers/C98-DAC2020-MPL-Selector.pdf), *Wei Li, Jialu Xia, Yuzhe Ma, Jialu Li, Yibo Lin, Bei Yu*, DAC'20
1. [**Transfer Learning with Graph Neural Networks for Optoelectronic Properties of Conjugated Oligomers**](https://aip.scitation.org/doi/10.1063/5.0037863), J. Chem. Phys. 154, *Chee-Kong Lee, Chengqiang Lu, Yue Yu, Qiming Sun, Chang-Yu Hsieh, Shengyu Zhang, Qi Liu, and Liang Shi*
1. [**Jet tagging in the Lund plane with graph networks**](https://link.springer.com/article/10.1007/JHEP03(2021)052), Journal of High Energy Physics 2021, *Frédéric A. Dreyer and Huilin Qu*
1. [**Global Attention Improves Graph Networks Generalization**](https://arxiv.org/abs/2006.07846), *Omri Puny, Heli Ben-Hamu, and Yaron Lipman*
1. [**Learning over Families of Sets -- Hypergraph Representation Learning for Higher Order Tasks**](https://arxiv.org/abs/2101.07773), SDM 2021, *Balasubramaniam Srinivasan, Da Zheng, and George Karypis*
1. [**SSFG: Stochastically Scaling Features and Gradients for Regularizing Graph Convolution Networks**](https://arxiv.org/abs/2102.10338), *Haimin Zhang, Min Xu*
1. [**Application and evaluation of knowledge graph embeddings in biomedical data**](https://peerj.com/articles/cs-341/), PeerJ Computer Science 7:e341, *Mona Alshahrani, Maha A. Thafar, Magbubah Essack*
1. [**MoTSE: an interpretable task similarity estimator for small molecular property prediction tasks**](https://www.biorxiv.org/content/10.1101/2021.01.13.426608v2), bioRxiv 2021.01.13.426608, *Han Li, Xinyi Zhao, Shuya Li, Fangping Wan, Dan Zhao, Jianyang Zeng*
1. [**Reinforcement Learning For Data Poisoning on Graph Neural Networks**](https://arxiv.org/abs/2102.06800), *Jacob Dineen, A S M Ahsan-Ul Haque, Matthew Bielskas*
1. [**Generalising Recursive Neural Models by Tensor Decomposition**](https://github.com/danielecastellana22/tensor-tree-nn), IJCNN'20, *Daniele Castellana, Davide Bacciu*
1. [**Tensor Decompositions in Recursive Neural Networks for Tree-Structured Data**](https://github.com/danielecastellana22/tensor-tree-nn), ESANN'20, *Daniele Castellana, Davide Bacciu*
1. [**Combining Self-Organizing and Graph Neural Networks for Modeling Deformable Objects in Robotic Manipulation**](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7806087/), Frotiers in Robotics and AI, *Valencia, Angel J., and Pierre Payeur*
1. [**Joint stroke classification and text line grouping in online handwritten documents with edge pooling attention networks**](https://www.sciencedirect.com/science/article/abs/pii/S0031320321000467), Pattern Recognition, *Jun-Yu Ye, Yan-Ming Zhang, Qing Yang, Cheng-Lin Liu*
1. [**Toward Accurate Predictions of Atomic Properties via Quantum Mechanics Descriptors Augmented Graph Convolutional Neural Network: Application of This Novel Approach in NMR Chemical Shifts Predictions**](https://pubs.acs.org/doi/full/10.1021/acs.jpclett.0c02654), The Journal of Physical Chemistry Letters, *Peng Gao, Jie Zhang, Yuzhu Sun, and Jianguo Yu*
1. [**A Graph Neural Network to Model User Comfort in Robot Navigation**](https://arxiv.org/abs/2102.08863), *Pilar Bachiller, Daniel Rodriguez-Criado, Ronit R. Jorvekar, Pablo Bustos, Diego R. Faria, Luis J. Manso*
1. [**Medical Entity Disambiguation Using Graph Neural Networks**](https://arxiv.org/abs/2104.01488), *Alina Vretinaris, Chuan Lei, Vasilis Efthymiou, Xiao Qin, Fatma Özcan*
1. [**Chemistry-informed Macromolecule Graph Representation for Similarity Computation and Supervised Learning**](https://arxiv.org/abs/2103.02565), *Somesh Mohapatra, Joyce An, Rafael Gómez-Bombarelli*
1. [**Characterizing and Forecasting User Engagement with In-app Action Graph: A Case Study of Snapchat**](https://arxiv.org/pdf/1906.00355.pdf), *Yozen Liu, Xiaolin Shi, Lucas Pierce, Xiang Ren*
1. [**GIPA: General Information Propagation Algorithm for Graph Learning**](https://arxiv.org/abs/2105.06035), *Qinkai Zheng, Houyi Li, Peng Zhang, Zhixiong Yang, Guowei Zhang, Xintan Zeng, Yongchao Liu*
1. [**Graph Ensemble Learning over Multiple Dependency Trees for Aspect-level Sentiment Classification**](https://arxiv.org/abs/2103.11794), NAACL'21, *Xiaochen Hou, Peng Qi, Guangtao Wang, Rex Ying, Jing Huang, Xiaodong He, Bowen Zhou*
1. [**Enhancing Scientific Papers Summarization with Citation Graph**](https://arxiv.org/abs/2104.03057), AAAI'21, *Chenxin An, Ming Zhong, Yiran Chen, Danqing Wang, Xipeng Qiu, Xuanjing Huang*
1. [**Improving Graph Representation Learning by Contrastive Regularization**](https://arxiv.org/pdf/2101.11525.pdf), *Kaili Ma, Haochen Yang, Han Yang, Tatiana Jin, Pengfei Chen, Yongqiang Chen, Barakeel Fanseu Kamhoua, James Cheng*
1. [**Extract the Knowledge of Graph Neural Networks and Go Beyond it: An Effective Knowledge Distillation Framework**](https://arxiv.org/pdf/2103.02885.pdf), WWW'21, *Cheng Yang, Jiawei Liu, Chuan Shi*
1. [**VIKING: Adversarial Attack on Network Embeddings via Supervised Network Poisoning**](https://arxiv.org/pdf/2102.07164.pdf), PAKDD'21, *Viresh Gupta, Tanmoy Chakraborty*
1. [**Knowledge Graph Embedding using Graph Convolutional Networks with Relation-Aware Attention**](https://arxiv.org/pdf/2102.07200.pdf), *Nasrullah Sheikh, Xiao Qin, Berthold Reinwald, Christoph Miksovic, Thomas Gschwind, Paolo Scotton*
1. [**SLAPS: Self-Supervision Improves Structure Learning for Graph Neural Networks**](https://arxiv.org/pdf/2102.05034.pdf), *Bahare Fatemi, Layla El Asri, Seyed Mehran Kazemi*
1. [**Finding Needles in Heterogeneous Haystacks**](https://homepage.divms.uiowa.edu/~badhikari/assets/doc/papers/CONGCNIAAI2021.pdf), AAAI'21, *Bijaya Adhikari, Liangyue Li, Nikhil Rao, Karthik Subbian*
1. [**RetCL: A Selection-based Approach for Retrosynthesis via Contrastive Learning**](https://arxiv.org/abs/2105.00795), IJCAI 2021, *Hankook Lee, Sungsoo Ahn, Seung-Woo Seo, You Young Song, Eunho Yang, Sung-Ju Hwang, Jinwoo Shin*
1. [**Accurate Prediction of Free Solvation Energy of Organic Molecules via Graph Attention Network and Message Passing Neural Network from Pairwise Atomistic Interactions**](https://arxiv.org/abs/2105.02048), *Ramin Ansari, Amirata Ghorbani*
1. [**DIPS-Plus: The Enhanced Database of Interacting Protein Structures for Interface Prediction**](https://arxiv.org/abs/2106.04362), *Alex Morehead, Chen Chen, Ada Sedova, Jianlin Cheng*
1. [**Coreference-Aware Dialogue Summarization**](https://arxiv.org/abs/2106.08556), SIGDIAL'21, *Zhengyuan Liu, Ke Shi, Nancy F. Chen*
1. [**Document Structure aware Relational Graph Convolutional Networks for Ontology Population**](https://arxiv.org/abs/2104.12950), arXiv, *Abhay M Shalghar, Ayush Kumar, Balaji Ganesan, Aswin Kannan, Shobha G*
1. [**Covid-19 Detection from Chest X-ray and Patient Metadata using Graph Convolutional Neural Networks**](https://arxiv.org/abs/2105.09720), *Thosini Bamunu Mudiyanselage, Nipuna Senanayake, Chunyan Ji, Yi Pan, Yanqing Zhang*
1. [**Rossmann-toolbox: a deep learning-based protocol for the prediction and design of cofactor specificity in Rossmann fold proteins**](https://academic.oup.com/bib/advance-article/doi/10.1093/bib/bbab371/6375059), Briefings in Bioinformatics, *Kamil Kaminski, Jan Ludwiczak, Maciej Jasinski, Adriana Bukala, Rafal Madaj, Krzysztof Szczepaniak, Stanislaw Dunin-Horkawicz*
1. [**LGESQL: Line Graph Enhanced Text-to-SQL Model with Mixed Local and Non-Local Relations**](https://arxiv.org/pdf/2106.01093.pdf), ACL'21, *Ruisheng Cao, Lu Chen, Zhi Chen, Yanbin Zhao, Su Zhu, Kai Yu*
1. [**Enhancing Graph Neural Networks via auxiliary training for semi-supervised node classification**](https://www.sciencedirect.com/science/article/pii/S0950705121001477), Knowledge-Based System'21, *Yao Wu, Yu Song, Hong Huang, Fanghua Ye, Xing Xie, Hai Jin*
1. [**Modeling Graph Node Correlations with Neighbor Mixture Models**](https://arxiv.org/pdf/2103.15966.pdf), *Linfeng Liu, Michael C. Hughes, Li-Ping Liu*
1. [**COMBINING PHYSICS AND MACHINE LEARNING FOR NETWORK FLOW ESTIMATION**](https://openreview.net/pdf/9dc2744a465941220de07cf308acf822ec8aaa64.pdf), ICLR'21, *Arlei Silva, Furkan Kocayusufoglu, Saber Jafarpour, Francesco Bullo, Ananthram Swami, Ambuj Singh*
1. [**A Classification Method for Academic Resources Based on a Graph Attention Network**](https://www.mdpi.com/1999-5903/13/3/64/htm), Future Internet'21, *Jie Yu, Yaliu Li, Chenle Pan and Junwei Wang*
1. [**Large Graph Convolutional Network Training with GPU-Oriented Data Communication Architecture**](https://arxiv.org/abs/2103.03330), *Seung Won Min, Kun Wu, Sitao Huang, Mert Hidayetoğlu, Jinjun Xiong, Eiman Ebrahimi, Deming Chen, Wen-mei Hwu*
1. [**Graph Attention Multi-Layer Perception**](https://github.com/PKU-DAIR/GAMLP/blob/main/GAMLP.pdf), *Wentao Zhang, Ziqi Yin, Zeang Sheng, Wen Ouyang, Xiaosen Li, Yangyu Tao, Zhi Yang, Bin Cui*
1. [**GNNLens: A Visual Analytics Approach for Prediction Error Diagnosis of Graph Neural Networks**](https://arxiv.org/abs/2011.11048v5), *Zhihua Jin, Yong Wang, Qianwen Wang, Yao Ming, Tengfei Ma, Huamin Qu*
1. [**How Attentive are Graph Attention Networks?**](https://arxiv.org/pdf/2105.14491.pdf), *Shaked Brody, Uri Alon, Eran Yahav*, [code](https://github.com/tech-srl/how_attentive_are_gats)
1. [**SCENE: Reasoning about Traffic Scenes using Heterogeneous Graph Neural Networks**](https://arxiv.org/pdf/2301.03512.pdf), *Thomas Monninger\*, Julian Schmidt\*, Jan Rupprecht, David Raba, Julian Jordan, Daniel Frank, Steffen Staab, Klaus Dietmayer*, [code](https://github.com/schmidt-ju/scene), \*co-first authors
</details>
## Contributing
Please let us know if you encounter a bug or have any suggestions by [filing an issue](https://github.com/dmlc/dgl/issues).
We welcome all contributions from bug fixes to new features and extensions.
We expect all contributions discussed in the issue tracker and going through PRs. Please refer to our [contribution guide](https://docs.dgl.ai/contribute.html).
## Cite
If you use DGL in a scientific publication, we would appreciate citations to the following paper:
```
@article{wang2019dgl,
title={Deep Graph Library: A Graph-Centric, Highly-Performant Package for Graph Neural Networks},
author={Minjie Wang and Da Zheng and Zihao Ye and Quan Gan and Mufei Li and Xiang Song and Jinjing Zhou and Chao Ma and Lingfan Yu and Yu Gai and Tianjun Xiao and Tong He and George Karypis and Jinyang Li and Zheng Zhang},
year={2019},
journal={arXiv preprint arXiv:1909.01315}
}
```
## The Team
DGL is developed and maintained by [NYU, NYU Shanghai, AWS Shanghai AI Lab, and AWS MXNet Science Team](https://www.dgl.ai/pages/about.html).
## License
DGL uses Apache License 2.0.
================================================
FILE: apps/life_sci/README.md
================================================
# DGL-LifeSci
DGL-LifeSci is moved [here](https://github.com/awslabs/dgl-lifesci).
================================================
FILE: benchmarks/.gitignore
================================================
html
results
================================================
FILE: benchmarks/Jenkinsfile
================================================
pipeline {
triggers {
issueCommentTrigger('@dgl-bot .*')
}
agent {
docker {
label 'linux-benchmark-node'
image 'dgllib/dgl-ci-lint'
alwaysPull true
}
}
stages {
stage('Regression Test') {
steps {
checkout scm
script {
def commentTriggerCause = currentBuild.getBuildCauses('org.jenkinsci.plugins.pipeline.github.trigger.IssueCommentCause')
def prOpenTriggerCause = currentBuild.getBuildCauses('jenkins.branch.BranchEventCause')
def realTriggerCause = currentBuild.getBuildCauses()
echo("BUILD CAUSE: ${realTriggerCause.toString()}")
if (commentTriggerCause) {
dir('benchmark_scripts_repo') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']],
userRemoteConfigs: [[credentialsId: 'github', url: 'https://github.com/dglai/DGL_scripts.git']]])
}
sh('cp benchmark_scripts_repo/benchmark/* benchmarks/scripts/')
def comment = env.GITHUB_COMMENT
def author = env.GITHUB_COMMENT_AUTHOR
def authorized_user = ['VoVAllen', 'BarclayII', 'jermainewang', 'zheng-da', 'mufeili']
def isauthorized = author in authorized_user
def command_lists = comment.split(' ')
def instance_type = command_lists[2].replace('.', "")
if (!isauthorized) {
error("Not authorized to launch regression tests")
}
if (command_lists.size() != 5) {
pullRequest.comment('Cannot run the regression test due to unknown command')
error('Unknown command')
} else {
pullRequest.comment("Start the Regression test. View at ${RUN_DISPLAY_URL}")
}
dir('benchmarks/scripts') {
sh('python3 -m pip install boto3')
sh("PYTHONUNBUFFERED=1 GIT_URL=${env.GIT_URL} GIT_BRANCH=${env.CHANGE_BRANCH} python3 run_reg_test.py --data-folder ${env.GIT_COMMIT}_${instance_type} --run-cmd '${comment}'")
}
pullRequest.comment("Finished the Regression test. Result table is at https://dgl-asv-data.s3-us-west-2.amazonaws.com/${env.GIT_COMMIT}_${instance_type}/results/result.csv. Jenkins job link is ${RUN_DISPLAY_URL}. ")
} else {
// if (prOpenTriggerCause) {
// if (env.BUILD_ID == "1") {
// pullRequest.comment('To trigger regression tests: \n - `@dgl-bot run [instance-type] [which tests] [compare-with-branch]`; \n For example: `@dgl-bot run g4dn.4xlarge all dmlc/master` or `@dgl-bot run c5.9xlarge kernel,api dmlc/master`')
// }
// }
echo('Build was not started by a trigger')
}
// echo("Comment: ${commentTriggerCause.getComment()}")
}
}
post {
failure {
echo '========Regression execution failed========'
}
}
}
}
}
================================================
FILE: benchmarks/README.md
================================================
DGL Benchmarks
====
Benchmarking DGL with Airspeed Velocity.
Usage
---
Before beginning, ensure that airspeed velocity is installed:
```bash
pip install asv
```
To run all benchmarks locally, build the project first and then run:
```bash
asv run -n -e --python=same --verbose
```
**Due to ASV's restriction, `--python=same` will not write any benchmark results
to disk. It does not support specifying branches and commits either. They are only
available under ASV's managed environment.**
To change the device for benchmarking, set the `DGL_BENCH_DEVICE` environment variable.
Allowed values are `"cpu"` or `"gpu"`.
```bash
export DGL_BENCH_DEVICE=gpu
```
To select which benchmark to run, use the `--bench` flag. For example,
```bash
asv run -n -e --python=same --verbose --bench model_acc.bench_gat
```
Note that OGB dataset need to be download manually to `/tmp/dataset` folder (i.e. `/tmp/dataset/ogbn-products/`) beforehand.
You can do it by runnnig the code below in this folder
```python
from benchmarks.utils import get_ogb_graph
get_ogb_graph("ogbn-product")
```
Run in docker locally
---
DGL runs all benchmarks automatically in docker container. To run bencmarks in docker locally,
* Git commit your locally changes. No need to push to remote repository.
* To compare commits from different branches. Change the `"branches"` list in `asv.conf.json`.
The default is `"HEAD"` which is the last commit of the current branch. For example, to
compare your proposed changes with the master branch, set it to be `["HEAD", "master"]`.
If your workspace is a forked repository, make sure your local master has synced with
the upstream.
* Use the `publish.sh` script. It accepts two arguments, a name specifying the identity of
the test machine and a device name. For example,
```bash
bash publish.sh dev-machine gpu
```
The script will output two folders `results` and `html`. The `html` folder contains the
generated static web pages. View it by:
```bash
asv preview
```
Please see `publish.sh` for more information on how it works and how to modify it according
to your need.
Adding a new benchmark suite
---
The benchmark folder is organized as follows:
```
|-- benchmarks/
|-- model_acc/ # benchmarks for model accuracy
|-- bench_gcn.py
|-- bench_gat.py
|-- bench_sage.py
...
|-- model_speed/ # benchmarks for model training speed
|-- bench_gat.py
|-- bench_sage.py
...
... # other types of benchmarks
|-- html/ # generated html files
|-- results/ # generated result files
|-- asv.conf.json # asv config file
|-- build_dgl_asv.sh # script for building dgl in asv
|-- install_dgl_asv.sh # script for installing dgl in asv
|-- publish.sh # script for running benchmarks in docker
|-- README.md # this readme
|-- run.sh # script for calling asv in docker
|-- ... # other aux files
```
To add a new benchmark, pick a suitable benchmark type and create a python script under
it. We prefer to have the prefix `bench_` in the name. Here is a toy example:
```python
# bench_range.py
import time
from .. import utils
@utils.benchmark('time')
@utils.parametrize('l', [10, 100, 1000])
@utils.parametrize('u', [10, 100, 1000])
def track_time(l, u):
t0 = time.time()
for i in range(l, u):
pass
return time.time() - t0
```
* The main entry point of each benchmark script is a `track_*` function. The function
can have arbitrary arguments and must return the benchmark result.
* There are two useful decorators: `utils.benchmark` and `utils.parametrize`.
* `utils.benchmark` indicates the type of this benchmark. Currently supported types are:
`'time'` and `'acc'`. The decorator will perform some necessary setup and finalize
steps such as fixing the random seed for the `'acc'` type.
* `utils.parametrize` specifies the parameters to test.
Multiple parametrize decorators mean benchmarking the combination.
* Check out `model_acc/bench_gcn.py` and `model_speed/bench_sage.py`.
* ASV's [official guide on writing benchmarks](https://asv.readthedocs.io/en/stable/writing_benchmarks.html)
is also very helpful.
Tips
----
* Feed flags `-e --verbose` to `asv run` to print out stderr and more information.
* When running benchmarks locally (e.g., with `--python=same`), ASV will not write results to disk
so `asv publish` will not generate plots.
* Try make your benchmarks compatible with all the versions being tested.
* For ogbn dataset, put the dataset into /tmp/dataset/
================================================
FILE: benchmarks/asv.conf.json
================================================
{
// The version of the config file format. Do not change, unless
// you know what you are doing.
"version": 1,
// The name of the project being benchmarked
"project": "dgl",
// The project's homepage
"project_url": "https://www.dgl.ai",
// The URL or local path of the source code repository for the
// project being benchmarked
"repo": "..",
// The Python project's subdirectory in your repo. If missing or
// the empty string, the project is assumed to be located at the root
// of the repository.
// "repo_subdir": "python",
// Customizable commands for building, installing, and
// uninstalling the project. See asv.conf.json documentation.
//
"build_command": [
"/bin/bash {conf_dir}/scripts/build_dgl_asv.sh"
],
"install_command": [
"/bin/bash {conf_dir}/scripts/install_dgl_asv.sh"
],
"uninstall_command": [
"return-code=any python -m pip uninstall -y dgl"
],
// List of branches to benchmark. If not provided, defaults to "master"
// (for git) or "default" (for mercurial).
"branches": [
"HEAD"
], // for git
// The DVCS being used. If not set, it will be automatically
// determined from "repo" by looking at the protocol in the URL
// (if remote), or by looking for special directories, such as
// ".git" (if local).
"dvcs": "git",
// The tool to use to create environments. May be "conda",
// "virtualenv" or other value depending on the plugins in use.
// If missing or the empty string, the tool will be automatically
// determined by looking for tools on the PATH environment
// variable.
"environment_type": "conda",
// timeout in seconds for installing any dependencies in environment
// defaults to 10 min
"install_timeout": 600,
// the base URL to show a commit for the project.
// "show_commit_url": "http://github.com/owner/project/commit/",
// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
// "pythons": ["2.7", "3.6"],
// The list of conda channel names to be searched for benchmark
// dependency packages in the specified order
// "conda_channels": ["conda-forge", "defaults"],
// The matrix of dependencies to test. Each key is the name of a
// package (in PyPI) and the values are version numbers. An empty
// list or empty string indicates to just test against the default
// (latest) version. null indicates that the package is to not be
// installed. If the package to be tested is only available from
// PyPi, and the 'environment_type' is conda, then you can preface
// the package name by 'pip+', and the package will be installed via
// pip (with all the conda available packages installed first,
// followed by the pip installed packages).
//
// "matrix": {
// "numpy": ["1.6", "1.7"],
// "six": ["", null], // test with and without six installed
// "pip+emcee": [""], // emcee is only available for install with pip.
// },
// Combinations of libraries/python versions can be excluded/included
// from the set to test. Each entry is a dictionary containing additional
// key-value pairs to include/exclude.
//
// An exclude entry excludes entries where all values match. The
// values are regexps that should match the whole string.
//
// An include entry adds an environment. Only the packages listed
// are installed. The 'python' key is required. The exclude rules
// do not apply to includes.
//
// In addition to package names, the following keys are available:
//
// - python
// Python version, as in the *pythons* variable above.
// - environment_type
// Environment type, as above.
// - sys_platform
// Platform, as in sys.platform. Possible values for the common
// cases: 'linux2', 'win32', 'cygwin', 'darwin'.
//
// "exclude": [
// {"python": "3.2", "sys_platform": "win32"}, // skip py3.2 on windows
// {"environment_type": "conda", "six": null}, // don't run without six on conda
// ],
//
// "include": [
// // additional env for python2.7
// {"python": "2.7", "numpy": "1.8"},
// // additional env if run on windows+conda
// {"platform": "win32", "environment_type": "conda", "python": "2.7", "libpython": ""},
// ],
// The directory (relative to the current directory) that benchmarks are
// stored in. If not provided, defaults to "benchmarks"
// "benchmark_dir": "benchmarks",
// The directory (relative to the current directory) to cache the Python
// environments in. If not provided, defaults to "env"
"env_dir": "env",
// The directory (relative to the current directory) that raw benchmark
// results are stored in. If not provided, defaults to "results".
"results_dir": "results",
// The directory (relative to the current directory) that the html tree
// should be written to. If not provided, defaults to "html".
"html_dir": "html",
// The number of characters to retain in the commit hashes.
// "hash_length": 8,
// `asv` will cache results of the recent builds in each
// environment, making them faster to install next time. This is
// the number of builds to keep, per environment.
// "build_cache_size": 2,
// The commits after which the regression search in `asv publish`
// should start looking for regressions. Dictionary whose keys are
// regexps matching to benchmark names, and values corresponding to
// the commit (exclusive) after which to start looking for
// regressions. The default is to start from the first commit
// with results. If the commit is `null`, regression detection is
// skipped for the matching benchmark.
//
// "regressions_first_commits": {
// "some_benchmark": "352cdf", // Consider regressions only after this commit
// "another_benchmark": null, // Skip regression detection altogether
// },
// The thresholds for relative change in results, after which `asv
// publish` starts reporting regressions. Dictionary of the same
// form as in ``regressions_first_commits``, with values
// indicating the thresholds. If multiple entries match, the
// maximum is taken. If no entry matches, the default is 5%.
//
// "regressions_thresholds": {
// "some_benchmark": 0.01, // Threshold of 1%
// "another_benchmark": 0.5, // Threshold of 50%
// },
}
================================================
FILE: benchmarks/benchmarks/__init__.py
================================================
================================================
FILE: benchmarks/benchmarks/api/__init__.py
================================================
================================================
FILE: benchmarks/benchmarks/api/bench_add_self_loop.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time")
@utils.parametrize("graph_name", ["cora", "livejournal"])
@utils.parametrize("format", ["coo"])
def track_time(graph_name, format):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
# dry run
for i in range(3):
g = graph.add_self_loop()
# timing
with utils.Timer() as t:
for i in range(3):
edges = graph.add_self_loop()
return t.elapsed_secs / 3
================================================
FILE: benchmarks/benchmarks/api/bench_batch.py
================================================
import time
import dgl
import torch
from .. import utils
@utils.benchmark("time")
@utils.parametrize("batch_size", [4, 32, 256, 1024])
def track_time(batch_size):
device = utils.get_bench_device()
ds = dgl.data.QM7bDataset()
# prepare graph
graphs = []
for graph in ds[0:batch_size][0]:
g = graph.to(device)
graphs.append(g)
# dry run
for i in range(10):
g = dgl.batch(graphs)
# timing
with utils.Timer() as t:
for i in range(100):
g = dgl.batch(graphs)
return t.elapsed_secs / 100
================================================
FILE: benchmarks/benchmarks/api/bench_builtin_apply_edges.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=600)
@utils.parametrize("graph_name", ["cora", "ogbn-arxiv"])
@utils.parametrize("format", ["coo", "csr"])
@utils.parametrize("feat_size", [8, 128, 512])
@utils.parametrize("reduce_type", ["u->e", "u+v"])
def track_time(graph_name, format, feat_size, reduce_type):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
graph.ndata["h"] = torch.randn(
(graph.num_nodes(), feat_size), device=device
)
reduce_builtin_dict = {
"u->e": fn.copy_u("h", "x"),
"u+v": fn.u_add_v("h", "h", "x"),
}
# dry run
for i in range(3):
graph.apply_edges(reduce_builtin_dict[reduce_type])
# timing
with utils.Timer() as t:
for i in range(10):
graph.apply_edges(reduce_builtin_dict[reduce_type])
return t.elapsed_secs / 10
================================================
FILE: benchmarks/benchmarks/api/bench_builtin_apply_edges_hetero.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=600)
@utils.parametrize("num_relations", [5, 50, 500])
@utils.parametrize("format", ["coo", "csr"])
@utils.parametrize("feat_size", [8, 128, 512])
@utils.parametrize("reduce_type", ["u->e"]) # , 'e->u'])
def track_time(num_relations, format, feat_size, reduce_type):
device = utils.get_bench_device()
dd = {}
candidate_edges = [
dgl.data.CoraGraphDataset(verbose=False)[0].edges(),
dgl.data.PubmedGraphDataset(verbose=False)[0].edges(),
dgl.data.CiteseerGraphDataset(verbose=False)[0].edges(),
]
for i in range(num_relations):
dd[("n1", "e_{}".format(i), "n2")] = candidate_edges[
i % len(candidate_edges)
]
graph = dgl.heterograph(dd)
graph = graph.to(device)
graph.nodes["n1"].data["h"] = torch.randn(
(graph.num_nodes("n1"), feat_size), device=device
)
graph.nodes["n2"].data["h"] = torch.randn(
(graph.num_nodes("n2"), feat_size), device=device
)
reduce_builtin_dict = {
"u->e": fn.copy_u("h", "x"),
# 'e->u': fn.copy_e('h', 'x'),
}
# dry run
for i in range(3):
graph.apply_edges(reduce_builtin_dict[reduce_type])
# timing
with utils.Timer() as t:
for i in range(10):
graph.apply_edges(reduce_builtin_dict[reduce_type])
return t.elapsed_secs / 10
================================================
FILE: benchmarks/benchmarks/api/bench_builtin_multi_update_all.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=600)
@utils.parametrize("feat_size", [32, 128, 512])
@utils.parametrize("num_relations", [5, 50, 500])
@utils.parametrize("multi_reduce_type", ["sum", "stack"])
def track_time(feat_size, num_relations, multi_reduce_type):
device = utils.get_bench_device()
dd = {}
candidate_edges = [
dgl.data.CoraGraphDataset(verbose=False)[0].edges(),
dgl.data.PubmedGraphDataset(verbose=False)[0].edges(),
dgl.data.CiteseerGraphDataset(verbose=False)[0].edges(),
]
for i in range(num_relations):
dd[("n1", "e_{}".format(i), "n2")] = candidate_edges[
i % len(candidate_edges)
]
graph = dgl.heterograph(dd)
graph = graph.to(device)
graph.nodes["n1"].data["h"] = torch.randn(
(graph.num_nodes("n1"), feat_size), device=device
)
graph.nodes["n2"].data["h"] = torch.randn(
(graph.num_nodes("n2"), feat_size), device=device
)
# dry run
update_dict = {}
for i in range(num_relations):
update_dict["e_{}".format(i)] = (fn.copy_u("h", "m"), fn.sum("m", "h"))
graph.multi_update_all(update_dict, multi_reduce_type)
# timing
with utils.Timer() as t:
for i in range(3):
graph.multi_update_all(update_dict, multi_reduce_type)
return t.elapsed_secs / 3
================================================
FILE: benchmarks/benchmarks/api/bench_builtin_update_all_coo.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=600)
@utils.parametrize("graph_name", ["ogbn-arxiv"])
@utils.parametrize("format", ["coo"])
@utils.parametrize("feat_size", [4, 32, 256])
@utils.parametrize("msg_type", ["copy_u", "u_mul_e"])
@utils.parametrize("reduce_type", ["sum", "mean", "max"])
def track_time(graph_name, format, feat_size, msg_type, reduce_type):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
graph.ndata["h"] = torch.randn(
(graph.num_nodes(), feat_size), device=device
)
graph.edata["e"] = torch.randn((graph.num_edges(), 1), device=device)
msg_builtin_dict = {
"copy_u": fn.copy_u("h", "x"),
"u_mul_e": fn.u_mul_e("h", "e", "x"),
}
reduce_builtin_dict = {
"sum": fn.sum("x", "h_new"),
"mean": fn.mean("x", "h_new"),
"max": fn.max("x", "h_new"),
}
# dry run
graph.update_all(
msg_builtin_dict[msg_type], reduce_builtin_dict[reduce_type]
)
# timing
with utils.Timer() as t:
for i in range(3):
graph.update_all(
msg_builtin_dict[msg_type], reduce_builtin_dict[reduce_type]
)
return t.elapsed_secs / 3
================================================
FILE: benchmarks/benchmarks/api/bench_builtin_update_all_csc.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=600)
@utils.parametrize("graph_name", ["ogbn-arxiv", "reddit", "ogbn-proteins"])
@utils.parametrize("format", ["csc"])
@utils.parametrize("feat_size", [4, 32, 256])
@utils.parametrize("msg_type", ["copy_u", "u_mul_e"])
@utils.parametrize("reduce_type", ["sum", "mean", "max"])
def track_time(graph_name, format, feat_size, msg_type, reduce_type):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
graph.ndata["h"] = torch.randn(
(graph.num_nodes(), feat_size), device=device
)
graph.edata["e"] = torch.randn((graph.num_edges(), 1), device=device)
msg_builtin_dict = {
"copy_u": fn.copy_u("h", "x"),
"u_mul_e": fn.u_mul_e("h", "e", "x"),
}
reduce_builtin_dict = {
"sum": fn.sum("x", "h_new"),
"mean": fn.mean("x", "h_new"),
"max": fn.max("x", "h_new"),
}
# dry run
for i in range(3):
graph.update_all(
msg_builtin_dict[msg_type], reduce_builtin_dict[reduce_type]
)
# timing
with utils.Timer() as t:
for i in range(10):
graph.update_all(
msg_builtin_dict[msg_type], reduce_builtin_dict[reduce_type]
)
return t.elapsed_secs / 10
================================================
FILE: benchmarks/benchmarks/api/bench_edge_ids.py
================================================
import time
import dgl
import numpy as np
import torch
from .. import utils
# edge_ids is not supported on cuda
# @utils.skip_if_gpu()
@utils.benchmark("time", timeout=1200)
@utils.parametrize_cpu("graph_name", ["cora", "livejournal", "friendster"])
@utils.parametrize_gpu("graph_name", ["cora", "livejournal"])
@utils.parametrize("format", ["coo", "csr", "csc"])
@utils.parametrize("fraction", [0.01, 0.1])
@utils.parametrize("return_uv", [True, False])
def track_time(graph_name, format, fraction, return_uv):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
coo_graph = utils.get_graph(graph_name, "coo")
graph = graph.to(device)
eids = np.random.choice(
np.arange(graph.num_edges(), dtype=np.int64),
int(graph.num_edges() * fraction),
)
eids = torch.tensor(eids, device="cpu", dtype=torch.int64)
u, v = coo_graph.find_edges(eids)
del coo_graph, eids
u = u.to(device)
v = v.to(device)
# dry run
for i in range(10):
out = graph.edge_ids(u[0], v[0])
# timing
with utils.Timer() as t:
for i in range(3):
edges = graph.edge_ids(u, v, return_uv=return_uv)
return t.elapsed_secs / 3
================================================
FILE: benchmarks/benchmarks/api/bench_edge_subgraph.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time")
@utils.parametrize("graph_name", ["livejournal", "reddit"])
@utils.parametrize("format", ["coo"])
@utils.parametrize("seed_egdes_num", [500, 5000, 50000])
def track_time(graph_name, format, seed_egdes_num):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
seed_edges = np.random.randint(0, graph.num_edges(), seed_egdes_num)
seed_edges = torch.from_numpy(seed_edges).to(device)
# dry run
for i in range(3):
dgl.edge_subgraph(graph, seed_edges)
# timing
num_iters = 50
with utils.Timer() as t:
for i in range(num_iters):
dgl.edge_subgraph(graph, seed_edges)
return t.elapsed_secs / num_iters
================================================
FILE: benchmarks/benchmarks/api/bench_find_edges.py
================================================
import time
import dgl
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=600)
@utils.parametrize_cpu("graph_name", ["cora", "livejournal", "friendster"])
@utils.parametrize_gpu("graph_name", ["cora", "livejournal"])
@utils.parametrize("format", ["coo"]) # csc is not supported
@utils.parametrize("fraction", [0.01, 0.1])
def track_time(graph_name, format, fraction):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
eids = np.random.choice(
np.arange(graph.num_edges(), dtype=np.int64),
int(graph.num_edges() * fraction),
)
eids = torch.tensor(eids, device=device, dtype=torch.int64)
# dry run
for i in range(10):
out = graph.find_edges(i)
out = graph.find_edges(
torch.arange(i * 10, dtype=torch.int64, device=device)
)
# timing
with utils.Timer() as t:
for i in range(10):
edges = graph.find_edges(eids)
return t.elapsed_secs / 10
================================================
FILE: benchmarks/benchmarks/api/bench_format_conversion.py
================================================
import time
import dgl
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=600)
@utils.parametrize_cpu(
"graph_name", ["cora", "pubmed", "ogbn-arxiv", "livejournal", "friendster"]
)
@utils.parametrize_gpu("graph_name", ["cora", "livejournal"])
@utils.parametrize(
"format",
[
("coo", "csc"),
("csc", "coo"),
("coo", "csr"),
("csr", "coo"),
("csr", "csc"),
("csc", "csr"),
],
)
def track_time(graph_name, format):
from_format, to_format = format
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, from_format)
graph = graph.to(device)
if format == ("coo", "csr") and graph_name == "friendster":
# Mark graph as sorted to check performance for COO matrix marked as
# sorted. Note that friendster dataset is already sorted.
graph = dgl.graph(graph.edges(), row_sorted=True)
graph = graph.formats([from_format])
# dry run
graph.formats([to_format])
# timing
with utils.Timer() as t:
for i in range(10):
gg = graph.formats([to_format])
return t.elapsed_secs / 10
================================================
FILE: benchmarks/benchmarks/api/bench_fused_sample_neighbors.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time")
@utils.parametrize_cpu("graph_name", ["livejournal", "reddit"])
@utils.parametrize_gpu("graph_name", ["ogbn-arxiv", "reddit"])
@utils.parametrize("format", ["csr", "csc"])
@utils.parametrize("seed_nodes_num", [200, 5000, 20000])
@utils.parametrize("fanout", [5, 20, 40])
def track_time(graph_name, format, seed_nodes_num, fanout):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format).to(device)
edge_dir = "in" if format == "csc" else "out"
seed_nodes = np.random.randint(0, graph.num_nodes(), seed_nodes_num)
seed_nodes = torch.from_numpy(seed_nodes).to(device)
# dry run
for i in range(3):
dgl.sampling.sample_neighbors_fused(
graph, seed_nodes, fanout, edge_dir=edge_dir
)
# timing
with utils.Timer() as t:
for i in range(50):
dgl.sampling.sample_neighbors_fused(
graph, seed_nodes, fanout, edge_dir=edge_dir
)
return t.elapsed_secs / 50
================================================
FILE: benchmarks/benchmarks/api/bench_heterograph_construction.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time")
@utils.parametrize("num_relations", [5, 50, 500])
def track_time(num_relations):
dd = {}
candidate_edges = [
dgl.data.CoraGraphDataset(verbose=False)[0].edges(),
dgl.data.PubmedGraphDataset(verbose=False)[0].edges(),
dgl.data.CiteseerGraphDataset(verbose=False)[0].edges(),
]
for i in range(num_relations):
dd[("n1", "e_{}".format(i), "n2")] = candidate_edges[
i % len(candidate_edges)
]
# dry run
graph = dgl.heterograph(dd)
# timing
with utils.Timer() as t:
for i in range(3):
graph = dgl.heterograph(dd)
return t.elapsed_secs / 3
================================================
FILE: benchmarks/benchmarks/api/bench_homograph_edge_construction.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.skip_if_gpu()
@utils.benchmark("time")
@utils.parametrize("size", ["small", "large"])
def track_time(size):
edge_list = {
"small": dgl.data.CiteseerGraphDataset(verbose=False)[0].edges(),
"large": utils.get_livejournal().edges(),
}
# dry run
dgl.graph(edge_list[size])
# timing
with utils.Timer() as t:
for i in range(10):
g = dgl.graph(edge_list[size])
return t.elapsed_secs / 10
================================================
FILE: benchmarks/benchmarks/api/bench_homograph_scipy_construction.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.skip_if_gpu()
@utils.benchmark("time")
@utils.parametrize("size", ["small", "large"])
@utils.parametrize("scipy_format", ["coo", "csr"])
def track_time(size, scipy_format):
matrix_dict = {
"small": dgl.data.CiteseerGraphDataset(verbose=False)[0].adj_external(
scipy_fmt=scipy_format
),
"large": utils.get_livejournal().adj_external(scipy_fmt=scipy_format),
}
# dry run
dgl.from_scipy(matrix_dict[size])
# timing
with utils.Timer() as t:
for i in range(3):
dgl.from_scipy(matrix_dict[size])
return t.elapsed_secs / 3
================================================
FILE: benchmarks/benchmarks/api/bench_in_degrees.py
================================================
import time
import dgl
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=1200)
@utils.parametrize_cpu("graph_name", ["cora", "livejournal", "friendster"])
@utils.parametrize_gpu("graph_name", ["cora", "livejournal"])
# in_degrees on coo is not supported on cuda
@utils.parametrize_cpu("format", ["coo", "csc"])
@utils.parametrize_gpu("format", ["csc"])
@utils.parametrize("fraction", [0.01, 0.1])
def track_time(graph_name, format, fraction):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
nids = np.random.choice(
np.arange(graph.num_nodes(), dtype=np.int64),
int(graph.num_nodes() * fraction),
)
nids = torch.tensor(nids, device=device, dtype=torch.int64)
# dry run
for i in range(10):
out = graph.in_degrees(i)
# timing
with utils.Timer() as t:
for i in range(10):
edges = graph.in_degrees(nids)
return t.elapsed_secs / 10
================================================
FILE: benchmarks/benchmarks/api/bench_in_edges.py
================================================
import time
import dgl
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=1200)
@utils.parametrize_cpu("graph_name", ["cora", "livejournal", "friendster"])
@utils.parametrize_gpu("graph_name", ["cora", "livejournal"])
# in_edges on coo is not supported on cuda
@utils.parametrize_cpu("format", ["coo", "csc"])
@utils.parametrize_gpu("format", ["csc"])
@utils.parametrize("fraction", [0.01, 0.1])
def track_time(graph_name, format, fraction):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
nids = np.random.choice(
np.arange(graph.num_nodes(), dtype=np.int64),
int(graph.num_nodes() * fraction),
)
nids = torch.tensor(nids, device=device, dtype=torch.int64)
# dry run
for i in range(10):
out = graph.in_edges(i)
# timing
with utils.Timer() as t:
for i in range(10):
edges = graph.in_edges(nids)
return t.elapsed_secs / 10
================================================
FILE: benchmarks/benchmarks/api/bench_in_subgraph.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time")
@utils.parametrize("graph_name", ["livejournal", "reddit"])
@utils.parametrize("format", ["csc"]) # coo is not supported
@utils.parametrize("seed_nodes_num", [200, 5000, 20000])
def track_time(graph_name, format, seed_nodes_num):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
seed_nodes = np.random.randint(0, graph.num_nodes(), seed_nodes_num)
seed_nodes = torch.from_numpy(seed_nodes).to(device)
# dry run
for i in range(3):
dgl.in_subgraph(graph, seed_nodes)
# timing
num_iters = 50
with utils.Timer() as t:
for i in range(num_iters):
dgl.in_subgraph(graph, seed_nodes)
return t.elapsed_secs / num_iters
================================================
FILE: benchmarks/benchmarks/api/bench_khop.py
================================================
import time
import dgl
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=60)
@utils.parametrize("graph_name", ["cora"])
@utils.parametrize("format", ["coo", "csr"])
@utils.parametrize("k", [1, 3, 5])
def track_time(graph_name, format, k):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
graph = graph.formats([format])
# dry run
dgl.khop_graph(graph, k)
# timing
with utils.Timer() as t:
for i in range(10):
gg = dgl.khop_graph(graph, k)
return t.elapsed_secs / 10
================================================
FILE: benchmarks/benchmarks/api/bench_knn_graph.py
================================================
import time
import dgl
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=60)
@utils.parametrize("k", [8, 64])
@utils.parametrize("size", [1000, 10000])
@utils.parametrize("dim", [4, 32, 256])
@utils.parametrize_cpu(
"algorithm", ["bruteforce-blas", "bruteforce", "kd-tree", "nn-descent"]
)
@utils.parametrize_gpu(
"algorithm",
["bruteforce-blas", "bruteforce", "bruteforce-sharemem", "nn-descent"],
)
def track_time(size, dim, k, algorithm):
device = utils.get_bench_device()
features = np.random.RandomState(42).randn(size, dim)
feat = torch.tensor(features, dtype=torch.float, device=device)
# dry run
for i in range(1):
dgl.knn_graph(feat, k, algorithm=algorithm)
# timing
with utils.Timer() as t:
for i in range(5):
dgl.knn_graph(feat, k, algorithm=algorithm)
return t.elapsed_secs / 5
================================================
FILE: benchmarks/benchmarks/api/bench_metis_partition.py
================================================
import time
import dgl
import numpy as np
import torch
from .. import utils
@utils.skip_if_gpu()
@utils.benchmark("time", timeout=1200)
@utils.parametrize("graph_name", ["reddit"])
@utils.parametrize("k", [2, 4, 8])
def track_time(graph_name, k):
device = utils.get_bench_device()
data = utils.process_data(graph_name)
graph = data[0]
# dry run
gg = dgl.transforms.metis_partition(graph, k)
# timing
with utils.Timer() as t:
for i in range(3):
gg = dgl.transforms.metis_partition(graph, k)
return t.elapsed_secs / 3
================================================
FILE: benchmarks/benchmarks/api/bench_nn_graphconv.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from dgl.nn.pytorch import SAGEConv
from .. import utils
@utils.benchmark("time")
@utils.parametrize("graph_name", ["pubmed", "ogbn-arxiv"])
@utils.parametrize("feat_dim", [4, 32, 256])
@utils.parametrize("aggr_type", ["mean", "gcn", "pool"])
def track_time(graph_name, feat_dim, aggr_type):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name).to(device)
feat = torch.randn((graph.num_nodes(), feat_dim), device=device)
model = SAGEConv(
feat_dim, feat_dim, aggr_type, activation=F.relu, bias=False
).to(device)
# dry run
for i in range(3):
model(graph, feat)
# timing
with utils.Timer() as t:
for i in range(50):
model(graph, feat)
return t.elapsed_secs / 50
================================================
FILE: benchmarks/benchmarks/api/bench_nn_heterographconv.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from dgl.nn.pytorch import HeteroGraphConv, SAGEConv
from .. import utils
@utils.benchmark("time")
@utils.parametrize("feat_dim", [4, 32, 256])
@utils.parametrize("num_relations", [5, 50, 200])
def track_time(feat_dim, num_relations):
device = utils.get_bench_device()
dd = {}
nn_dict = {}
candidate_edges = [
dgl.data.CoraGraphDataset(verbose=False)[0].edges(),
dgl.data.PubmedGraphDataset(verbose=False)[0].edges(),
dgl.data.CiteseerGraphDataset(verbose=False)[0].edges(),
]
for i in range(num_relations):
dd[("n1", "e_{}".format(i), "n2")] = candidate_edges[
i % len(candidate_edges)
]
nn_dict["e_{}".format(i)] = SAGEConv(
feat_dim, feat_dim, "mean", activation=F.relu
)
# dry run
feat_dict = {}
graph = dgl.heterograph(dd)
for i in range(num_relations):
etype = "e_{}".format(i)
feat_dict[etype] = torch.randn(
(graph[etype].num_nodes(), feat_dim), device=device
)
conv = HeteroGraphConv(nn_dict).to(device)
# dry run
for i in range(3):
conv(graph, feat_dict)
# timing
with utils.Timer() as t:
for i in range(50):
conv(graph, feat_dict)
return t.elapsed_secs / 50
================================================
FILE: benchmarks/benchmarks/api/bench_node_subgraph.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time")
@utils.parametrize("graph_name", ["livejournal", "reddit"])
@utils.parametrize("format", ["coo", "csc"])
@utils.parametrize("seed_nodes_num", [200, 5000, 20000])
def track_time(graph_name, format, seed_nodes_num):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
seed_nodes = np.random.randint(0, graph.num_nodes(), seed_nodes_num)
seed_nodes = torch.from_numpy(seed_nodes).to(device)
# dry run
for i in range(3):
dgl.node_subgraph(graph, seed_nodes)
# timing
num_iters = 50
with utils.Timer() as t:
for i in range(num_iters):
dgl.node_subgraph(graph, seed_nodes)
return t.elapsed_secs / num_iters
================================================
FILE: benchmarks/benchmarks/api/bench_random_walk.py
================================================
import time
import dgl
import torch
from .. import utils
def _random_walk(g, seeds, length):
return dgl.sampling.random_walk(g, seeds, length=length)
def _node2vec(g, seeds, length):
return dgl.sampling.node2vec_random_walk(g, seeds, 1, 1, length)
@utils.skip_if_gpu()
@utils.benchmark("time")
@utils.parametrize("graph_name", ["cora", "livejournal", "friendster"])
@utils.parametrize("num_seeds", [10, 100, 1000])
@utils.parametrize("length", [2, 5, 10, 20])
@utils.parametrize("algorithm", ["_random_walk", "_node2vec"])
def track_time(graph_name, num_seeds, length, algorithm):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, "csr")
seeds = torch.randint(0, graph.num_nodes(), (num_seeds,))
print(graph_name, num_seeds, length)
alg = globals()[algorithm]
# dry run
for i in range(5):
_ = alg(graph, seeds, length=length)
# timing
with utils.Timer() as t:
for i in range(50):
_ = alg(graph, seeds, length=length)
return t.elapsed_secs / 50
================================================
FILE: benchmarks/benchmarks/api/bench_readout.py
================================================
import time
import dgl
import torch
from .. import utils
@utils.benchmark("time")
@utils.parametrize("batch_size", [4, 256, 1024])
@utils.parametrize("feat_size", [16, 128, 512])
@utils.parametrize("readout_op", ["sum", "max", "min", "mean"])
@utils.parametrize("type", ["edge", "node"])
def track_time(batch_size, feat_size, readout_op, type):
device = utils.get_bench_device()
ds = dgl.data.QM7bDataset()
# prepare graph
graphs = ds[0:batch_size][0]
g = dgl.batch(graphs).to(device)
if type == "node":
g.ndata["h"] = torch.randn((g.num_nodes(), feat_size), device=device)
for i in range(10):
out = dgl.readout_nodes(g, "h", op=readout_op)
with utils.Timer() as t:
for i in range(50):
out = dgl.readout_nodes(g, "h", op=readout_op)
elif type == "edge":
g.edata["h"] = torch.randn((g.num_edges(), feat_size), device=device)
for i in range(10):
out = dgl.readout_edges(g, "h", op=readout_op)
with utils.Timer() as t:
for i in range(50):
out = dgl.readout_edges(g, "h", op=readout_op)
else:
raise Exception("Unknown type")
return t.elapsed_secs / 50
================================================
FILE: benchmarks/benchmarks/api/bench_reverse.py
================================================
import time
import dgl
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=1200)
@utils.parametrize_cpu("graph_name", ["cora", "livejournal", "friendster"])
@utils.parametrize_gpu("graph_name", ["cora", "livejournal"])
@utils.parametrize("format", ["coo", "csc", "csr"])
def track_time(graph_name, format):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
graph = graph.formats([format])
# dry run
dgl.reverse(graph)
# timing
with utils.Timer() as t:
for i in range(100):
gg = dgl.reverse(graph)
return t.elapsed_secs / 100
================================================
FILE: benchmarks/benchmarks/api/bench_sample_neighbors.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time")
@utils.parametrize_cpu("graph_name", ["livejournal", "reddit"])
@utils.parametrize_gpu("graph_name", ["ogbn-arxiv", "reddit"])
@utils.parametrize("format", ["coo", "csc"])
@utils.parametrize("seed_nodes_num", [200, 5000, 20000])
@utils.parametrize("fanout", [5, 20, 40])
def track_time(graph_name, format, seed_nodes_num, fanout):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format).to(device)
edge_dir = "in"
seed_nodes = np.random.randint(0, graph.num_nodes(), seed_nodes_num)
seed_nodes = torch.from_numpy(seed_nodes).to(device)
# dry run
for i in range(3):
dgl.sampling.sample_neighbors(
graph, seed_nodes, fanout, edge_dir=edge_dir
)
# timing
with utils.Timer() as t:
for i in range(50):
dgl.sampling.sample_neighbors(
graph, seed_nodes, fanout, edge_dir=edge_dir
)
return t.elapsed_secs / 50
================================================
FILE: benchmarks/benchmarks/api/bench_to_block.py
================================================
import time
import dgl
import numpy as np
import torch
from .. import utils
@utils.skip_if_gpu()
@utils.benchmark("time", timeout=1200)
@utils.parametrize("graph_name", ["reddit", "ogbn-products"])
@utils.parametrize("num_seed_nodes", [32, 256, 1024, 2048])
@utils.parametrize("fanout", [5, 10, 20])
def track_time(graph_name, num_seed_nodes, fanout):
device = utils.get_bench_device()
data = utils.process_data(graph_name)
graph = data[0]
# dry run
dgl.sampling.sample_neighbors(graph, [1, 2, 3], fanout)
subg_list = []
for i in range(10):
seed_nodes = np.random.randint(
0, graph.num_nodes(), size=num_seed_nodes
)
subg = dgl.sampling.sample_neighbors(graph, seed_nodes, fanout)
subg_list.append(subg)
# timing
with utils.Timer() as t:
for i in range(10):
gg = dgl.to_block(subg_list[i])
return t.elapsed_secs / 10
================================================
FILE: benchmarks/benchmarks/api/bench_udf_apply_edges.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=7200)
@utils.parametrize("graph_name", ["ogbn-arxiv", "pubmed"])
@utils.parametrize("format", ["coo"]) # only coo supports udf
@utils.parametrize("feat_size", [8, 32, 128, 512])
@utils.parametrize("reduce_type", ["u->e", "u+v"])
def track_time(graph_name, format, feat_size, reduce_type):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
graph.ndata["h"] = torch.randn(
(graph.num_nodes(), feat_size), device=device
)
reduce_udf_dict = {
"u->e": lambda edges: {"x": edges.src["h"]},
"u+v": lambda edges: {"x": edges.src["h"] + edges.dst["h"]},
}
# dry run
graph.apply_edges(reduce_udf_dict[reduce_type])
# timing
with utils.Timer() as t:
for i in range(3):
graph.apply_edges(reduce_udf_dict[reduce_type])
return t.elapsed_secs / 3
================================================
FILE: benchmarks/benchmarks/api/bench_udf_multi_update_all.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=600)
@utils.parametrize("feat_size", [32, 128, 512])
@utils.parametrize("num_relations", [5, 50, 500])
@utils.parametrize("multi_reduce_type", ["sum", "stack"])
def track_time(feat_size, num_relations, multi_reduce_type):
device = utils.get_bench_device()
dd = {}
candidate_edges = [
dgl.data.CoraGraphDataset(verbose=False)[0].edges(),
dgl.data.PubmedGraphDataset(verbose=False)[0].edges(),
dgl.data.CiteseerGraphDataset(verbose=False)[0].edges(),
]
for i in range(num_relations):
dd[("n1", "e_{}".format(i), "n2")] = candidate_edges[
i % len(candidate_edges)
]
graph = dgl.heterograph(dd)
graph = graph.to(device)
graph.nodes["n1"].data["h"] = torch.randn(
(graph.num_nodes("n1"), feat_size), device=device
)
graph.nodes["n2"].data["h"] = torch.randn(
(graph.num_nodes("n2"), feat_size), device=device
)
# dry run
update_dict = {}
for i in range(num_relations):
update_dict["e_{}".format(i)] = (
lambda edges: {"x": edges.src["h"]},
lambda nodes: {"h_new": torch.sum(nodes.mailbox["x"], dim=1)},
)
graph.multi_update_all(update_dict, multi_reduce_type)
# timing
with utils.Timer() as t:
for i in range(3):
graph.multi_update_all(update_dict, multi_reduce_type)
return t.elapsed_secs / 3
================================================
FILE: benchmarks/benchmarks/api/bench_udf_update_all.py
================================================
import time
import dgl
import dgl.function as fn
import numpy as np
import torch
from .. import utils
@utils.benchmark("time", timeout=600)
@utils.parametrize("graph_name", ["pubmed", "ogbn-arxiv"])
@utils.parametrize("format", ["coo"]) # only coo supports udf
@utils.parametrize("feat_size", [8, 64, 512])
@utils.parametrize("msg_type", ["copy_u", "u_mul_e"])
@utils.parametrize("reduce_type", ["sum", "mean", "max"])
def track_time(graph_name, format, feat_size, msg_type, reduce_type):
device = utils.get_bench_device()
graph = utils.get_graph(graph_name, format)
graph = graph.to(device)
graph.ndata["h"] = torch.randn(
(graph.num_nodes(), feat_size), device=device
)
graph.edata["e"] = torch.randn((graph.num_edges(), 1), device=device)
msg_udf_dict = {
"copy_u": lambda edges: {"x": edges.src["h"]},
"u_mul_e": lambda edges: {"x": edges.src["h"] * edges.data["e"]},
}
reduct_udf_dict = {
"sum": lambda nodes: {"h_new": torch.sum(nodes.mailbox["x"], dim=1)},
"mean": lambda nodes: {"h_new": torch.mean(nodes.mailbox["x"], dim=1)},
"max": lambda nodes: {"h_new": torch.max(nodes.mailbox["x"], dim=1)[0]},
}
# dry run
graph.update_all(msg_udf_dict[msg_type], reduct_udf_dict[reduce_type])
# timing
with utils.Timer() as t:
for i in range(3):
graph.update_all(
msg_udf_dict[msg_type], reduct_udf_dict[reduce_type]
)
return t.elapsed_secs / 3
================================================
FILE: benchmarks/benchmarks/api/bench_unbatch.py
================================================
import time
import dgl
import torch
from .. import utils
@utils.benchmark("time")
@utils.parametrize("batch_size", [4, 32, 256, 1024])
def track_time(batch_size):
device = utils.get_bench_device()
ds = dgl.data.QM7bDataset()
# prepare graph
graphs = ds[0:batch_size][0]
bg = dgl.batch(graphs).to(device)
# dry run
for i in range(10):
glist = dgl.unbatch(bg)
# timing
with utils.Timer() as t:
for i in range(100):
glist = dgl.unbatch(bg)
return t.elapsed_secs / 100
================================================
FILE: benchmarks/benchmarks/kernel/__init__.py
================================================
================================================
FILE: benchmarks/benchmarks/kernel/bench_edgesoftmax.py
================================================
import time
import dgl
import torch
from .. import utils
# The benchmarks for ops edge_softmax
@utils.benchmark("time", timeout=600)
@utils.parametrize("graph", ["ogbn-arxiv", "reddit", "cora", "pubmed"])
@utils.parametrize("num_heads", [1, 4, 8])
def track_time(graph, num_heads):
device = utils.get_bench_device()
graph = utils.get_graph(graph).to(device)
score = (
torch.randn((graph.num_edges(), num_heads))
.requires_grad_(True)
.float()
.to(device)
)
# dry run
for i in range(3):
y = dgl.ops.edge_softmax(graph, score)
# timing
with utils.Timer(device) as t:
for i in range(100):
y = dgl.ops.edge_softmax(graph, score)
return t.elapsed_secs / 100
================================================
FILE: benchmarks/benchmarks/kernel/bench_gsddmm_u_dot_v.py
================================================
import time
import dgl
import torch
from .. import utils
def calc_gflops(graph, feat_size, num_heads, time):
return round(
2 * graph.num_edges() * feat_size / 1000000000 / time, 2
) # count both mul and add
# The benchmarks include broadcasting cases.
# Given feat_size = D, num_heads = H, the node feature shape will be (H, D // H)
# while the edge feature shape will be (H, ), so tested operations will broadcast
# along the last dimension. The total FLOP is controlled by the feat_size no
# matter how many heads are there.
# If num_heads = 0, it falls back to the normal element-wise operation without
# broadcasting.
@utils.benchmark("flops", timeout=600)
@utils.parametrize("graph", ["ogbn-arxiv", "reddit", "ogbn-proteins"])
@utils.parametrize("feat_size", [4, 32, 256])
@utils.parametrize("num_heads", [0, 1, 4])
def track_flops(graph, feat_size, num_heads):
device = utils.get_bench_device()
graph = utils.get_graph(graph, format="coo").to(device)
if num_heads == 0:
x = torch.randn(graph.num_nodes(), feat_size, device=device)
else:
x = torch.randn(
graph.num_nodes(), num_heads, feat_size // num_heads, device=device
)
# dry run
for i in range(3):
y = dgl.ops.u_dot_v(graph, x, x)
# timing
with utils.Timer(device) as t:
for i in range(10):
y = dgl.ops.u_dot_v(graph, x, x)
return calc_gflops(graph, feat_size, num_heads, t.elapsed_secs / 10)
================================================
FILE: benchmarks/benchmarks/kernel/bench_gspmm_copy_u.py
================================================
import time
import dgl
import torch
from .. import utils
def calc_gflops(graph, feat_size, time):
return round(graph.num_edges() * feat_size / 1000000000 / time, 2)
@utils.benchmark("flops", timeout=600)
@utils.parametrize("graph", ["ogbn-arxiv", "reddit", "ogbn-proteins"])
@utils.parametrize("feat_size", [4, 32, 256])
@utils.parametrize("reducer", ["sum", "max"])
def track_flops(graph, feat_size, reducer):
device = utils.get_bench_device()
graph = utils.get_graph(graph, format="csc").to(device)
x = torch.randn(graph.num_nodes(), feat_size, device=device)
if reducer == "sum":
op = dgl.ops.copy_u_sum
elif reducer == "max":
op = dgl.ops.copy_u_max
else:
raise ValueError("Invalid reducer", reducer)
# dry run
for i in range(3):
y = op(graph, x)
# timing
with utils.Timer(device) as t:
for i in range(10):
y = op(graph, x)
return calc_gflops(graph, feat_size, t.elapsed_secs / 10)
================================================
FILE: benchmarks/benchmarks/kernel/bench_gspmm_u_mul_e_sum.py
================================================
import time
import dgl
import torch
from .. import utils
def calc_gflops(graph, feat_size, num_heads, time):
return round(
2 * graph.num_edges() * feat_size / 1000000000 / time, 2
) # count both mul and add
# The benchmarks include broadcasting cases.
# Given feat_size = D, num_heads = H, the node feature shape will be (H, D // H)
# while the edge feature shape will be (H, ), so tested operations will broadcast
# along the last dimension. The total FLOP is controlled by the feat_size no
# matter how many heads are there.
# If num_heads = 0, it falls back to the normal element-wise operation without
# broadcasting.
@utils.benchmark("flops", timeout=600)
@utils.parametrize("graph", ["ogbn-arxiv", "reddit", "ogbn-proteins"])
@utils.parametrize("feat_size", [4, 32, 256])
@utils.parametrize("num_heads", [0, 1, 4])
def track_flops(graph, feat_size, num_heads):
device = utils.get_bench_device()
graph = utils.get_graph(graph, format="csc").to(device)
if num_heads == 0:
x = torch.randn(graph.num_nodes(), feat_size, device=device)
w = torch.randn(graph.num_edges(), feat_size, device=device)
else:
x = torch.randn(
graph.num_nodes(), num_heads, feat_size // num_heads, device=device
)
w = torch.randn(graph.num_edges(), num_heads, 1, device=device)
# dry run
for i in range(3):
y = dgl.ops.u_mul_e_sum(graph, x, w)
# timing
with utils.Timer(device) as t:
for i in range(10):
y = dgl.ops.u_mul_e_sum(graph, x, w)
return calc_gflops(graph, feat_size, num_heads, t.elapsed_secs / 10)
================================================
FILE: benchmarks/benchmarks/model_acc/__init__.py
================================================
================================================
FILE: benchmarks/benchmarks/model_acc/bench_gat.py
================================================
import dgl
import torch
import torch.nn as nn
import torch.nn.functional as F
from dgl.nn.pytorch import GATConv
from .. import utils
class GAT(nn.Module):
def __init__(
self,
num_layers,
in_dim,
num_hidden,
num_classes,
heads,
activation,
feat_drop,
attn_drop,
negative_slope,
residual,
):
super(GAT, self).__init__()
self.num_layers = num_layers
self.gat_layers = nn.ModuleList()
self.activation = activation
# input projection (no residual)
self.gat_layers.append(
GATConv(
in_dim,
num_hidden,
heads[0],
feat_drop,
attn_drop,
negative_slope,
False,
self.activation,
)
)
# hidden layers
for l in range(1, num_layers):
# due to multi-head, the in_dim = num_hidden * num_heads
self.gat_layers.append(
GATConv(
num_hidden * heads[l - 1],
num_hidden,
heads[l],
feat_drop,
attn_drop,
negative_slope,
residual,
self.activation,
)
)
# output projection
self.gat_layers.append(
GATConv(
num_hidden * heads[-2],
num_classes,
heads[-1],
feat_drop,
attn_drop,
negative_slope,
residual,
None,
)
)
def forward(self, g, inputs):
h = inputs
for l in range(self.num_layers):
h = self.gat_layers[l](g, h).flatten(1)
# output projection
logits = self.gat_layers[-1](g, h).mean(1)
return logits
def evaluate(model, g, features, labels, mask):
model.eval()
with torch.no_grad():
logits = model(g, features)
logits = logits[mask]
labels = labels[mask]
_, indices = torch.max(logits, dim=1)
correct = torch.sum(indices == labels)
return correct.item() * 1.0 / len(labels) * 100
@utils.benchmark("acc")
@utils.parametrize("data", ["cora", "pubmed"])
def track_acc(data):
data = utils.process_data(data)
device = utils.get_bench_device()
g = data[0].to(device)
features = g.ndata["feat"]
labels = g.ndata["label"]
train_mask = g.ndata["train_mask"]
val_mask = g.ndata["val_mask"]
test_mask = g.ndata["test_mask"]
in_feats = features.shape[1]
n_classes = data.num_classes
g = dgl.remove_self_loop(g)
g = dgl.add_self_loop(g)
# create model
model = GAT(1, in_feats, 8, n_classes, [8, 1], F.elu, 0.6, 0.6, 0.2, False)
loss_fcn = torch.nn.CrossEntropyLoss()
model = model.to(device)
model.train()
# optimizer
optimizer = torch.optim.Adam(model.parameters(), lr=1e-2, weight_decay=5e-4)
for epoch in range(200):
logits = model(g, features)
loss = loss_fcn(logits[train_mask], labels[train_mask])
optimizer.zero_grad()
loss.backward()
optimizer.step()
acc = evaluate(model, g, features, labels, test_mask)
return acc
================================================
FILE: benchmarks/benchmarks/model_acc/bench_gcn.py
================================================
import dgl
import torch
import torch.nn as nn
import torch.nn.functional as F
from dgl.nn.pytorch import GraphConv
from .. import utils
class GCN(nn.Module):
def __init__(
self, in_feats, n_hidden, n_classes, n_layers, activation, dropout
):
super(GCN, self).__init__()
self.layers = nn.ModuleList()
# input layer
self.layers.append(GraphConv(in_feats, n_hidden, activation=activation))
# hidden layers
for i in range(n_layers - 1):
self.layers.append(
GraphConv(n_hidden, n_hidden, activation=activation)
)
# output layer
self.layers.append(GraphConv(n_hidden, n_classes))
self.dropout = nn.Dropout(p=dropout)
def forward(self, g, features):
h = features
for i, layer in enumerate(self.layers):
if i != 0:
h = self.dropout(h)
h = layer(g, h)
return h
def evaluate(model, g, features, labels, mask):
model.eval()
with torch.no_grad():
logits = model(g, features)
logits = logits[mask]
labels = labels[mask]
_, indices = torch.max(logits, dim=1)
correct = torch.sum(indices == labels)
return correct.item() * 1.0 / len(labels) * 100
@utils.benchmark("acc")
@utils.parametrize("data", ["cora", "pubmed"])
def track_acc(data):
data = utils.process_data(data)
device = utils.get_bench_device()
g = data[0].to(device).int()
features = g.ndata["feat"]
labels = g.ndata["label"]
train_mask = g.ndata["train_mask"]
val_mask = g.ndata["val_mask"]
test_mask = g.ndata["test_mask"]
in_feats = features.shape[1]
n_classes = data.num_classes
g = dgl.remove_self_loop(g)
g = dgl.add_self_loop(g)
# normalization
degs = g.in_degrees().float()
norm = torch.pow(degs, -0.5)
norm[torch.isinf(norm)] = 0
g.ndata["norm"] = norm.unsqueeze(1)
# create GCN model
model = GCN(in_feats, 16, n_classes, 1, F.relu, 0.5)
loss_fcn = torch.nn.CrossEntropyLoss()
model = model.to(device)
model.train()
# optimizer
optimizer = torch.optim.Adam(model.parameters(), lr=1e-2, weight_decay=5e-4)
for epoch in range(200):
logits = model(g, features)
loss = loss_fcn(logits[train_mask], labels[train_mask])
optimizer.zero_grad()
loss.backward()
optimizer.step()
acc = evaluate(model, g, features, labels, test_mask)
return acc
================================================
FILE: benchmarks/benchmarks/model_acc/bench_gcn_udf.py
================================================
import dgl
import torch
import torch.nn as nn
import torch.nn.functional as F
from .. import utils
class GraphConv(nn.Module):
def __init__(self, in_dim, out_dim, activation=None):
super(GraphConv, self).__init__()
self.in_dim = in_dim
self.out_dim = out_dim
self.activation = activation
self.weight = nn.Parameter(torch.Tensor(in_dim, out_dim))
self.bias = nn.Parameter(torch.Tensor(out_dim))
nn.init.xavier_normal_(self.weight)
nn.init.zeros_(self.bias)
def forward(self, graph, feat):
with graph.local_scope():
graph.ndata["ci"] = torch.pow(
graph.out_degrees().float().clamp(min=1), -0.5
)
graph.ndata["cj"] = torch.pow(
graph.in_degrees().float().clamp(min=1), -0.5
)
graph.ndata["h"] = feat
graph.update_all(self.mfunc, self.rfunc)
h = graph.ndata["h"]
h = torch.matmul(h, self.weight) + self.bias
if self.activation is not None:
h = self.activation(h)
return h
def mfunc(self, edges):
return {"m": edges.src["h"], "ci": edges.src["ci"]}
def rfunc(self, nodes):
ci = nodes.mailbox["ci"].unsqueeze(2)
newh = (nodes.mailbox["m"] * ci).sum(1) * nodes.data["cj"].unsqueeze(1)
return {"h": newh}
class GCN(nn.Module):
def __init__(
self, in_feats, n_hidden, n_classes, n_layers, activation, dropout
):
super(GCN, self).__init__()
self.layers = nn.ModuleList()
# input layer
self.layers.append(GraphConv(in_feats, n_hidden, activation=activation))
# hidden layers
for i in range(n_layers - 1):
self.layers.append(
GraphConv(n_hidden, n_hidden, activation=activation)
)
# output layer
self.layers.append(GraphConv(n_hidden, n_classes))
self.dropout = nn.Dropout(p=dropout)
def forward(self, g, features):
h = features
for i, layer in enumerate(self.layers):
if i != 0:
h = self.dropout(h)
h = layer(g, h)
return h
def evaluate(model, g, features, labels, mask):
model.eval()
with torch.no_grad():
logits = model(g, features)
logits = logits[mask]
labels = labels[mask]
_, indices = torch.max(logits, dim=1)
correct = torch.sum(indices == labels)
return correct.item() * 1.0 / len(labels) * 100
@utils.benchmark("acc", timeout=300)
@utils.parametrize("data", ["cora", "pubmed"])
def track_acc(data):
data = utils.process_data(data)
device = utils.get_bench_device()
g = data[0].to(device).int()
features = g.ndata["feat"]
labels = g.ndata["label"]
train_mask = g.ndata["train_mask"]
val_mask = g.ndata["val_mask"]
test_mask = g.ndata["test_mask"]
in_feats = features.shape[1]
n_classes = data.num_classes
g = dgl.remove_self_loop(g)
g = dgl.add_self_loop(g)
# normalization
degs = g.in_degrees().float()
norm = torch.pow(degs, -0.5)
norm[torch.isinf(norm)] = 0
g.ndata["norm"] = norm.unsqueeze(1)
# create GCN model
model = GCN(in_feats, 16, n_classes, 1, F.relu, 0.5)
loss_fcn = torch.nn.CrossEntropyLoss()
model = model.to(device)
model.train()
# optimizer
optimizer = torch.optim.Adam(model.parameters(), lr=1e-2, weight_decay=5e-4)
for epoch in range(200):
logits = model(g, features)
loss = loss_fcn(logits[train_mask], labels[train_mask])
optimizer.zero_grad()
loss.backward()
optimizer.step()
acc = evaluate(model, g, features, labels, test_mask)
return acc
================================================
FILE: benchmarks/benchmarks/model_acc/bench_rgcn_base.py
================================================
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchmetrics.functional import accuracy
from .. import rgcn, utils
@utils.benchmark("acc", timeout=1200)
@utils.parametrize("dataset", ["aifb", "mutag"])
@utils.parametrize("ns_mode", [False])
def track_acc(dataset, ns_mode):
(
g,
num_rels,
num_classes,
labels,
train_idx,
test_idx,
target_idx,
) = rgcn.load_data(dataset, get_norm=True)
num_hidden = 16
if dataset == "aifb":
num_bases = -1
l2norm = 0.0
elif dataset == "mutag":
num_bases = 30
l2norm = 5e-4
elif dataset == "am":
num_bases = 40
l2norm = 5e-4
else:
raise ValueError()
model = rgcn.RGCN(
g.num_nodes(),
num_hidden,
num_classes,
num_rels,
num_bases=num_bases,
ns_mode=ns_mode,
)
device = utils.get_bench_device()
labels = labels.to(device)
model = model.to(device)
g = g.int().to(device)
optimizer = torch.optim.Adam(
model.parameters(), lr=1e-2, weight_decay=l2norm
)
model.train()
for epoch in range(30):
logits = model(g)
logits = logits[target_idx]
loss = F.cross_entropy(logits[train_idx], labels[train_idx])
optimizer.zero_grad()
loss.backward()
optimizer.step()
model.eval()
with torch.no_grad():
logits = model(g)
logits = logits[target_idx]
test_acc = accuracy(
logits[test_idx].argmax(dim=1),
labels[test_idx],
task="multiclass",
num_classes=num_classes,
).item()
return test_acc
================================================
FILE: benchmarks/benchmarks/model_acc/bench_rgcn_ns.py
================================================
import itertools
import time
import dgl
import dgl.nn.pytorch as dglnn
import torch as th
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from dgl.nn import RelGraphConv
from torch.utils.data import DataLoader
from .. import utils
class EntityClassify(nn.Module):
"""Entity classification class for RGCN
Parameters
----------
device : int
Device to run the layer.
num_nodes : int
Number of nodes.
h_dim : int
Hidden dim size.
out_dim : int
Output dim size.
num_rels : int
Numer of relation types.
num_bases : int
Number of bases. If is none, use number of relations.
num_hidden_layers : int
Number of hidden RelGraphConv Layer
dropout : float
Dropout
use_self_loop : bool
Use self loop if True, default False.
"""
def __init__(
self,
device,
num_nodes,
h_dim,
out_dim,
num_rels,
num_bases=None,
num_hidden_layers=1,
dropout=0,
use_self_loop=False,
layer_norm=False,
):
super(EntityClassify, self).__init__()
self.device = device
self.num_nodes = num_nodes
self.h_dim = h_dim
self.out_dim = out_dim
self.num_rels = num_rels
self.num_bases = None if num_bases < 0 else num_bases
self.num_hidden_layers = num_hidden_layers
self.dropout = dropout
self.use_self_loop = use_self_loop
self.layer_norm = layer_norm
self.layers = nn.ModuleList()
# i2h
self.layers.append(
RelGraphConv(
self.h_dim,
self.h_dim,
self.num_rels,
"basis",
self.num_bases,
activation=F.relu,
self_loop=self.use_self_loop,
dropout=self.dropout,
layer_norm=layer_norm,
)
)
# h2h
for idx in range(self.num_hidden_layers):
self.layers.append(
RelGraphConv(
self.h_dim,
self.h_dim,
self.num_rels,
"basis",
self.num_bases,
activation=F.relu,
self_loop=self.use_self_loop,
dropout=self.dropout,
layer_norm=layer_norm,
)
)
# h2o
self.layers.append(
RelGraphConv(
self.h_dim,
self.out_dim,
self.num_rels,
"basis",
self.num_bases,
activation=None,
self_loop=self.use_self_loop,
layer_norm=layer_norm,
)
)
def forward(self, blocks, feats, norm=None):
if blocks is None:
# full graph training
blocks = [self.g] * len(self.layers)
h = feats
for layer, block in zip(self.layers, blocks):
block = block.to(self.device)
h = layer(block, h, block.edata["etype"], block.edata["norm"])
return h
class RelGraphEmbedLayer(nn.Module):
r"""Embedding layer for featureless heterograph.
Parameters
----------
device : int
Device to run the layer.
num_nodes : int
Number of nodes.
node_tides : tensor
Storing the node type id for each node starting from 0
num_of_ntype : int
Number of node types
input_size : list of int
A list of input feature size for each node type. If None, we then
treat certain input feature as an one-hot encoding feature.
embed_size : int
Output embed size
embed_name : str, optional
Embed name
"""
def __init__(
self,
device,
num_nodes,
node_tids,
num_of_ntype,
input_size,
embed_size,
sparse_emb=False,
embed_name="embed",
):
super(RelGraphEmbedLayer, self).__init__()
self.device = device
self.embed_size = embed_size
self.embed_name = embed_name
self.num_nodes = num_nodes
self.sparse_emb = sparse_emb
# create weight embeddings for each node for each relation
self.embeds = nn.ParameterDict()
self.num_of_ntype = num_of_ntype
self.idmap = th.empty(num_nodes).long()
for ntype in range(num_of_ntype):
if input_size[ntype] is not None:
input_emb_size = input_size[ntype].shape[1]
embed = nn.Parameter(th.Tensor(input_emb_size, self.embed_size))
nn.init.xavier_uniform_(embed)
self.embeds[str(ntype)] = embed
self.node_embeds = th.nn.Embedding(
node_tids.shape[0], self.embed_size, sparse=self.sparse_emb
)
nn.init.uniform_(self.node_embeds.weight, -1.0, 1.0)
def forward(self, node_ids, node_tids, type_ids, features):
"""Forward computation
Parameters
----------
node_ids : tensor
node ids to generate embedding for.
node_tids : tensor
node type ids
features : list of features
list of initial features for nodes belong to different node type.
If None, the corresponding features is an one-hot encoding feature,
else use the features directly as input feature and matmul a
projection matrix.
Returns
-------
tensor
embeddings as the input of the next layer
"""
tsd_ids = node_ids.to(self.node_embeds.weight.device)
embeds = th.empty(
node_ids.shape[0], self.embed_size, device=self.device
)
for ntype in range(self.num_of_ntype):
if features[ntype] is not None:
loc = node_tids == ntype
embeds[loc] = features[ntype][type_ids[loc]].to(
self.device
) @ self.embeds[str(ntype)].to(self.device)
else:
loc = node_tids == ntype
embeds[loc] = self.node_embeds(tsd_ids[loc]).to(self.device)
return embeds
def evaluate(model, embed_layer, eval_loader, node_feats):
model.eval()
embed_layer.eval()
eval_logits = []
eval_seeds = []
with th.no_grad():
for sample_data in eval_loader:
th.cuda.empty_cache()
_, _, blocks = sample_data
feats = embed_layer(
blocks[0].srcdata[dgl.NID],
blocks[0].srcdata[dgl.NTYPE],
blocks[0].srcdata["type_id"],
node_feats,
)
logits = model(blocks, feats)
eval_logits.append(logits.cpu().detach())
eval_seeds.append(blocks[-1].dstdata["type_id"].cpu().detach())
eval_logits = th.cat(eval_logits)
eval_seeds = th.cat(eval_seeds)
return eval_logits, eval_seeds
@utils.benchmark("acc", timeout=3600) # ogbn-mag takes ~1 hour to train
@utils.parametrize("data", ["am", "ogbn-mag"])
def track_acc(data):
dataset = utils.process_data(data)
device = utils.get_bench_device()
if data == "am":
n_bases = 40
l2norm = 5e-4
n_epochs = 20
elif data == "ogbn-mag":
n_bases = 2
l2norm = 0
n_epochs = 20
else:
raise ValueError()
fanouts = [25, 15]
n_layers = 2
batch_size = 1024
n_hidden = 64
dropout = 0.5
use_self_loop = True
lr = 0.01
num_workers = 4
hg = dataset[0]
category = dataset.predict_category
num_classes = dataset.num_classes
train_mask = hg.nodes[category].data.pop("train_mask")
train_idx = th.nonzero(train_mask, as_tuple=False).squeeze()
test_mask = hg.nodes[category].data.pop("test_mask")
test_idx = th.nonzero(test_mask, as_tuple=False).squeeze()
labels = hg.nodes[category].data.pop("labels").to(device)
num_of_ntype = len(hg.ntypes)
num_rels = len(hg.canonical_etypes)
node_feats = []
for ntype in hg.ntypes:
if len(hg.nodes[ntype].data) == 0 or "feat" not in hg.nodes[ntype].data:
node_feats.append(None)
else:
feat = hg.nodes[ntype].data.pop("feat")
node_feats.append(feat.share_memory_())
# get target category id
category_id = len(hg.ntypes)
for i, ntype in enumerate(hg.ntypes):
if ntype == category:
category_id = i
g = dgl.to_homogeneous(hg)
u, v, eid = g.all_edges(form="all")
# global norm
_, inverse_index, count = th.unique(
v, return_inverse=True, return_counts=True
)
degrees = count[inverse_index]
norm = th.ones(eid.shape[0]) / degrees
norm = norm.unsqueeze(1)
g.edata["norm"] = norm
g.edata["etype"] = g.edata[dgl.ETYPE]
g.ndata["type_id"] = g.ndata[dgl.NID]
g.ndata["ntype"] = g.ndata[dgl.NTYPE]
node_ids = th.arange(g.num_nodes())
# find out the target node ids
node_tids = g.ndata[dgl.NTYPE]
loc = node_tids == category_id
target_nids = node_ids[loc]
g = g.formats("csc")
sampler = dgl.dataloading.MultiLayerNeighborSampler(fanouts)
train_loader = dgl.dataloading.DataLoader(
g,
target_nids[train_idx],
sampler,
batch_size=batch_size,
shuffle=True,
drop_last=False,
num_workers=num_workers,
)
test_loader = dgl.dataloading.DataLoader(
g,
target_nids[test_idx],
sampler,
batch_size=batch_size,
shuffle=True,
drop_last=False,
num_workers=num_workers,
)
# node features
# None for one-hot feature, if not none, it should be the feature tensor.
embed_layer = RelGraphEmbedLayer(
device,
g.num_nodes(),
node_tids,
num_of_ntype,
node_feats,
n_hidden,
sparse_emb=True,
)
# create model
# all model params are in device.
model = EntityClassify(
device,
g.num_nodes(),
n_hidden,
num_classes,
num_rels,
num_bases=n_bases,
num_hidden_layers=n_layers - 2,
dropout=dropout,
use_self_loop=use_self_loop,
layer_norm=False,
)
embed_layer = embed_layer.to(device)
model = model.to(device)
all_params = itertools.chain(
model.parameters(), embed_layer.embeds.parameters()
)
optimizer = th.optim.Adam(all_params, lr=lr, weight_decay=l2norm)
emb_optimizer = th.optim.SparseAdam(
list(embed_layer.node_embeds.parameters()), lr=lr
)
print("start training...")
for epoch in range(n_epochs):
model.train()
embed_layer.train()
for i, sample_data in enumerate(train_loader):
input_nodes, output_nodes, blocks = sample_data
feats = embed_layer(
input_nodes,
blocks[0].srcdata["ntype"],
blocks[0].srcdata["type_id"],
node_feats,
)
logits = model(blocks, feats)
seed_idx = blocks[-1].dstdata["type_id"]
loss = F.cross_entropy(logits, labels[seed_idx])
optimizer.zero_grad()
emb_optimizer.zero_grad()
loss.backward()
optimizer.step()
emb_optimizer.step()
print("start testing...")
test_logits, test_seeds = evaluate(
model, embed_layer, test_loader, node_feats
)
test_loss = F.cross_entropy(test_logits, labels[test_seeds].cpu()).item()
test_acc = th.sum(
test_logits.argmax(dim=1) == labels[test_seeds].cpu()
).item() / len(test_seeds)
return test_acc
================================================
FILE: benchmarks/benchmarks/model_acc/bench_sage.py
================================================
import dgl
import torch
import torch.nn as nn
import torch.nn.functional as F
from dgl.nn.pytorch import SAGEConv
from .. import utils
class GraphSAGE(nn.Module):
def __init__(
self,
in_feats,
n_hidden,
n_classes,
n_layers,
activation,
dropout,
aggregator_type,
):
super(GraphSAGE, self).__init__()
self.layers = nn.ModuleList()
self.dropout = nn.Dropout(dropout)
self.activation = activation
# input layer
self.layers.append(SAGEConv(in_feats, n_hidden, aggregator_type))
# hidden layers
for i in range(n_layers - 1):
self.layers.append(SAGEConv(n_hidden, n_hidden, aggregator_type))
# output layer
self.layers.append(
SAGEConv(n_hidden, n_classes, aggregator_type)
) # activation None
def forward(self, graph, inputs):
h = self.dropout(inputs)
for l, layer in enumerate(self.layers):
h = layer(graph, h)
if l != len(self.layers) - 1:
h = self.activation(h)
h = self.dropout(h)
return h
def evaluate(model, g, features, labels, mask):
model.eval()
with torch.no_grad():
logits = model(g, features)
logits = logits[mask]
labels = labels[mask]
_, indices = torch.max(logits, dim=1)
correct = torch.sum(indices == labels)
return correct.item() * 1.0 / len(labels) * 100
@utils.benchmark("acc")
@utils.parametrize("data", ["cora", "pubmed"])
def track_acc(data):
data = utils.process_data(data)
device = utils.get_bench_device()
g = data[0].to(device)
features = g.ndata["feat"]
labels = g.ndata["label"]
train_mask = g.ndata["train_mask"]
val_mask = g.ndata["val_mask"]
test_mask = g.ndata["test_mask"]
in_feats = features.shape[1]
n_classes = data.num_classes
g = dgl.remove_self_loop(g)
g = dgl.add_self_loop(g)
# create model
model = GraphSAGE(in_feats, 16, n_classes, 1, F.relu, 0.5, "gcn")
loss_fcn = torch.nn.CrossEntropyLoss()
model = model.to(device)
model.train()
# optimizer
optimizer = torch.optim.Adam(model.parameters(), lr=1e-2, weight_decay=5e-4)
for epoch in range(200):
logits = model(g, features)
loss = loss_fcn(logits[train_mask], labels[train_mask])
optimizer.zero_grad()
loss.backward()
optimizer.step()
acc = evaluate(model, g, features, labels, test_mask)
return acc
================================================
FILE: benchmarks/benchmarks/model_acc/bench_sage_ns.py
================================================
import time
import dgl
import dgl.nn.pytorch as dglnn
import torch as th
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
from .. import utils
class SAGE(nn.Module):
def __init__(
self, in_feats, n_hidden, n_classes, n_layers, activation, dropout
):
super().__init__()
self.n_layers = n_layers
self.n_hidden = n_hidden
self.n_classes = n_classes
self.layers = nn.ModuleList()
self.layers.append(dglnn.SAGEConv(in_feats, n_hidden, "mean"))
for i in range(1, n_layers - 1):
self.layers.append(dglnn.SAGEConv(n_hidden, n_hidden, "mean"))
self.layers.append(dglnn.SAGEConv(n_hidden, n_classes, "mean"))
self.dropout = nn.Dropout(dropout)
self.activation
gitextract_7pa1_qyp/
├── .clang-format
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── --work-item--dev-only-.md
│ │ ├── bug-report.md
│ │ ├── documentation.md
│ │ ├── feature-request.md
│ │ └── questions-help-support.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ └── workflows/
│ ├── lint.yml
│ └── stale.yml
├── .gitignore
├── .gitmodules
├── .lintrunner.toml
├── CMakeLists.txt
├── CONTRIBUTORS.md
├── Jenkinsfile
├── LICENSE
├── NEWS.md
├── README.md
├── apps/
│ └── life_sci/
│ └── README.md
├── benchmarks/
│ ├── .gitignore
│ ├── Jenkinsfile
│ ├── README.md
│ ├── asv.conf.json
│ ├── benchmarks/
│ │ ├── __init__.py
│ │ ├── api/
│ │ │ ├── __init__.py
│ │ │ ├── bench_add_self_loop.py
│ │ │ ├── bench_batch.py
│ │ │ ├── bench_builtin_apply_edges.py
│ │ │ ├── bench_builtin_apply_edges_hetero.py
│ │ │ ├── bench_builtin_multi_update_all.py
│ │ │ ├── bench_builtin_update_all_coo.py
│ │ │ ├── bench_builtin_update_all_csc.py
│ │ │ ├── bench_edge_ids.py
│ │ │ ├── bench_edge_subgraph.py
│ │ │ ├── bench_find_edges.py
│ │ │ ├── bench_format_conversion.py
│ │ │ ├── bench_fused_sample_neighbors.py
│ │ │ ├── bench_heterograph_construction.py
│ │ │ ├── bench_homograph_edge_construction.py
│ │ │ ├── bench_homograph_scipy_construction.py
│ │ │ ├── bench_in_degrees.py
│ │ │ ├── bench_in_edges.py
│ │ │ ├── bench_in_subgraph.py
│ │ │ ├── bench_khop.py
│ │ │ ├── bench_knn_graph.py
│ │ │ ├── bench_metis_partition.py
│ │ │ ├── bench_nn_graphconv.py
│ │ │ ├── bench_nn_heterographconv.py
│ │ │ ├── bench_node_subgraph.py
│ │ │ ├── bench_random_walk.py
│ │ │ ├── bench_readout.py
│ │ │ ├── bench_reverse.py
│ │ │ ├── bench_sample_neighbors.py
│ │ │ ├── bench_to_block.py
│ │ │ ├── bench_udf_apply_edges.py
│ │ │ ├── bench_udf_multi_update_all.py
│ │ │ ├── bench_udf_update_all.py
│ │ │ └── bench_unbatch.py
│ │ ├── kernel/
│ │ │ ├── __init__.py
│ │ │ ├── bench_edgesoftmax.py
│ │ │ ├── bench_gsddmm_u_dot_v.py
│ │ │ ├── bench_gspmm_copy_u.py
│ │ │ └── bench_gspmm_u_mul_e_sum.py
│ │ ├── model_acc/
│ │ │ ├── __init__.py
│ │ │ ├── bench_gat.py
│ │ │ ├── bench_gcn.py
│ │ │ ├── bench_gcn_udf.py
│ │ │ ├── bench_rgcn_base.py
│ │ │ ├── bench_rgcn_ns.py
│ │ │ ├── bench_sage.py
│ │ │ └── bench_sage_ns.py
│ │ ├── model_speed/
│ │ │ ├── __init__.py
│ │ │ ├── bench_gat.py
│ │ │ ├── bench_gat_ns.py
│ │ │ ├── bench_gcn_udf.py
│ │ │ ├── bench_pinsage.py
│ │ │ ├── bench_rgcn_base.py
│ │ │ ├── bench_rgcn_hetero_ns.py
│ │ │ ├── bench_rgcn_homogeneous_ns.py
│ │ │ ├── bench_sage.py
│ │ │ ├── bench_sage_ns.py
│ │ │ └── bench_sage_unsupervised_ns.py
│ │ ├── multigpu/
│ │ │ ├── __init__.py
│ │ │ ├── bench_multigpu_rgcn.py
│ │ │ ├── bench_multigpu_sage.py
│ │ │ └── rgcn_model.py
│ │ ├── rgcn.py
│ │ └── utils.py
│ ├── run.sh
│ ├── scripts/
│ │ ├── README.md
│ │ ├── build_dgl_asv.sh
│ │ ├── fix_ram_info.py
│ │ ├── generate_excel.py
│ │ ├── install_dgl_asv.sh
│ │ ├── publish.sh
│ │ ├── replace_branch.py
│ │ └── torch_gpu_pip.txt
│ └── task.json
├── cmake/
│ ├── modules/
│ │ ├── CUDA.cmake
│ │ └── FindMETIS.cmake
│ └── util/
│ ├── FindCUDA.cmake
│ ├── MshadowUtil.cmake
│ └── Util.cmake
├── conda/
│ └── dgl/
│ ├── README.md
│ ├── bld.bat
│ ├── build.sh
│ ├── conda_build_config.yaml
│ ├── meta.yaml
│ ├── run_test.bat
│ └── run_test.sh
├── dgl_sparse/
│ ├── CMakeLists.txt
│ ├── build.bat
│ ├── build.sh
│ ├── find_cmake.py
│ ├── include/
│ │ └── sparse/
│ │ ├── dgl_headers.h
│ │ ├── elementwise_op.h
│ │ ├── matrix_ops.h
│ │ ├── reduction.h
│ │ ├── sddmm.h
│ │ ├── softmax.h
│ │ ├── sparse_format.h
│ │ ├── sparse_matrix.h
│ │ ├── spmm.h
│ │ └── spspmm.h
│ └── src/
│ ├── cpu/
│ │ └── matrix_ops_impl.cc
│ ├── elemenwise_op.cc
│ ├── matmul.cc
│ ├── matmul.h
│ ├── matrix_ops.cc
│ ├── matrix_ops_impl.h
│ ├── python_binding.cc
│ ├── reduction.cc
│ ├── sddmm.cc
│ ├── softmax.cc
│ ├── sparse_format.cc
│ ├── sparse_matrix.cc
│ ├── sparse_matrix_coalesce.cc
│ ├── spmm.cc
│ ├── spspmm.cc
│ └── utils.h
├── dglgo/
│ ├── README.md
│ ├── dglgo/
│ │ ├── __init__.py
│ │ ├── apply_pipeline/
│ │ │ ├── __init__.py
│ │ │ ├── graphpred/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gen.py
│ │ │ │ └── graphpred.jinja-py
│ │ │ ├── nodepred/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gen.py
│ │ │ │ └── nodepred.jinja-py
│ │ │ └── nodepred_sample/
│ │ │ ├── __init__.py
│ │ │ ├── gen.py
│ │ │ └── nodepred-ns.jinja-py
│ │ ├── cli/
│ │ │ ├── __init__.py
│ │ │ ├── apply_cli.py
│ │ │ ├── cli.py
│ │ │ ├── config_apply_cli.py
│ │ │ ├── config_cli.py
│ │ │ ├── export_cli.py
│ │ │ ├── recipe_cli.py
│ │ │ └── train_cli.py
│ │ ├── model/
│ │ │ ├── __init__.py
│ │ │ ├── edge_encoder/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── bilinear.py
│ │ │ │ ├── dot.py
│ │ │ │ └── ele.py
│ │ │ ├── graph_encoder/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gin_ogbg.py
│ │ │ │ └── pna.py
│ │ │ └── node_encoder/
│ │ │ ├── __init__.py
│ │ │ ├── gat.py
│ │ │ ├── gcn.py
│ │ │ ├── gin.py
│ │ │ ├── sage.py
│ │ │ └── sgc.py
│ │ ├── pipeline/
│ │ │ ├── __init__.py
│ │ │ ├── graphpred/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gen.py
│ │ │ │ └── graphpred.jinja-py
│ │ │ ├── linkpred/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gen.py
│ │ │ │ └── linkpred.jinja-py
│ │ │ ├── nodepred/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gen.py
│ │ │ │ └── nodepred.jinja-py
│ │ │ └── nodepred_sample/
│ │ │ ├── __init__.py
│ │ │ ├── gen.py
│ │ │ └── nodepred-ns.jinja-py
│ │ └── utils/
│ │ ├── __init__.py
│ │ ├── base_model.py
│ │ ├── early_stop.py
│ │ ├── enter_config.py
│ │ ├── factory.py
│ │ └── yaml_dump.py
│ ├── recipes/
│ │ ├── __init__.py
│ │ ├── graphpred_hiv_gin.yaml
│ │ ├── graphpred_hiv_pna.yaml
│ │ ├── graphpred_pcba_gin.yaml
│ │ ├── linkpred_citation2_sage.yaml
│ │ ├── linkpred_collab_sage.yaml
│ │ ├── linkpred_cora_sage.yaml
│ │ ├── nodepred-ns_arxiv_gcn.yaml
│ │ ├── nodepred-ns_product_sage.yaml
│ │ ├── nodepred_citeseer_gat.yaml
│ │ ├── nodepred_citeseer_gcn.yaml
│ │ ├── nodepred_citeseer_sage.yaml
│ │ ├── nodepred_cora_gat.yaml
│ │ ├── nodepred_cora_gcn.yaml
│ │ ├── nodepred_cora_sage.yaml
│ │ ├── nodepred_pubmed_gat.yaml
│ │ ├── nodepred_pubmed_gcn.yaml
│ │ └── nodepred_pubmed_sage.yaml
│ ├── setup.py
│ └── tests/
│ ├── cfg.yml
│ ├── run_test.sh
│ └── test_pipeline.py
├── docker/
│ ├── Dockerfile.awscli
│ ├── Dockerfile.ci_benchmark
│ ├── Dockerfile.ci_cpu
│ ├── Dockerfile.ci_gpu
│ ├── Dockerfile.ci_lint
│ ├── README.md
│ ├── install/
│ │ ├── conda_env/
│ │ │ ├── kg_cpu.yml
│ │ │ ├── kg_gpu.yml
│ │ │ ├── mxnet_cpu.yml
│ │ │ ├── mxnet_gpu.yml
│ │ │ ├── tensorflow_cpu.yml
│ │ │ ├── tensorflow_gpu.yml
│ │ │ ├── torch_cpu.yml
│ │ │ ├── torch_cpu_pip.txt
│ │ │ ├── torch_gpu.yml
│ │ │ └── torch_gpu_pip.txt
│ │ ├── ubuntu_install_antlr.sh
│ │ ├── ubuntu_install_build.sh
│ │ ├── ubuntu_install_conda.sh
│ │ ├── ubuntu_install_core.sh
│ │ ├── ubuntu_install_java.sh
│ │ ├── ubuntu_install_mxnet_cpu.sh
│ │ ├── ubuntu_install_mxnet_gpu.sh
│ │ ├── ubuntu_install_python.sh
│ │ ├── ubuntu_install_python_package.sh
│ │ ├── ubuntu_install_torch.sh
│ │ └── ubuntu_install_torch_1.2.0.sh
│ └── pods/
│ ├── ci-compile-cpu.yaml
│ ├── ci-compile-gpu.yaml
│ ├── ci-cpu.yaml
│ ├── ci-gpu.yaml
│ └── ci-lint.yaml
├── docs/
│ ├── .gitignore
│ ├── Makefile
│ ├── README.md
│ ├── clean.sh
│ ├── migrate-guide-0.5.md
│ └── source/
│ ├── _static/
│ │ └── css/
│ │ └── custom.css
│ ├── _templates/
│ │ ├── classtemplate.rst
│ │ └── graphbolt_classtemplate.rst
│ ├── api/
│ │ └── python/
│ │ ├── dgl.DGLGraph.rst
│ │ ├── dgl.data.rst
│ │ ├── dgl.dataloading.rst
│ │ ├── dgl.distributed.rst
│ │ ├── dgl.function.rst
│ │ ├── dgl.geometry.rst
│ │ ├── dgl.graphbolt.rst
│ │ ├── dgl.multiprocessing.rst
│ │ ├── dgl.ops.rst
│ │ ├── dgl.optim.rst
│ │ ├── dgl.rst
│ │ ├── dgl.sampling.rst
│ │ ├── dgl.sparse_v0.rst
│ │ ├── index.rst
│ │ ├── knn_benchmark.rst
│ │ ├── nn-mxnet.rst
│ │ ├── nn-pytorch.rst
│ │ ├── nn-tensorflow.rst
│ │ ├── nn.functional.rst
│ │ ├── transforms.rst
│ │ └── udf.rst
│ ├── conf.py
│ ├── contribute.rst
│ ├── developer/
│ │ └── ffi.rst
│ ├── env_var.rst
│ ├── faq.rst
│ ├── features/
│ │ └── dataset.rst
│ ├── gen_dataset_stat.py
│ ├── graphtransformer/
│ │ ├── data.rst
│ │ ├── index.rst
│ │ └── model.rst
│ ├── guide/
│ │ ├── data-dataset.rst
│ │ ├── data-download.rst
│ │ ├── data-loadcsv.rst
│ │ ├── data-loadogb.rst
│ │ ├── data-process.rst
│ │ ├── data-savenload.rst
│ │ ├── data.rst
│ │ ├── distributed-apis.rst
│ │ ├── distributed-hetero.rst
│ │ ├── distributed-partition.rst
│ │ ├── distributed-preprocessing.rst
│ │ ├── distributed-tools.rst
│ │ ├── distributed.rst
│ │ ├── graph-basic.rst
│ │ ├── graph-external.rst
│ │ ├── graph-feature.rst
│ │ ├── graph-gpu.rst
│ │ ├── graph-graphs-nodes-edges.rst
│ │ ├── graph-heterogeneous.rst
│ │ ├── graph.rst
│ │ ├── index.rst
│ │ ├── message-api.rst
│ │ ├── message-efficient.rst
│ │ ├── message-heterograph.rst
│ │ ├── message-part.rst
│ │ ├── message.rst
│ │ ├── minibatch-custom-sampler.rst
│ │ ├── minibatch-edge.rst
│ │ ├── minibatch-gpu-sampling.rst
│ │ ├── minibatch-inference.rst
│ │ ├── minibatch-link.rst
│ │ ├── minibatch-nn.rst
│ │ ├── minibatch-node.rst
│ │ ├── minibatch-parallelism.rst
│ │ ├── minibatch-sparse.rst
│ │ ├── minibatch.rst
│ │ ├── mixed_precision.rst
│ │ ├── nn-construction.rst
│ │ ├── nn-forward.rst
│ │ ├── nn-heterograph.rst
│ │ ├── nn.rst
│ │ ├── training-edge.rst
│ │ ├── training-eweight.rst
│ │ ├── training-graph.rst
│ │ ├── training-link.rst
│ │ ├── training-node.rst
│ │ └── training.rst
│ ├── guide_cn/
│ │ ├── data-dataset.rst
│ │ ├── data-download.rst
│ │ ├── data-loadogb.rst
│ │ ├── data-process.rst
│ │ ├── data-savenload.rst
│ │ ├── data.rst
│ │ ├── distributed-apis.rst
│ │ ├── distributed-preprocessing.rst
│ │ ├── distributed-tools.rst
│ │ ├── distributed.rst
│ │ ├── graph-basic.rst
│ │ ├── graph-external.rst
│ │ ├── graph-feature.rst
│ │ ├── graph-gpu.rst
│ │ ├── graph-graphs-nodes-edges.rst
│ │ ├── graph-heterogeneous.rst
│ │ ├── graph.rst
│ │ ├── index.rst
│ │ ├── message-api.rst
│ │ ├── message-efficient.rst
│ │ ├── message-heterograph.rst
│ │ ├── message-part.rst
│ │ ├── message.rst
│ │ ├── minibatch-custom-sampler.rst
│ │ ├── minibatch-edge.rst
│ │ ├── minibatch-inference.rst
│ │ ├── minibatch-link.rst
│ │ ├── minibatch-nn.rst
│ │ ├── minibatch-node.rst
│ │ ├── minibatch.rst
│ │ ├── nn-construction.rst
│ │ ├── nn-forward.rst
│ │ ├── nn-heterograph.rst
│ │ ├── nn.rst
│ │ ├── training-edge.rst
│ │ ├── training-eweight.rst
│ │ ├── training-graph.rst
│ │ ├── training-link.rst
│ │ ├── training-node.rst
│ │ └── training.rst
│ ├── guide_ko/
│ │ ├── data-dataset.rst
│ │ ├── data-download.rst
│ │ ├── data-loadogb.rst
│ │ ├── data-process.rst
│ │ ├── data-savenload.rst
│ │ ├── data.rst
│ │ ├── distributed-apis.rst
│ │ ├── distributed-hetero.rst
│ │ ├── distributed-preprocessing.rst
│ │ ├── distributed-tools.rst
│ │ ├── distributed.rst
│ │ ├── graph-basic.rst
│ │ ├── graph-external.rst
│ │ ├── graph-feature.rst
│ │ ├── graph-gpu.rst
│ │ ├── graph-graphs-nodes-edges.rst
│ │ ├── graph-heterogeneous.rst
│ │ ├── graph.rst
│ │ ├── index.rst
│ │ ├── message-api.rst
│ │ ├── message-edge.rst
│ │ ├── message-efficient.rst
│ │ ├── message-heterograph.rst
│ │ ├── message-part.rst
│ │ ├── message.rst
│ │ ├── minibatch-custom-sampler.rst
│ │ ├── minibatch-edge.rst
│ │ ├── minibatch-gpu-sampling.rst
│ │ ├── minibatch-inference.rst
│ │ ├── minibatch-link.rst
│ │ ├── minibatch-nn.rst
│ │ ├── minibatch-node.rst
│ │ ├── minibatch.rst
│ │ ├── mixed_precision.rst
│ │ ├── nn-construction.rst
│ │ ├── nn-forward.rst
│ │ ├── nn-heterograph.rst
│ │ ├── nn.rst
│ │ ├── training-edge.rst
│ │ ├── training-graph.rst
│ │ ├── training-link.rst
│ │ ├── training-node.rst
│ │ └── training.rst
│ ├── index.rst
│ ├── install/
│ │ └── index.rst
│ ├── notebooks/
│ │ └── sparse/
│ │ ├── gcn.nblink
│ │ ├── graph_diffusion.nblink
│ │ ├── graph_transformer.nblink
│ │ ├── hgnn.nblink
│ │ ├── index.rst
│ │ └── quickstart.nblink
│ ├── performance.rst
│ ├── resources.rst
│ └── stochastic_training/
│ ├── index.rst
│ ├── link_prediction.nblink
│ ├── multigpu_node_classification.nblink
│ ├── neighbor_sampling_overview.nblink
│ ├── node_classification.nblink
│ ├── ondisk-dataset-specification.rst
│ ├── ondisk-dataset.rst
│ ├── ondisk_dataset_heterograph.nblink
│ └── ondisk_dataset_homograph.nblink
├── examples/
│ ├── README.md
│ ├── advanced/
│ │ └── cugraph/
│ │ ├── graphsage.py
│ │ └── rgcn.py
│ ├── core/
│ │ ├── Graphormer/
│ │ │ ├── README.md
│ │ │ ├── dataset.py
│ │ │ ├── main.py
│ │ │ └── model.py
│ │ ├── gat/
│ │ │ ├── README.md
│ │ │ └── train.py
│ │ ├── gated_gcn/
│ │ │ ├── README.md
│ │ │ └── train.py
│ │ ├── graphsage/
│ │ │ └── node_classification.py
│ │ └── rgcn/
│ │ ├── README.md
│ │ └── hetero_rgcn.py
│ ├── distributed/
│ │ ├── graphsage/
│ │ │ ├── README.md
│ │ │ ├── node_classification.py
│ │ │ ├── node_classification_unsupervised.py
│ │ │ └── partition_graph.py
│ │ └── rgcn/
│ │ ├── README.md
│ │ ├── lp_perf.py
│ │ ├── node_classification.py
│ │ └── partition_graph.py
│ ├── graphbolt/
│ │ ├── README.md
│ │ ├── disk_based_feature/
│ │ │ ├── README.md
│ │ │ └── node_classification.py
│ │ ├── lightning/
│ │ │ ├── README.md
│ │ │ └── node_classification.py
│ │ ├── link_prediction.py
│ │ ├── node_classification.py
│ │ ├── pyg/
│ │ │ ├── README.md
│ │ │ ├── hetero/
│ │ │ │ └── node_classification.py
│ │ │ ├── labor/
│ │ │ │ ├── README.md
│ │ │ │ ├── load_dataset.py
│ │ │ │ ├── node_classification.py
│ │ │ │ └── sage_conv.py
│ │ │ ├── link_prediction.py
│ │ │ ├── multigpu/
│ │ │ │ └── node_classification.py
│ │ │ ├── node_classification.py
│ │ │ └── node_classification_advanced.py
│ │ ├── quickstart/
│ │ │ ├── README.md
│ │ │ ├── link_prediction.py
│ │ │ └── node_classification.py
│ │ ├── rgcn/
│ │ │ ├── README.md
│ │ │ └── hetero_rgcn.py
│ │ ├── sparse/
│ │ │ └── graphsage.py
│ │ └── temporal_link_prediction.py
│ ├── legacy/
│ │ ├── README.md
│ │ ├── link_prediction.py
│ │ └── node_classification.py
│ ├── multigpu/
│ │ ├── README.md
│ │ ├── graphbolt/
│ │ │ ├── README.md
│ │ │ └── node_classification.py
│ │ └── node_classification_sage.py
│ ├── mxnet/
│ │ ├── README.md
│ │ ├── appnp/
│ │ │ ├── README.md
│ │ │ └── appnp.py
│ │ ├── gat/
│ │ │ ├── README.md
│ │ │ ├── gat.py
│ │ │ ├── train.py
│ │ │ └── utils.py
│ │ ├── gcn/
│ │ │ ├── README.md
│ │ │ ├── gcn.py
│ │ │ ├── gcn_concat.py
│ │ │ ├── gcn_mp.py
│ │ │ └── train.py
│ │ ├── gin/
│ │ │ ├── README.md
│ │ │ ├── dataloader.py
│ │ │ ├── gin.py
│ │ │ ├── main.py
│ │ │ └── parser.py
│ │ ├── graphsage/
│ │ │ ├── README.md
│ │ │ └── main.py
│ │ ├── monet/
│ │ │ ├── README.md
│ │ │ └── citation.py
│ │ ├── rgcn/
│ │ │ ├── README.md
│ │ │ ├── entity_classify.py
│ │ │ └── model.py
│ │ ├── scenegraph/
│ │ │ ├── README.md
│ │ │ ├── data/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── dataloader.py
│ │ │ │ ├── object.py
│ │ │ │ ├── prepare_visualgenome.py
│ │ │ │ └── relation.py
│ │ │ ├── demo_reldn.py
│ │ │ ├── model/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── faster_rcnn.py
│ │ │ │ └── reldn.py
│ │ │ ├── train_faster_rcnn.py
│ │ │ ├── train_faster_rcnn.sh
│ │ │ ├── train_freq_prior.py
│ │ │ ├── train_reldn.py
│ │ │ ├── train_reldn.sh
│ │ │ ├── utils/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── build_graph.py
│ │ │ │ ├── metric.py
│ │ │ │ ├── sampling.py
│ │ │ │ └── viz.py
│ │ │ ├── validate_reldn.py
│ │ │ └── validate_reldn.sh
│ │ ├── sgc/
│ │ │ ├── README.md
│ │ │ └── sgc.py
│ │ ├── tagcn/
│ │ │ ├── README.md
│ │ │ ├── tagcn.py
│ │ │ └── train.py
│ │ └── tree_lstm/
│ │ ├── README.md
│ │ ├── train.py
│ │ └── tree_lstm.py
│ ├── pytorch/
│ │ ├── GATNE-T/
│ │ │ ├── README.md
│ │ │ ├── requirements.txt
│ │ │ ├── scripts/
│ │ │ │ ├── run_example.sh
│ │ │ │ ├── run_example_sparse.sh
│ │ │ │ └── run_example_sparse_multi_gpus.sh
│ │ │ └── src/
│ │ │ ├── main.py
│ │ │ ├── main_sparse.py
│ │ │ ├── main_sparse_multi_gpus.py
│ │ │ └── utils.py
│ │ ├── GNN-FiLM/
│ │ │ ├── README.md
│ │ │ ├── data_loader.py
│ │ │ ├── main.py
│ │ │ └── utils.py
│ │ ├── NGCF/
│ │ │ ├── Data/
│ │ │ │ ├── load_amazon-book.sh
│ │ │ │ └── load_gowalla.sh
│ │ │ ├── NGCF/
│ │ │ │ ├── main.py
│ │ │ │ ├── model.py
│ │ │ │ └── utility/
│ │ │ │ ├── batch_test.py
│ │ │ │ ├── helper.py
│ │ │ │ ├── load_data.py
│ │ │ │ ├── metrics.py
│ │ │ │ └── parser.py
│ │ │ └── README.md
│ │ ├── P-GNN/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ └── utils.py
│ │ ├── TAHIN/
│ │ │ ├── TAHIN.py
│ │ │ ├── data_loader.py
│ │ │ ├── main.py
│ │ │ ├── readme.md
│ │ │ └── utils.py
│ │ ├── appnp/
│ │ │ ├── README.md
│ │ │ ├── appnp.py
│ │ │ └── train.py
│ │ ├── argo/
│ │ │ ├── README.md
│ │ │ ├── argo.py
│ │ │ ├── main.py
│ │ │ ├── ogb_example.py
│ │ │ └── ogb_example_ARGO.py
│ │ ├── arma/
│ │ │ ├── README.md
│ │ │ ├── citation.py
│ │ │ └── model.py
│ │ ├── bgnn/
│ │ │ ├── BGNN.py
│ │ │ ├── Readme.md
│ │ │ └── run.py
│ │ ├── bgrl/
│ │ │ ├── README.md
│ │ │ ├── eval_function.py
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ └── utils.py
│ │ ├── capsule/
│ │ │ ├── DGLDigitCapsule.py
│ │ │ ├── DGLRoutingLayer.py
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ └── simple_routing.py
│ │ ├── caregnn/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ ├── main_sampling.py
│ │ │ ├── model.py
│ │ │ ├── model_sampling.py
│ │ │ └── utils.py
│ │ ├── cluster_gcn/
│ │ │ ├── README.md
│ │ │ └── cluster_gcn.py
│ │ ├── compGCN/
│ │ │ ├── README.md
│ │ │ ├── data_loader.py
│ │ │ ├── get_fb15k-237.sh
│ │ │ ├── get_wn18rr.sh
│ │ │ ├── main.py
│ │ │ ├── models.py
│ │ │ └── utils.py
│ │ ├── correct_and_smooth/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ └── model.py
│ │ ├── dagnn/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ └── utils.py
│ │ ├── deepergcn/
│ │ │ ├── README.md
│ │ │ ├── layers.py
│ │ │ ├── main.py
│ │ │ ├── models.py
│ │ │ └── modules.py
│ │ ├── deepwalk/
│ │ │ └── README.md
│ │ ├── dgi/
│ │ │ ├── README.md
│ │ │ ├── dgi.py
│ │ │ ├── gcn.py
│ │ │ └── train.py
│ │ ├── dgmg/
│ │ │ ├── README.md
│ │ │ ├── configure.py
│ │ │ ├── cycles.py
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ └── utils.py
│ │ ├── diffpool/
│ │ │ ├── README.md
│ │ │ ├── data_utils.py
│ │ │ ├── model/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── dgl_layers/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── aggregator.py
│ │ │ │ │ ├── bundler.py
│ │ │ │ │ └── gnn.py
│ │ │ │ ├── encoder.py
│ │ │ │ ├── loss.py
│ │ │ │ ├── model_utils.py
│ │ │ │ └── tensorized_layers/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── assignment.py
│ │ │ │ ├── diffpool.py
│ │ │ │ └── graphsage.py
│ │ │ └── train.py
│ │ ├── dimenet/
│ │ │ ├── README.md
│ │ │ ├── config/
│ │ │ │ ├── convert.yaml
│ │ │ │ ├── dimenet.yaml
│ │ │ │ └── dimenet_pp.yaml
│ │ │ ├── convert_tf_ckpt_to_pytorch.py
│ │ │ ├── main.py
│ │ │ ├── modules/
│ │ │ │ ├── activations.py
│ │ │ │ ├── basis_utils.py
│ │ │ │ ├── bessel_basis_layer.py
│ │ │ │ ├── dimenet.py
│ │ │ │ ├── dimenet_pp.py
│ │ │ │ ├── embedding_block.py
│ │ │ │ ├── envelope.py
│ │ │ │ ├── initializers.py
│ │ │ │ ├── interaction_block.py
│ │ │ │ ├── interaction_pp_block.py
│ │ │ │ ├── output_block.py
│ │ │ │ ├── output_pp_block.py
│ │ │ │ ├── residual_layer.py
│ │ │ │ └── spherical_basis_layer.py
│ │ │ └── qm9.py
│ │ ├── dtgrnn/
│ │ │ ├── README.md
│ │ │ ├── dataloading.py
│ │ │ ├── dcrnn.py
│ │ │ ├── gaan.py
│ │ │ ├── model.py
│ │ │ ├── train.py
│ │ │ └── utils.py
│ │ ├── eeg-gcnn/
│ │ │ ├── EEGGraphDataset.py
│ │ │ ├── README.md
│ │ │ ├── deep_EEGGraphConvNet.py
│ │ │ ├── main.py
│ │ │ └── shallow_EEGGraphConvNet.py
│ │ ├── eges/
│ │ │ ├── .gitignore
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ ├── sampler.py
│ │ │ └── utils.py
│ │ ├── evolveGCN/
│ │ │ ├── README.md
│ │ │ ├── dataset.py
│ │ │ ├── model.py
│ │ │ ├── train.py
│ │ │ └── utils.py
│ │ ├── gas/
│ │ │ ├── README.md
│ │ │ ├── dataloader.py
│ │ │ ├── main.py
│ │ │ ├── main_sampling.py
│ │ │ ├── model.py
│ │ │ └── model_sampling.py
│ │ ├── gat/
│ │ │ ├── README.md
│ │ │ ├── train.py
│ │ │ └── train_ppi.py
│ │ ├── gatv2/
│ │ │ ├── README.md
│ │ │ ├── gatv2.py
│ │ │ └── train.py
│ │ ├── gcmc/
│ │ │ ├── README.md
│ │ │ ├── data.py
│ │ │ ├── model.py
│ │ │ ├── train.py
│ │ │ ├── train_sampling.py
│ │ │ └── utils.py
│ │ ├── gcn/
│ │ │ ├── README.md
│ │ │ └── train.py
│ │ ├── geniepath/
│ │ │ ├── README.md
│ │ │ ├── model.py
│ │ │ ├── ppi.py
│ │ │ └── pubmed.py
│ │ ├── ggnn/
│ │ │ ├── README.md
│ │ │ ├── data_utils.py
│ │ │ ├── ggnn_gc.py
│ │ │ ├── ggnn_ns.py
│ │ │ ├── ggsnn.py
│ │ │ ├── train_gc.py
│ │ │ ├── train_ns.py
│ │ │ └── train_path_finding.py
│ │ ├── gin/
│ │ │ ├── README.md
│ │ │ └── train.py
│ │ ├── gnn_explainer/
│ │ │ ├── README.md
│ │ │ ├── explain_main.py
│ │ │ ├── gnn_subgraph/
│ │ │ │ ├── 1/
│ │ │ │ │ ├── graph.json
│ │ │ │ │ ├── model_list.json
│ │ │ │ │ ├── subgraph_1.json
│ │ │ │ │ └── subgraph_list.json
│ │ │ │ └── dataset_list.json
│ │ │ ├── models.py
│ │ │ └── train_main.py
│ │ ├── grace/
│ │ │ ├── README.md
│ │ │ ├── aug.py
│ │ │ ├── dataset.py
│ │ │ ├── eval.py
│ │ │ ├── main.py
│ │ │ └── model.py
│ │ ├── grand/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ └── model.py
│ │ ├── graph_matching/
│ │ │ ├── README.md
│ │ │ ├── examples.py
│ │ │ └── ged.py
│ │ ├── graphsage/
│ │ │ ├── README.md
│ │ │ ├── advanced/
│ │ │ │ ├── README.md
│ │ │ │ ├── model.py
│ │ │ │ ├── negative_sampler.py
│ │ │ │ └── train_lightning_unsupervised.py
│ │ │ ├── lightning/
│ │ │ │ └── node_classification.py
│ │ │ ├── link_pred.py
│ │ │ ├── load_graph.py
│ │ │ ├── node_classification.py
│ │ │ └── train_full.py
│ │ ├── graphsaint/
│ │ │ ├── README.md
│ │ │ ├── config.py
│ │ │ ├── modules.py
│ │ │ ├── sampler.py
│ │ │ ├── train_sampling.py
│ │ │ └── utils.py
│ │ ├── graphsim/
│ │ │ ├── README.md
│ │ │ ├── dataloader.py
│ │ │ ├── models.py
│ │ │ ├── n_body_sim.py
│ │ │ ├── train.py
│ │ │ └── utils.py
│ │ ├── graphwriter/
│ │ │ ├── README.md
│ │ │ ├── graphwriter.py
│ │ │ ├── modules.py
│ │ │ ├── opts.py
│ │ │ ├── prepare_data.sh
│ │ │ ├── run.sh
│ │ │ ├── test.sh
│ │ │ ├── train.py
│ │ │ └── utlis.py
│ │ ├── gxn/
│ │ │ ├── README.md
│ │ │ ├── data_preprocess.py
│ │ │ ├── layers.py
│ │ │ ├── main.py
│ │ │ ├── main_early_stop.py
│ │ │ ├── networks.py
│ │ │ ├── scripts/
│ │ │ │ ├── run_gxn.sh
│ │ │ │ └── run_gxn_early_stop.sh
│ │ │ └── utils.py
│ │ ├── han/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ ├── model_hetero.py
│ │ │ ├── train_sampling.py
│ │ │ └── utils.py
│ │ ├── hardgat/
│ │ │ ├── README.md
│ │ │ ├── hgao.py
│ │ │ ├── train.py
│ │ │ └── utils.py
│ │ ├── hgp_sl/
│ │ │ ├── README.md
│ │ │ ├── functions.py
│ │ │ ├── layers.py
│ │ │ ├── main.py
│ │ │ ├── networks.py
│ │ │ └── utils.py
│ │ ├── hgt/
│ │ │ ├── README.md
│ │ │ ├── model.py
│ │ │ └── train_acm.py
│ │ ├── hilander/
│ │ │ ├── PSS/
│ │ │ │ ├── README.md
│ │ │ │ ├── Smooth_AP/
│ │ │ │ │ ├── README.md
│ │ │ │ │ └── src/
│ │ │ │ │ ├── auxiliaries.py
│ │ │ │ │ ├── datasets.py
│ │ │ │ │ ├── evaluate.py
│ │ │ │ │ ├── evaluate_model.py
│ │ │ │ │ ├── finetune_1head.py
│ │ │ │ │ ├── get_features.py
│ │ │ │ │ ├── losses.py
│ │ │ │ │ ├── main.py
│ │ │ │ │ └── netlib.py
│ │ │ │ ├── __init__.py
│ │ │ │ ├── test.sh
│ │ │ │ ├── test_subg_inat.py
│ │ │ │ ├── train.sh
│ │ │ │ └── train_subg_inat.py
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── checkpoint/
│ │ │ │ └── .gitkeep
│ │ │ ├── data/
│ │ │ │ └── .gitkeep
│ │ │ ├── models/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── focal_loss.py
│ │ │ │ ├── graphconv.py
│ │ │ │ └── lander.py
│ │ │ ├── scripts/
│ │ │ │ ├── test_deepglint_hannah.sh
│ │ │ │ ├── test_deepglint_imdb.sh
│ │ │ │ ├── test_deepglint_imdb_sampled_as_deepglint.sh
│ │ │ │ ├── test_inat.sh
│ │ │ │ ├── test_inat_train_on_resampled_1_in_6_per_class.sh
│ │ │ │ ├── train_deepglint.sh
│ │ │ │ ├── train_inat.sh
│ │ │ │ └── train_inat_resampled_1_in_6_per_class.sh
│ │ │ ├── test.py
│ │ │ ├── test_subg.py
│ │ │ ├── train.py
│ │ │ ├── train_subg.py
│ │ │ └── utils/
│ │ │ ├── __init__.py
│ │ │ ├── adjacency.py
│ │ │ ├── deduce.py
│ │ │ ├── density.py
│ │ │ ├── evaluate.py
│ │ │ ├── faiss_gpu.py
│ │ │ ├── faiss_search.py
│ │ │ ├── knn.py
│ │ │ ├── metrics.py
│ │ │ └── misc.py
│ │ ├── infograph/
│ │ │ ├── README.md
│ │ │ ├── evaluate_embedding.py
│ │ │ ├── model.py
│ │ │ ├── semisupervised.py
│ │ │ ├── unsupervised.py
│ │ │ └── utils.py
│ │ ├── jknet/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ └── model.py
│ │ ├── jtnn/
│ │ │ ├── README.md
│ │ │ ├── jtnn/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── chemutils.py
│ │ │ │ ├── datautils.py
│ │ │ │ ├── jtmpn.py
│ │ │ │ ├── jtnn_dec.py
│ │ │ │ ├── jtnn_enc.py
│ │ │ │ ├── jtnn_vae.py
│ │ │ │ ├── line_profiler_integration.py
│ │ │ │ ├── mol_tree.py
│ │ │ │ ├── mol_tree_nx.py
│ │ │ │ ├── mpn.py
│ │ │ │ └── nnutils.py
│ │ │ └── vaetrain_dgl.py
│ │ ├── label_propagation/
│ │ │ ├── README.md
│ │ │ └── main.py
│ │ ├── labor/
│ │ │ ├── README.md
│ │ │ ├── ladies_sampler.py
│ │ │ ├── load_graph.py
│ │ │ ├── model.py
│ │ │ └── train_lightning.py
│ │ ├── lda/
│ │ │ ├── README.md
│ │ │ ├── example_20newsgroups.py
│ │ │ └── lda_model.py
│ │ ├── line_graph/
│ │ │ ├── README.md
│ │ │ ├── gnn.py
│ │ │ └── train.py
│ │ ├── metapath2vec/
│ │ │ ├── README.md
│ │ │ ├── download.py
│ │ │ ├── metapath2vec.py
│ │ │ ├── model.py
│ │ │ ├── reading_data.py
│ │ │ ├── sampler.py
│ │ │ └── test.py
│ │ ├── mixhop/
│ │ │ ├── README.md
│ │ │ └── main.py
│ │ ├── model_zoo/
│ │ │ ├── README.md
│ │ │ ├── citation_network/
│ │ │ │ ├── README.md
│ │ │ │ ├── conf.py
│ │ │ │ ├── models.py
│ │ │ │ └── run.py
│ │ │ └── geometric/
│ │ │ ├── .gitignore
│ │ │ ├── README.md
│ │ │ ├── coarsening.py
│ │ │ ├── coordinate.py
│ │ │ ├── grid_graph.py
│ │ │ └── mnist.py
│ │ ├── monet/
│ │ │ ├── README.md
│ │ │ └── citation.py
│ │ ├── multigpu/
│ │ │ ├── README.md
│ │ │ ├── multi_gpu_graph_prediction.py
│ │ │ ├── multi_gpu_link_prediction.py
│ │ │ └── multi_gpu_node_classification.py
│ │ ├── mvgrl/
│ │ │ ├── README.md
│ │ │ ├── graph/
│ │ │ │ ├── dataset.py
│ │ │ │ ├── main.py
│ │ │ │ ├── model.py
│ │ │ │ └── utils.py
│ │ │ └── node/
│ │ │ ├── dataset.py
│ │ │ ├── main.py
│ │ │ ├── main_sample.py
│ │ │ └── model.py
│ │ ├── node2vec/
│ │ │ ├── README.md
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ └── utils.py
│ │ ├── ogb/
│ │ │ ├── README.md
│ │ │ ├── cluster-gat/
│ │ │ │ ├── README.md
│ │ │ │ ├── main.py
│ │ │ │ ├── partition_utils.py
│ │ │ │ └── sampler.py
│ │ │ ├── cluster-sage/
│ │ │ │ ├── README.md
│ │ │ │ ├── main.py
│ │ │ │ ├── partition_utils.py
│ │ │ │ └── sampler.py
│ │ │ ├── deepwalk/
│ │ │ │ ├── README.md
│ │ │ │ ├── deepwalk.py
│ │ │ │ ├── load_dataset.py
│ │ │ │ ├── model.py
│ │ │ │ ├── reading_data.py
│ │ │ │ └── utils.py
│ │ │ ├── directional_GSN/
│ │ │ │ ├── README.md
│ │ │ │ ├── main.py
│ │ │ │ └── preprocessing.py
│ │ │ ├── line/
│ │ │ │ ├── README.md
│ │ │ │ ├── line.py
│ │ │ │ ├── load_dataset.py
│ │ │ │ ├── model.py
│ │ │ │ ├── reading_data.py
│ │ │ │ └── utils.py
│ │ │ ├── ngnn/
│ │ │ │ ├── README.md
│ │ │ │ └── main.py
│ │ │ ├── ngnn_seal/
│ │ │ │ ├── README.md
│ │ │ │ ├── main.py
│ │ │ │ ├── models.py
│ │ │ │ └── utils.py
│ │ │ ├── ogbn-arxiv/
│ │ │ │ ├── README.md
│ │ │ │ ├── correct_and_smooth.py
│ │ │ │ ├── gat.py
│ │ │ │ ├── gcn.py
│ │ │ │ └── models.py
│ │ │ ├── ogbn-mag/
│ │ │ │ ├── README.md
│ │ │ │ └── hetero_rgcn.py
│ │ │ ├── ogbn-products/
│ │ │ │ ├── gat/
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── gat.py
│ │ │ │ │ ├── main.py
│ │ │ │ │ └── models.py
│ │ │ │ ├── graphsage/
│ │ │ │ │ ├── README.md
│ │ │ │ │ └── main.py
│ │ │ │ └── mlp/
│ │ │ │ ├── README.md
│ │ │ │ ├── mlp.py
│ │ │ │ └── models.py
│ │ │ ├── ogbn-proteins/
│ │ │ │ ├── README.md
│ │ │ │ ├── configure.py
│ │ │ │ ├── gat.py
│ │ │ │ ├── main_proteins_full_dgl.py
│ │ │ │ ├── models.py
│ │ │ │ └── utils.py
│ │ │ ├── seal_ogbl/
│ │ │ │ ├── README.md
│ │ │ │ └── main.py
│ │ │ └── sign/
│ │ │ ├── .gitignore
│ │ │ ├── README.md
│ │ │ ├── dataset.py
│ │ │ └── sign.py
│ │ ├── ogb_lsc/
│ │ │ ├── MAG240M/
│ │ │ │ ├── README.md
│ │ │ │ ├── preprocess.py
│ │ │ │ ├── train.py
│ │ │ │ └── train_multi_gpus.py
│ │ │ ├── PCQM4M/
│ │ │ │ ├── README.md
│ │ │ │ ├── conv.py
│ │ │ │ ├── gnn.py
│ │ │ │ ├── main.py
│ │ │ │ └── test_inference.py
│ │ │ └── README.md
│ │ ├── ogc/
│ │ │ ├── README.md
│ │ │ ├── ogc.py
│ │ │ ├── train.py
│ │ │ └── utils.py
│ │ ├── pagerank.py
│ │ ├── pinsage/
│ │ │ ├── README.md
│ │ │ ├── builder.py
│ │ │ ├── data_utils.py
│ │ │ ├── evaluation.py
│ │ │ ├── layers.py
│ │ │ ├── model.py
│ │ │ ├── model_sparse.py
│ │ │ ├── process_movielens1m.py
│ │ │ ├── process_nowplaying_rs.py
│ │ │ └── sampler.py
│ │ ├── pointcloud/
│ │ │ ├── bipointnet/
│ │ │ │ ├── ModelNetDataLoader.py
│ │ │ │ ├── README.md
│ │ │ │ ├── basic.py
│ │ │ │ ├── bipointnet2.py
│ │ │ │ ├── bipointnet_cls.py
│ │ │ │ └── train_cls.py
│ │ │ ├── edgeconv/
│ │ │ │ ├── README.md
│ │ │ │ ├── main.py
│ │ │ │ ├── model.py
│ │ │ │ └── modelnet.py
│ │ │ ├── pct/
│ │ │ │ ├── ModelNetDataLoader.py
│ │ │ │ ├── README.md
│ │ │ │ ├── ShapeNet.py
│ │ │ │ ├── helper.py
│ │ │ │ ├── pct.py
│ │ │ │ ├── provider.py
│ │ │ │ ├── train_cls.py
│ │ │ │ └── train_partseg.py
│ │ │ ├── point_transformer/
│ │ │ │ ├── ModelNetDataLoader.py
│ │ │ │ ├── README.md
│ │ │ │ ├── ShapeNet.py
│ │ │ │ ├── helper.py
│ │ │ │ ├── point_transformer.py
│ │ │ │ ├── provider.py
│ │ │ │ ├── train_cls.py
│ │ │ │ └── train_partseg.py
│ │ │ └── pointnet/
│ │ │ ├── ModelNetDataLoader.py
│ │ │ ├── README.md
│ │ │ ├── ShapeNet.py
│ │ │ ├── pointnet2.py
│ │ │ ├── pointnet2_partseg.py
│ │ │ ├── pointnet_cls.py
│ │ │ ├── pointnet_partseg.py
│ │ │ ├── provider.py
│ │ │ ├── train_cls.py
│ │ │ └── train_partseg.py
│ │ ├── rect/
│ │ │ ├── README.md
│ │ │ ├── classify.py
│ │ │ ├── label_utils.py
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ └── utils.py
│ │ ├── rgat/
│ │ │ ├── README.md
│ │ │ └── train.py
│ │ ├── rgcn/
│ │ │ ├── README.md
│ │ │ ├── entity.py
│ │ │ ├── entity_sample.py
│ │ │ ├── entity_sample_multi_gpu.py
│ │ │ ├── entity_utils.py
│ │ │ ├── experimental/
│ │ │ │ ├── README.md
│ │ │ │ ├── entity_classify_dist.py
│ │ │ │ ├── get_mag_data.py
│ │ │ │ ├── partition_graph.py
│ │ │ │ ├── preprocessing_dist_training/
│ │ │ │ │ ├── edges/
│ │ │ │ │ │ ├── identity1/
│ │ │ │ │ │ │ └── sample.csv
│ │ │ │ │ │ ├── identity2/
│ │ │ │ │ │ │ └── sample.csv
│ │ │ │ │ │ └── identity3/
│ │ │ │ │ │ └── sample.csv
│ │ │ │ │ ├── metis_creation.py
│ │ │ │ │ ├── nodes/
│ │ │ │ │ │ └── order/
│ │ │ │ │ │ └── sample.csv
│ │ │ │ │ └── pre_process_dist_training.sh
│ │ │ │ ├── verify_mag_partitions.py
│ │ │ │ └── write_mag.py
│ │ │ ├── link.py
│ │ │ └── model.py
│ │ ├── rgcn-hetero/
│ │ │ ├── .gitignore
│ │ │ ├── README.md
│ │ │ ├── entity_classify.py
│ │ │ ├── entity_classify_heteroAPI.py
│ │ │ ├── entity_classify_mb.py
│ │ │ ├── model.py
│ │ │ └── test_classify.py
│ │ ├── rrn/
│ │ │ ├── README.md
│ │ │ ├── ckpt/
│ │ │ │ └── rrn-sudoku.pkl
│ │ │ ├── rrn.py
│ │ │ ├── sudoku.py
│ │ │ ├── sudoku_data.py
│ │ │ ├── sudoku_solver.py
│ │ │ └── train_sudoku.py
│ │ ├── sagpool/
│ │ │ ├── README.md
│ │ │ ├── grid_search.py
│ │ │ ├── grid_search_config.json
│ │ │ ├── layer.py
│ │ │ ├── main.py
│ │ │ ├── network.py
│ │ │ └── utils.py
│ │ ├── seal/
│ │ │ ├── README.md
│ │ │ ├── logger.py
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ ├── sampler.py
│ │ │ └── utils.py
│ │ ├── sgc/
│ │ │ ├── README.md
│ │ │ ├── sgc.py
│ │ │ └── sgc_reddit.py
│ │ ├── sign/
│ │ │ ├── README.md
│ │ │ ├── dataset.py
│ │ │ └── sign.py
│ │ ├── stgcn_wave/
│ │ │ ├── README.md
│ │ │ ├── load_data.py
│ │ │ ├── main.py
│ │ │ ├── model.py
│ │ │ ├── sensors2graph.py
│ │ │ └── utils.py
│ │ ├── tagcn/
│ │ │ ├── README.md
│ │ │ ├── tagcn.py
│ │ │ └── train.py
│ │ ├── tgn/
│ │ │ └── README.md
│ │ ├── tree_lstm/
│ │ │ ├── README.md
│ │ │ ├── train.py
│ │ │ └── tree_lstm.py
│ │ ├── vgae/
│ │ │ ├── README.md
│ │ │ ├── input_data.py
│ │ │ ├── model.py
│ │ │ ├── preprocess.py
│ │ │ └── train.py
│ │ └── vrgcn/
│ │ ├── README.md
│ │ ├── train_cv.py
│ │ └── train_cv_multi_gpu.py
│ ├── sparse/
│ │ ├── appnp.py
│ │ ├── c_and_s.py
│ │ ├── gat.py
│ │ ├── gcn.py
│ │ ├── gcnii.py
│ │ ├── graph_transformer.py
│ │ ├── han.py
│ │ ├── hetero-rgcn.py
│ │ ├── hgnn.py
│ │ ├── hypergraphatt.py
│ │ ├── pagerank.py
│ │ ├── sampling/
│ │ │ ├── graphsage.py
│ │ │ └── ladies.py
│ │ ├── sgc.py
│ │ ├── sign.py
│ │ └── twirls.py
│ └── tensorflow/
│ ├── dgi/
│ │ ├── README.md
│ │ ├── dgi.py
│ │ ├── gcn.py
│ │ └── train.py
│ ├── gat/
│ │ ├── README.md
│ │ ├── gat.py
│ │ ├── train.py
│ │ └── utils.py
│ ├── gcn/
│ │ ├── README.md
│ │ ├── gcn.py
│ │ ├── gcn_builtin.py
│ │ ├── gcn_mp.py
│ │ └── train.py
│ ├── rgcn/
│ │ ├── README.md
│ │ ├── entity_classify.py
│ │ ├── model.py
│ │ └── utils.py
│ └── sgc/
│ ├── README.md
│ └── sgc.py
├── graphbolt/
│ ├── CMakeLists.txt
│ ├── build.bat
│ ├── build.sh
│ ├── find_cmake.py
│ ├── include/
│ │ └── graphbolt/
│ │ ├── async.h
│ │ ├── continuous_seed.h
│ │ ├── cuda_ops.h
│ │ ├── cuda_sampling_ops.h
│ │ ├── fused_csc_sampling_graph.h
│ │ ├── fused_sampled_subgraph.h
│ │ ├── isin.h
│ │ ├── serialize.h
│ │ ├── shared_memory.h
│ │ └── unique_and_compact.h
│ └── src/
│ ├── cache_policy.cc
│ ├── cache_policy.h
│ ├── circular_queue.h
│ ├── cnumpy.cc
│ ├── cnumpy.h
│ ├── concurrent_id_hash_map.cc
│ ├── concurrent_id_hash_map.h
│ ├── cuda/
│ │ ├── common.h
│ │ ├── cooperative_minibatching_utils.cu
│ │ ├── cooperative_minibatching_utils.cuh
│ │ ├── cooperative_minibatching_utils.h
│ │ ├── cumsum.cu
│ │ ├── expand_indptr.cu
│ │ ├── extension/
│ │ │ ├── gpu_cache.cu
│ │ │ ├── gpu_cache.h
│ │ │ ├── gpu_graph_cache.cu
│ │ │ ├── gpu_graph_cache.h
│ │ │ ├── unique_and_compact.h
│ │ │ └── unique_and_compact_map.cu
│ │ ├── gather.cu
│ │ ├── index_select_csc_impl.cu
│ │ ├── index_select_impl.cu
│ │ ├── insubgraph.cu
│ │ ├── isin.cu
│ │ ├── max_uva_threads.cc
│ │ ├── max_uva_threads.h
│ │ ├── neighbor_sampler.cu
│ │ ├── sampling_utils.cu
│ │ ├── sort_impl.cu
│ │ ├── unique_and_compact_impl.cu
│ │ └── utils.h
│ ├── expand_indptr.cc
│ ├── expand_indptr.h
│ ├── feature_cache.cc
│ ├── feature_cache.h
│ ├── fused_csc_sampling_graph.cc
│ ├── index_select.cc
│ ├── index_select.h
│ ├── io_uring.cc
│ ├── io_uring.h
│ ├── isin.cc
│ ├── macro.h
│ ├── partitioned_cache_policy.cc
│ ├── partitioned_cache_policy.h
│ ├── python_binding.cc
│ ├── random.cc
│ ├── random.h
│ ├── serialize.cc
│ ├── shared_memory.cc
│ ├── shared_memory_helper.cc
│ ├── shared_memory_helper.h
│ ├── unique_and_compact.cc
│ ├── utils.cc
│ └── utils.h
├── include/
│ └── dgl/
│ ├── array.h
│ ├── array_iterator.h
│ ├── aten/
│ │ ├── array_ops.h
│ │ ├── coo.h
│ │ ├── csr.h
│ │ ├── macro.h
│ │ ├── spmat.h
│ │ └── types.h
│ ├── base_heterograph.h
│ ├── bcast.h
│ ├── env_variable.h
│ ├── graph.h
│ ├── graph_interface.h
│ ├── graph_op.h
│ ├── graph_serializer.h
│ ├── graph_traversal.h
│ ├── immutable_graph.h
│ ├── kernel.h
│ ├── lazy.h
│ ├── nodeflow.h
│ ├── packed_func_ext.h
│ ├── random.h
│ ├── runtime/
│ │ ├── bfloat16.h
│ │ ├── c_backend_api.h
│ │ ├── c_object_api.h
│ │ ├── c_runtime_api.h
│ │ ├── config.h
│ │ ├── container.h
│ │ ├── device_api.h
│ │ ├── dlpack_convert.h
│ │ ├── module.h
│ │ ├── ndarray.h
│ │ ├── object.h
│ │ ├── packed_func.h
│ │ ├── parallel_for.h
│ │ ├── registry.h
│ │ ├── serializer.h
│ │ ├── shared_mem.h
│ │ ├── smart_ptr_serializer.h
│ │ ├── tensordispatch.h
│ │ ├── threading_backend.h
│ │ └── util.h
│ ├── sampler.h
│ ├── sampling/
│ │ ├── negative.h
│ │ ├── neighbor.h
│ │ └── randomwalks.h
│ ├── scheduler.h
│ ├── transform.h
│ └── zerocopy_serializer.h
├── notebooks/
│ ├── graphbolt/
│ │ └── walkthrough.ipynb
│ ├── sparse/
│ │ ├── gcn.ipynb
│ │ ├── graph_diffusion.ipynb
│ │ ├── graph_transformer.ipynb
│ │ ├── hgnn.ipynb
│ │ └── quickstart.ipynb
│ └── stochastic_training/
│ ├── link_prediction.ipynb
│ ├── multigpu_node_classification.ipynb
│ ├── neighbor_sampling_overview.ipynb
│ ├── node_classification.ipynb
│ ├── ondisk_dataset_heterograph.ipynb
│ └── ondisk_dataset_homograph.ipynb
├── pyproject.toml
├── python/
│ ├── dgl/
│ │ ├── __init__.py
│ │ ├── _api_internal.py
│ │ ├── _ffi/
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── _ctypes/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── function.py
│ │ │ │ ├── ndarray.py
│ │ │ │ ├── object.py
│ │ │ │ └── types.py
│ │ │ ├── _cy2/
│ │ │ │ └── __init__.py
│ │ │ ├── _cy3/
│ │ │ │ └── __init__.py
│ │ │ ├── _cython/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── base.pxi
│ │ │ │ ├── core.pyx
│ │ │ │ ├── function.pxi
│ │ │ │ ├── ndarray.pxi
│ │ │ │ └── object.pxi
│ │ │ ├── base.py
│ │ │ ├── capi.py
│ │ │ ├── function.py
│ │ │ ├── libinfo.py
│ │ │ ├── ndarray.py
│ │ │ ├── object.py
│ │ │ ├── object_generic.py
│ │ │ ├── runtime_ctypes.py
│ │ │ └── streams.py
│ │ ├── _sparse_ops.py
│ │ ├── backend/
│ │ │ ├── __init__.py
│ │ │ ├── backend.py
│ │ │ ├── mxnet/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── sparse.py
│ │ │ │ ├── sparse_optim.py
│ │ │ │ └── tensor.py
│ │ │ ├── pytorch/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── sparse.py
│ │ │ │ └── tensor.py
│ │ │ ├── set_default_backend.py
│ │ │ └── tensorflow/
│ │ │ ├── __init__.py
│ │ │ ├── sparse.py
│ │ │ ├── sparse_optim.py
│ │ │ └── tensor.py
│ │ ├── base.py
│ │ ├── batch.py
│ │ ├── container.py
│ │ ├── convert.py
│ │ ├── core.py
│ │ ├── cuda/
│ │ │ ├── __init__.py
│ │ │ ├── gpu_cache.py
│ │ │ └── nccl.py
│ │ ├── data/
│ │ │ ├── __init__.py
│ │ │ ├── actor.py
│ │ │ ├── adapter.py
│ │ │ ├── bitcoinotc.py
│ │ │ ├── citation_graph.py
│ │ │ ├── cluster.py
│ │ │ ├── csv_dataset.py
│ │ │ ├── csv_dataset_base.py
│ │ │ ├── dgl_dataset.py
│ │ │ ├── fakenews.py
│ │ │ ├── flickr.py
│ │ │ ├── fraud.py
│ │ │ ├── gdelt.py
│ │ │ ├── geom_gcn.py
│ │ │ ├── gindt.py
│ │ │ ├── gnn_benchmark.py
│ │ │ ├── graph_serialize.py
│ │ │ ├── heterograph_serialize.py
│ │ │ ├── heterophilous_graphs.py
│ │ │ ├── icews18.py
│ │ │ ├── karate.py
│ │ │ ├── knowledge_graph.py
│ │ │ ├── lrgb.py
│ │ │ ├── minigc.py
│ │ │ ├── movielens.py
│ │ │ ├── pattern.py
│ │ │ ├── ppi.py
│ │ │ ├── qm7b.py
│ │ │ ├── qm9.py
│ │ │ ├── qm9_edge.py
│ │ │ ├── rdf.py
│ │ │ ├── reddit.py
│ │ │ ├── sbm.py
│ │ │ ├── superpixel.py
│ │ │ ├── synthetic.py
│ │ │ ├── tensor_serialize.py
│ │ │ ├── tree.py
│ │ │ ├── tu.py
│ │ │ ├── utils.py
│ │ │ ├── wikics.py
│ │ │ ├── yelp.py
│ │ │ └── zinc.py
│ │ ├── dataloading/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── capped_neighbor_sampler.py
│ │ │ ├── cluster_gcn.py
│ │ │ ├── dataloader.py
│ │ │ ├── graphsaint.py
│ │ │ ├── labor_sampler.py
│ │ │ ├── negative_sampler.py
│ │ │ ├── neighbor_sampler.py
│ │ │ ├── shadow.py
│ │ │ └── spot_target.py
│ │ ├── distgnn/
│ │ │ ├── __init__.py
│ │ │ ├── partition/
│ │ │ │ ├── __init__.py
│ │ │ │ └── libra_partition.py
│ │ │ └── tools/
│ │ │ ├── __init__.py
│ │ │ └── tools.py
│ │ ├── distributed/
│ │ │ ├── __init__.py
│ │ │ ├── constants.py
│ │ │ ├── dist_context.py
│ │ │ ├── dist_dataloader.py
│ │ │ ├── dist_graph.py
│ │ │ ├── dist_tensor.py
│ │ │ ├── graph_partition_book.py
│ │ │ ├── graph_services.py
│ │ │ ├── id_map.py
│ │ │ ├── kvstore.py
│ │ │ ├── nn/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── mxnet/
│ │ │ │ │ └── __init__.py
│ │ │ │ ├── pytorch/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── sparse_emb.py
│ │ │ │ └── tensorflow/
│ │ │ │ └── __init__.py
│ │ │ ├── optim/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── mxnet/
│ │ │ │ │ └── __init__.py
│ │ │ │ ├── pytorch/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── sparse_optim.py
│ │ │ │ │ └── utils.py
│ │ │ │ └── tensorflow/
│ │ │ │ └── __init__.py
│ │ │ ├── partition.py
│ │ │ ├── role.py
│ │ │ ├── rpc.py
│ │ │ ├── rpc_client.py
│ │ │ ├── rpc_server.py
│ │ │ ├── server_state.py
│ │ │ ├── shared_mem_utils.py
│ │ │ └── standalone_kvstore.py
│ │ ├── frame.py
│ │ ├── function/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── message.py
│ │ │ └── reducer.py
│ │ ├── generators.py
│ │ ├── geometry/
│ │ │ ├── __init__.py
│ │ │ ├── capi.py
│ │ │ ├── edge_coarsening.py
│ │ │ └── fps.py
│ │ ├── global_config.py
│ │ ├── graph_index.py
│ │ ├── graphbolt/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── dataloader.py
│ │ │ ├── datapipes/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── utils.py
│ │ │ │ └── visualization.py
│ │ │ ├── dataset.py
│ │ │ ├── external_utils.py
│ │ │ ├── feature_fetcher.py
│ │ │ ├── feature_store.py
│ │ │ ├── impl/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── basic_feature_store.py
│ │ │ │ ├── cooperative_conv.py
│ │ │ │ ├── cpu_cached_feature.py
│ │ │ │ ├── cpu_feature_cache.py
│ │ │ │ ├── fused_csc_sampling_graph.py
│ │ │ │ ├── gpu_cached_feature.py
│ │ │ │ ├── gpu_feature_cache.py
│ │ │ │ ├── gpu_graph_cache.py
│ │ │ │ ├── in_subgraph_sampler.py
│ │ │ │ ├── legacy_dataset.py
│ │ │ │ ├── neighbor_sampler.py
│ │ │ │ ├── ondisk_dataset.py
│ │ │ │ ├── ondisk_metadata.py
│ │ │ │ ├── sampled_subgraph_impl.py
│ │ │ │ ├── temporal_neighbor_sampler.py
│ │ │ │ ├── torch_based_feature_store.py
│ │ │ │ └── uniform_negative_sampler.py
│ │ │ ├── internal/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── item_sampler_utils.py
│ │ │ │ ├── sample_utils.py
│ │ │ │ └── utils.py
│ │ │ ├── internal_utils.py
│ │ │ ├── item_sampler.py
│ │ │ ├── itemset.py
│ │ │ ├── minibatch.py
│ │ │ ├── minibatch_transformer.py
│ │ │ ├── negative_sampler.py
│ │ │ ├── sampled_subgraph.py
│ │ │ ├── sampling_graph.py
│ │ │ └── subgraph_sampler.py
│ │ ├── heterograph.py
│ │ ├── heterograph_index.py
│ │ ├── homophily.py
│ │ ├── init.py
│ │ ├── label_informativeness.py
│ │ ├── logging.py
│ │ ├── merge.py
│ │ ├── mpops/
│ │ │ ├── __init__.py
│ │ │ ├── edgewise.py
│ │ │ ├── fused.py
│ │ │ └── nodewise.py
│ │ ├── multiprocessing/
│ │ │ ├── __init__.py
│ │ │ └── pytorch.py
│ │ ├── ndarray.py
│ │ ├── nn/
│ │ │ ├── __init__.py
│ │ │ ├── functional/
│ │ │ │ └── __init__.py
│ │ │ ├── mxnet/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── conv/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── agnnconv.py
│ │ │ │ │ ├── appnpconv.py
│ │ │ │ │ ├── chebconv.py
│ │ │ │ │ ├── densechebconv.py
│ │ │ │ │ ├── densegraphconv.py
│ │ │ │ │ ├── densesageconv.py
│ │ │ │ │ ├── edgeconv.py
│ │ │ │ │ ├── gatconv.py
│ │ │ │ │ ├── gatedgraphconv.py
│ │ │ │ │ ├── ginconv.py
│ │ │ │ │ ├── gmmconv.py
│ │ │ │ │ ├── graphconv.py
│ │ │ │ │ ├── nnconv.py
│ │ │ │ │ ├── relgraphconv.py
│ │ │ │ │ ├── sageconv.py
│ │ │ │ │ ├── sgconv.py
│ │ │ │ │ └── tagconv.py
│ │ │ │ ├── glob.py
│ │ │ │ ├── hetero.py
│ │ │ │ ├── softmax.py
│ │ │ │ └── utils.py
│ │ │ ├── pytorch/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── conv/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── agnnconv.py
│ │ │ │ │ ├── appnpconv.py
│ │ │ │ │ ├── atomicconv.py
│ │ │ │ │ ├── cfconv.py
│ │ │ │ │ ├── chebconv.py
│ │ │ │ │ ├── cugraph_base.py
│ │ │ │ │ ├── cugraph_gatconv.py
│ │ │ │ │ ├── cugraph_relgraphconv.py
│ │ │ │ │ ├── cugraph_sageconv.py
│ │ │ │ │ ├── densechebconv.py
│ │ │ │ │ ├── densegraphconv.py
│ │ │ │ │ ├── densesageconv.py
│ │ │ │ │ ├── dgnconv.py
│ │ │ │ │ ├── dotgatconv.py
│ │ │ │ │ ├── edgeconv.py
│ │ │ │ │ ├── edgegatconv.py
│ │ │ │ │ ├── egatconv.py
│ │ │ │ │ ├── egnnconv.py
│ │ │ │ │ ├── gatconv.py
│ │ │ │ │ ├── gatedgcnconv.py
│ │ │ │ │ ├── gatedgraphconv.py
│ │ │ │ │ ├── gatv2conv.py
│ │ │ │ │ ├── gcn2conv.py
│ │ │ │ │ ├── ginconv.py
│ │ │ │ │ ├── gineconv.py
│ │ │ │ │ ├── gmmconv.py
│ │ │ │ │ ├── graphconv.py
│ │ │ │ │ ├── grouprevres.py
│ │ │ │ │ ├── hgtconv.py
│ │ │ │ │ ├── nnconv.py
│ │ │ │ │ ├── pnaconv.py
│ │ │ │ │ ├── relgraphconv.py
│ │ │ │ │ ├── sageconv.py
│ │ │ │ │ ├── sgconv.py
│ │ │ │ │ ├── tagconv.py
│ │ │ │ │ └── twirlsconv.py
│ │ │ │ ├── explain/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── gnnexplainer.py
│ │ │ │ │ ├── pgexplainer.py
│ │ │ │ │ └── subgraphx.py
│ │ │ │ ├── factory.py
│ │ │ │ ├── glob.py
│ │ │ │ ├── gt/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── biased_mha.py
│ │ │ │ │ ├── degree_encoder.py
│ │ │ │ │ ├── egt.py
│ │ │ │ │ ├── graphormer.py
│ │ │ │ │ ├── lap_pos_encoder.py
│ │ │ │ │ ├── path_encoder.py
│ │ │ │ │ └── spatial_encoder.py
│ │ │ │ ├── hetero.py
│ │ │ │ ├── linear.py
│ │ │ │ ├── link/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── edgepred.py
│ │ │ │ │ ├── transe.py
│ │ │ │ │ └── transr.py
│ │ │ │ ├── network_emb.py
│ │ │ │ ├── softmax.py
│ │ │ │ ├── sparse_emb.py
│ │ │ │ └── utils.py
│ │ │ └── tensorflow/
│ │ │ ├── __init__.py
│ │ │ ├── conv/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── appnpconv.py
│ │ │ │ ├── chebconv.py
│ │ │ │ ├── densechebconv.py
│ │ │ │ ├── edgeconv.py
│ │ │ │ ├── gatconv.py
│ │ │ │ ├── ginconv.py
│ │ │ │ ├── graphconv.py
│ │ │ │ ├── relgraphconv.py
│ │ │ │ ├── sageconv.py
│ │ │ │ └── sgconv.py
│ │ │ ├── glob.py
│ │ │ ├── hetero.py
│ │ │ ├── softmax.py
│ │ │ └── utils.py
│ │ ├── ops/
│ │ │ ├── __init__.py
│ │ │ ├── edge_softmax.py
│ │ │ ├── gather_mm.py
│ │ │ ├── sddmm.py
│ │ │ ├── segment.py
│ │ │ └── spmm.py
│ │ ├── optim/
│ │ │ ├── __init__.py
│ │ │ ├── mxnet/
│ │ │ │ └── __init__.py
│ │ │ ├── pytorch/
│ │ │ │ ├── __init__.py
│ │ │ │ └── sparse_optim.py
│ │ │ └── tensorflow/
│ │ │ └── __init__.py
│ │ ├── partition.py
│ │ ├── propagate.py
│ │ ├── random.py
│ │ ├── readout.py
│ │ ├── sampling/
│ │ │ ├── __init__.py
│ │ │ ├── labor.py
│ │ │ ├── negative.py
│ │ │ ├── neighbor.py
│ │ │ ├── node2vec_randomwalk.py
│ │ │ ├── pinsage.py
│ │ │ ├── randomwalks.py
│ │ │ └── utils.py
│ │ ├── sparse/
│ │ │ ├── __init__.py
│ │ │ ├── broadcast.py
│ │ │ ├── elementwise_op.py
│ │ │ ├── elementwise_op_sp.py
│ │ │ ├── matmul.py
│ │ │ ├── reduction.py
│ │ │ ├── sddmm.py
│ │ │ ├── softmax.py
│ │ │ ├── sparse_matrix.py
│ │ │ ├── unary_op.py
│ │ │ └── utils.py
│ │ ├── storages/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── numpy.py
│ │ │ ├── pytorch_tensor.py
│ │ │ └── tensor.py
│ │ ├── subgraph.py
│ │ ├── transforms/
│ │ │ ├── __init__.py
│ │ │ ├── functional.py
│ │ │ ├── module.py
│ │ │ └── to_block.py
│ │ ├── traversal.py
│ │ ├── udf.py
│ │ ├── utils/
│ │ │ ├── __init__.py
│ │ │ ├── checks.py
│ │ │ ├── data.py
│ │ │ ├── exception.py
│ │ │ ├── filter.py
│ │ │ ├── internal.py
│ │ │ ├── pin_memory.py
│ │ │ └── shared_mem.py
│ │ └── view.py
│ ├── setup.py
│ └── update_version.py
├── readthedocs.yml
├── script/
│ ├── build_dgl.sh
│ ├── build_doc.sh
│ ├── create_dev_conda_env.sh
│ ├── dgl_dev.yml.template
│ └── run_pytest.sh
├── src/
│ ├── api/
│ │ ├── api_container.cc
│ │ └── api_test.cc
│ ├── array/
│ │ ├── arith.h
│ │ ├── array.cc
│ │ ├── array_arith.cc
│ │ ├── array_op.h
│ │ ├── check.h
│ │ ├── cpu/
│ │ │ ├── array_cumsum.cc
│ │ │ ├── array_index_select.cc
│ │ │ ├── array_nonzero.cc
│ │ │ ├── array_op_impl.cc
│ │ │ ├── array_pack.cc
│ │ │ ├── array_repeat.cc
│ │ │ ├── array_scatter.cc
│ │ │ ├── array_sort.cc
│ │ │ ├── array_utils.h
│ │ │ ├── concurrent_id_hash_map.cc
│ │ │ ├── concurrent_id_hash_map.h
│ │ │ ├── coo_coalesce.cc
│ │ │ ├── coo_linegraph.cc
│ │ │ ├── coo_remove.cc
│ │ │ ├── coo_sort.cc
│ │ │ ├── csr_get_data.cc
│ │ │ ├── csr_mm.cc
│ │ │ ├── csr_remove.cc
│ │ │ ├── csr_sort.cc
│ │ │ ├── csr_sum.cc
│ │ │ ├── csr_to_simple.cc
│ │ │ ├── csr_union.cc
│ │ │ ├── disjoint_union.cc
│ │ │ ├── gather_mm.cc
│ │ │ ├── gather_mm.h
│ │ │ ├── labor_pick.h
│ │ │ ├── labor_sampling.cc
│ │ │ ├── negative_sampling.cc
│ │ │ ├── rowwise_pick.h
│ │ │ ├── rowwise_sampling.cc
│ │ │ ├── rowwise_topk.cc
│ │ │ ├── sddmm.cc
│ │ │ ├── sddmm.h
│ │ │ ├── segment_reduce.cc
│ │ │ ├── segment_reduce.h
│ │ │ ├── spmat_op_impl_coo.cc
│ │ │ ├── spmat_op_impl_csr.cc
│ │ │ ├── spmm.cc
│ │ │ ├── spmm.h
│ │ │ ├── spmm_binary_ops.h
│ │ │ ├── spmm_blocking_libxsmm.h
│ │ │ ├── traversal.cc
│ │ │ └── traversal.h
│ │ ├── cuda/
│ │ │ ├── array_cumsum.cu
│ │ │ ├── array_index_select.cu
│ │ │ ├── array_index_select.cuh
│ │ │ ├── array_nonzero.cu
│ │ │ ├── array_op_impl.cu
│ │ │ ├── array_scatter.cu
│ │ │ ├── array_sort.cu
│ │ │ ├── atomic.cuh
│ │ │ ├── bf16.cuh
│ │ │ ├── coo2csr.cu
│ │ │ ├── coo_sort.cu
│ │ │ ├── csr2coo.cu
│ │ │ ├── csr_get_data.cu
│ │ │ ├── csr_mm.cu
│ │ │ ├── csr_sort.cu
│ │ │ ├── csr_sum.cu
│ │ │ ├── csr_transpose.cc
│ │ │ ├── cuda_filter.cu
│ │ │ ├── cusparse_dispatcher.cuh
│ │ │ ├── disjoint_union.cu
│ │ │ ├── fp16.cuh
│ │ │ ├── functor.cuh
│ │ │ ├── gather_mm.cu
│ │ │ ├── ge_spmm.cuh
│ │ │ ├── labor_sampling.cu
│ │ │ ├── macro.cuh
│ │ │ ├── negative_sampling.cu
│ │ │ ├── rowwise_sampling.cu
│ │ │ ├── rowwise_sampling_prob.cu
│ │ │ ├── sddmm.cu
│ │ │ ├── sddmm.cuh
│ │ │ ├── sddmm_hetero_coo.cu
│ │ │ ├── sddmm_hetero_csr.cu
│ │ │ ├── segment_reduce.cu
│ │ │ ├── segment_reduce.cuh
│ │ │ ├── spmat_op_impl_coo.cu
│ │ │ ├── spmat_op_impl_csr.cu
│ │ │ ├── spmm.cu
│ │ │ ├── spmm.cuh
│ │ │ ├── spmm_hetero.cu
│ │ │ ├── utils.cu
│ │ │ ├── utils.h
│ │ │ └── uvm/
│ │ │ ├── array_index_select_uvm.cu
│ │ │ └── array_index_select_uvm.cuh
│ │ ├── filter.cc
│ │ ├── filter.h
│ │ ├── kernel.cc
│ │ ├── kernel_decl.h
│ │ ├── libra_partition.cc
│ │ ├── selector.h
│ │ ├── union_partition.cc
│ │ ├── uvm_array.cc
│ │ └── uvm_array_op.h
│ ├── bcast.cc
│ ├── c_api_common.cc
│ ├── c_api_common.h
│ ├── geometry/
│ │ ├── cpu/
│ │ │ └── geometry_op_impl.cc
│ │ ├── cuda/
│ │ │ ├── edge_coarsening_impl.cu
│ │ │ └── geometry_op_impl.cu
│ │ ├── geometry.cc
│ │ └── geometry_op.h
│ ├── graph/
│ │ ├── creators.cc
│ │ ├── gk_ops.cc
│ │ ├── graph.cc
│ │ ├── graph_apis.cc
│ │ ├── graph_op.cc
│ │ ├── graph_traversal.cc
│ │ ├── heterograph.cc
│ │ ├── heterograph.h
│ │ ├── heterograph_capi.cc
│ │ ├── immutable_graph.cc
│ │ ├── metis_partition.cc
│ │ ├── nodeflow.cc
│ │ ├── pickle.cc
│ │ ├── sampler.cc
│ │ ├── sampling/
│ │ │ ├── negative/
│ │ │ │ └── global_uniform.cc
│ │ │ ├── neighbor/
│ │ │ │ └── neighbor.cc
│ │ │ └── randomwalks/
│ │ │ ├── frequency_hashmap.cu
│ │ │ ├── frequency_hashmap.cuh
│ │ │ ├── get_node_types_cpu.cc
│ │ │ ├── get_node_types_gpu.cu
│ │ │ ├── metapath_randomwalk.h
│ │ │ ├── node2vec.cc
│ │ │ ├── node2vec_cpu.cc
│ │ │ ├── node2vec_impl.h
│ │ │ ├── node2vec_randomwalk.h
│ │ │ ├── randomwalk_cpu.cc
│ │ │ ├── randomwalk_gpu.cu
│ │ │ ├── randomwalk_with_restart_cpu.cc
│ │ │ ├── randomwalks.cc
│ │ │ ├── randomwalks_cpu.h
│ │ │ └── randomwalks_impl.h
│ │ ├── serialize/
│ │ │ ├── dglgraph_data.h
│ │ │ ├── dglgraph_serialize.cc
│ │ │ ├── dglstream.h
│ │ │ ├── graph_serialize.cc
│ │ │ ├── graph_serialize.h
│ │ │ ├── heterograph_data.h
│ │ │ ├── heterograph_serialize.cc
│ │ │ ├── tensor_serialize.cc
│ │ │ └── zerocopy_serializer.cc
│ │ ├── shared_mem_manager.cc
│ │ ├── shared_mem_manager.h
│ │ ├── subgraph.cc
│ │ ├── transform/
│ │ │ ├── compact.cc
│ │ │ ├── compact.h
│ │ │ ├── cpu/
│ │ │ │ ├── kdtree_ndarray_adapter.h
│ │ │ │ └── knn.cc
│ │ │ ├── cuda/
│ │ │ │ ├── cuda_compact_graph.cu
│ │ │ │ ├── cuda_map_edges.cuh
│ │ │ │ ├── cuda_to_block.cu
│ │ │ │ └── knn.cu
│ │ │ ├── knn.cc
│ │ │ ├── knn.h
│ │ │ ├── line_graph.cc
│ │ │ ├── metis_partition_hetero.cc
│ │ │ ├── partition_hetero.cc
│ │ │ ├── remove_edges.cc
│ │ │ ├── to_block.cc
│ │ │ ├── to_block.h
│ │ │ ├── to_simple.cc
│ │ │ └── union_partition.cc
│ │ ├── traversal.cc
│ │ ├── traversal.h
│ │ ├── unit_graph.cc
│ │ └── unit_graph.h
│ ├── partition/
│ │ ├── cuda/
│ │ │ └── partition_op.cu
│ │ ├── ndarray_partition.cc
│ │ ├── ndarray_partition.h
│ │ └── partition_op.h
│ ├── random/
│ │ ├── continuous_seed.h
│ │ ├── cpu/
│ │ │ ├── choice.cc
│ │ │ └── sample_utils.h
│ │ └── random.cc
│ ├── rpc/
│ │ ├── network/
│ │ │ ├── common.cc
│ │ │ ├── common.h
│ │ │ ├── communicator.h
│ │ │ ├── msg_queue.cc
│ │ │ ├── msg_queue.h
│ │ │ ├── socket_communicator.cc
│ │ │ ├── socket_communicator.h
│ │ │ ├── socket_pool.cc
│ │ │ ├── socket_pool.h
│ │ │ ├── tcp_socket.cc
│ │ │ └── tcp_socket.h
│ │ ├── rpc.cc
│ │ ├── rpc.h
│ │ ├── rpc_msg.h
│ │ └── server_state.h
│ ├── runtime/
│ │ ├── c_object_api.cc
│ │ ├── c_runtime_api.cc
│ │ ├── config.cc
│ │ ├── cpu_device_api.cc
│ │ ├── cuda/
│ │ │ ├── cuda_common.h
│ │ │ ├── cuda_device_api.cc
│ │ │ ├── cuda_hashtable.cu
│ │ │ ├── cuda_hashtable.cuh
│ │ │ └── gpu_cache.cu
│ │ ├── dlpack_convert.cc
│ │ ├── dso_module.cc
│ │ ├── file_util.cc
│ │ ├── file_util.h
│ │ ├── meta_data.h
│ │ ├── module.cc
│ │ ├── module_util.cc
│ │ ├── module_util.h
│ │ ├── ndarray.cc
│ │ ├── object.cc
│ │ ├── pack_args.h
│ │ ├── parallel_for.cpp
│ │ ├── registry.cc
│ │ ├── resource_manager.cc
│ │ ├── resource_manager.h
│ │ ├── runtime_base.h
│ │ ├── semaphore_wrapper.cc
│ │ ├── semaphore_wrapper.h
│ │ ├── shared_mem.cc
│ │ ├── system_lib_module.cc
│ │ ├── tensordispatch.cc
│ │ ├── thread_pool.cc
│ │ ├── thread_storage_scope.h
│ │ ├── threading_backend.cc
│ │ ├── utils.cc
│ │ ├── workspace.h
│ │ ├── workspace_pool.cc
│ │ └── workspace_pool.h
│ └── scheduler/
│ ├── scheduler.cc
│ └── scheduler_apis.cc
├── tensoradapter/
│ ├── include/
│ │ ├── tensoradapter.h
│ │ └── tensoradapter_exports.h
│ └── pytorch/
│ ├── CMakeLists.txt
│ ├── build.bat
│ ├── build.sh
│ ├── find_cmake.py
│ └── torch.cpp
├── tests/
│ ├── README.md
│ ├── backend/
│ │ ├── __init__.py
│ │ ├── backend_unittest.py
│ │ ├── mxnet/
│ │ │ └── __init__.py
│ │ ├── pytorch/
│ │ │ └── __init__.py
│ │ └── tensorflow/
│ │ └── __init__.py
│ ├── cpp/
│ │ ├── common.h
│ │ ├── graph_index_test.cc
│ │ ├── message_queue_test.cc
│ │ ├── socket_communicator_test.cc
│ │ ├── string_test.cc
│ │ ├── test_aten.cc
│ │ ├── test_concurrent_id_hash_map.cc
│ │ ├── test_csrmm.cc
│ │ ├── test_partition.cc
│ │ ├── test_rowwise.cc
│ │ ├── test_sampler.cc
│ │ ├── test_serialize.cc
│ │ ├── test_smart_ptr_serialize.cc
│ │ ├── test_spmat_coo.cc
│ │ ├── test_spmat_csr.cc
│ │ ├── test_spmm.cc
│ │ ├── test_unit_graph.cc
│ │ └── test_zerocopy_serialize.cc
│ ├── cugraph/
│ │ ├── cugraph-ops/
│ │ │ ├── test_cugraph_gatconv.py
│ │ │ ├── test_cugraph_relgraphconv.py
│ │ │ └── test_cugraph_sageconv.py
│ │ └── test_basics.py
│ ├── dist/
│ │ ├── python/
│ │ │ ├── rpc_basic.py
│ │ │ └── run_dist_objects.py
│ │ ├── test_dist_objects.py
│ │ ├── test_rpc.py
│ │ └── utils.py
│ ├── distributed/
│ │ ├── test_dist_graph_store.py
│ │ ├── test_dist_tensor.py
│ │ ├── test_distributed_sampling.py
│ │ ├── test_mp_dataloader.py
│ │ ├── test_new_kvstore.py
│ │ ├── test_partition.py
│ │ ├── test_rpc.py
│ │ └── utils.py
│ ├── examples/
│ │ ├── test_sampling_examples.py
│ │ └── test_sparse_examples.py
│ ├── go/
│ │ ├── test_model.py
│ │ └── test_pipeline.py
│ ├── integration/
│ │ └── test_data.py
│ ├── lint/
│ │ ├── clangformat_linter.py
│ │ ├── lint.py
│ │ ├── pip_init.py
│ │ ├── pylintrc
│ │ └── ufmt_linter.py
│ ├── python/
│ │ ├── common/
│ │ │ ├── backend/
│ │ │ │ ├── test_set_default_backend.py
│ │ │ │ └── test_tensor.py
│ │ │ ├── cuda/
│ │ │ │ └── test_gpu_cache.py
│ │ │ ├── data/
│ │ │ │ ├── data/
│ │ │ │ │ ├── 1.npy
│ │ │ │ │ ├── 2.npy
│ │ │ │ │ ├── graph_0.9a220622.dgl
│ │ │ │ │ └── test_heterophilous_graphs.py
│ │ │ │ ├── test_actor.py
│ │ │ │ ├── test_data.py
│ │ │ │ ├── test_geom_gcn.py
│ │ │ │ ├── test_movielens.py
│ │ │ │ ├── test_serialize.py
│ │ │ │ └── test_utils.py
│ │ │ ├── dataloading/
│ │ │ │ └── test_dataloader.py
│ │ │ ├── function/
│ │ │ │ └── test_basics.py
│ │ │ ├── ops/
│ │ │ │ ├── test_edge_softmax.py
│ │ │ │ └── test_ops.py
│ │ │ ├── sampling/
│ │ │ │ └── test_sampling.py
│ │ │ ├── test_batch-graph.py
│ │ │ ├── test_batch-heterograph.py
│ │ │ ├── test_convert.py
│ │ │ ├── test_ffi.py
│ │ │ ├── test_frame.py
│ │ │ ├── test_generators.py
│ │ │ ├── test_heterograph-apply-edges.py
│ │ │ ├── test_heterograph-index.py
│ │ │ ├── test_heterograph-kernel.py
│ │ │ ├── test_heterograph-misc.py
│ │ │ ├── test_heterograph-pickle.py
│ │ │ ├── test_heterograph-remove.py
│ │ │ ├── test_heterograph-shared-memory.py
│ │ │ ├── test_heterograph-specialization.py
│ │ │ ├── test_heterograph-update-all.py
│ │ │ ├── test_heterograph.py
│ │ │ ├── test_homophily.py
│ │ │ ├── test_label_informativeness.py
│ │ │ ├── test_merge.py
│ │ │ ├── test_partition.py
│ │ │ ├── test_propagate.py
│ │ │ ├── test_random.py
│ │ │ ├── test_readout.py
│ │ │ ├── test_sparse_ops-csr.py
│ │ │ ├── test_subgraph.py
│ │ │ ├── test_traversal.py
│ │ │ ├── transforms/
│ │ │ │ ├── test_functional-sort.py
│ │ │ │ ├── test_to_block.py
│ │ │ │ └── test_transform.py
│ │ │ └── utils/
│ │ │ ├── test_filter.py
│ │ │ └── test_pin_memory.py
│ │ ├── mxnet/
│ │ │ ├── ip_config.txt
│ │ │ ├── test_geometry.py
│ │ │ └── test_nn.py
│ │ ├── pytorch/
│ │ │ ├── cuda/
│ │ │ │ └── test_nccl.py
│ │ │ ├── dataloading/
│ │ │ │ ├── test_dataloader.py
│ │ │ │ └── test_spot_target.py
│ │ │ ├── distributed/
│ │ │ │ └── optim/
│ │ │ │ └── test_dist_optim.py
│ │ │ ├── geometry/
│ │ │ │ └── test_geometry.py
│ │ │ ├── graphbolt/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── gb_test_utils.py
│ │ │ │ ├── impl/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── test_basic_feature_store.py
│ │ │ │ │ ├── test_cooperative_minibatching_utils.py
│ │ │ │ │ ├── test_cpu_cached_feature.py
│ │ │ │ │ ├── test_disk_based_feature_store.py
│ │ │ │ │ ├── test_feature_cache.py
│ │ │ │ │ ├── test_fused_csc_sampling_graph.py
│ │ │ │ │ ├── test_gpu_cached_feature.py
│ │ │ │ │ ├── test_gpu_graph_cache.py
│ │ │ │ │ ├── test_hetero_cached_feature.py
│ │ │ │ │ ├── test_in_subgraph_sampler.py
│ │ │ │ │ ├── test_legacy_dataset.py
│ │ │ │ │ ├── test_negative_sampler.py
│ │ │ │ │ ├── test_neighbor_sampler.py
│ │ │ │ │ ├── test_ondisk_dataset.py
│ │ │ │ │ ├── test_sampled_subgraph_impl.py
│ │ │ │ │ └── test_torch_based_feature_store.py
│ │ │ │ ├── internal/
│ │ │ │ │ ├── test_sample_utils.py
│ │ │ │ │ └── test_utils.py
│ │ │ │ ├── test_base.py
│ │ │ │ ├── test_dataloader.py
│ │ │ │ ├── test_dataset.py
│ │ │ │ ├── test_feature_fetcher.py
│ │ │ │ ├── test_graphbolt_utils.py
│ │ │ │ ├── test_integration.py
│ │ │ │ ├── test_item_sampler.py
│ │ │ │ ├── test_itemset.py
│ │ │ │ ├── test_minibatch.py
│ │ │ │ ├── test_subgraph_sampler.py
│ │ │ │ └── test_utils.py
│ │ │ ├── ip_config.txt
│ │ │ ├── mpops/
│ │ │ │ └── test_edgewise.py
│ │ │ ├── nn/
│ │ │ │ ├── conv/
│ │ │ │ │ └── test_gatedgcnconv.py
│ │ │ │ ├── test_nn.py
│ │ │ │ └── test_sparse_emb.py
│ │ │ ├── optim/
│ │ │ │ └── test_optim.py
│ │ │ ├── sparse/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── test_broadcast.py
│ │ │ │ ├── test_elementwise_op.py
│ │ │ │ ├── test_elementwise_op_sp.py
│ │ │ │ ├── test_matmul.py
│ │ │ │ ├── test_matrix_op.py
│ │ │ │ ├── test_reduction.py
│ │ │ │ ├── test_sddmm.py
│ │ │ │ ├── test_softmax.py
│ │ │ │ ├── test_sparse_matrix.py
│ │ │ │ ├── test_unary_op.py
│ │ │ │ └── utils.py
│ │ │ ├── test_ffi-stream.py
│ │ │ ├── test_heterograph-pickle.py
│ │ │ ├── test_multiprocessing-ipc.py
│ │ │ └── utils/
│ │ │ └── test_pin_memory.py
│ │ ├── tensorflow/
│ │ │ ├── test_basic.py
│ │ │ └── test_nn.py
│ │ └── test_dgl_import.py
│ ├── scripts/
│ │ ├── build_dgl.bat
│ │ ├── build_dgl.sh
│ │ ├── ci_report/
│ │ │ ├── report.py
│ │ │ └── status.py
│ │ ├── cugraph_unit_test.sh
│ │ ├── task_cpp_unit_test.bat
│ │ ├── task_cpp_unit_test.sh
│ │ ├── task_dist_test.sh
│ │ ├── task_distributed_test.sh
│ │ ├── task_example_test.bat
│ │ ├── task_example_test.sh
│ │ ├── task_go_test.sh
│ │ ├── task_lint.sh
│ │ ├── task_pytorch_tutorial_test.sh
│ │ ├── task_unit_test.bat
│ │ └── task_unit_test.sh
│ ├── tools/
│ │ ├── pytest_utils.py
│ │ ├── test_array_readwriter.py
│ │ ├── test_change_etype_to_canonical_etype.py
│ │ ├── test_convert_partition.py
│ │ ├── test_dist_lookup.py
│ │ ├── test_dist_part.py
│ │ ├── test_dist_partition_graphbolt.py
│ │ ├── test_launch.py
│ │ ├── test_parmetis.py
│ │ └── test_parmetis_preproc.py
│ └── utils/
│ ├── __init__.py
│ ├── checks.py
│ └── graph_cases.py
├── third_party/
│ └── HugeCTR/
│ └── gpu_cache/
│ ├── ReadMe.md
│ ├── include/
│ │ ├── gpu_cache_api.hpp
│ │ ├── hash_functions.cuh
│ │ ├── nv_gpu_cache.hpp
│ │ └── nv_util.h
│ └── src/
│ └── nv_gpu_cache.cu
├── tools/
│ ├── README.md
│ ├── change_etype_to_canonical_etype.py
│ ├── chunk_graph.py
│ ├── copy_files.py
│ ├── dispatch_data.py
│ ├── distgraphlaunch.py
│ ├── distpartitioning/
│ │ ├── README.md
│ │ ├── array_readwriter/
│ │ │ ├── __init__.py
│ │ │ ├── csv.py
│ │ │ ├── numpy_array.py
│ │ │ ├── parquet.py
│ │ │ └── registry.py
│ │ ├── constants.py
│ │ ├── convert_partition.py
│ │ ├── data_proc_pipeline.py
│ │ ├── data_shuffle.py
│ │ ├── dataset_utils.py
│ │ ├── dist_lookup.py
│ │ ├── globalids.py
│ │ ├── gloo_wrapper.py
│ │ ├── parmetis_postprocess.py
│ │ ├── parmetis_preprocess.py
│ │ ├── parmetis_wrapper.py
│ │ └── utils.py
│ ├── files.py
│ ├── launch.py
│ ├── partition_algo/
│ │ ├── base.py
│ │ └── random_partition.py
│ ├── verification_utils.py
│ └── verify_partitions.py
└── tutorials/
├── blitz/
│ ├── .gitignore
│ ├── 1_introduction.py
│ ├── 2_dglgraph.py
│ ├── 3_message_passing.py
│ ├── 4_link_predict.py
│ ├── 5_graph_classification.py
│ ├── 6_load_data.py
│ └── README.txt
├── cpu/
│ ├── README.txt
│ ├── argo_tutorial.py
│ └── cpu_best_practises.py
├── models/
│ ├── 1_gnn/
│ │ ├── 1_gcn.py
│ │ ├── 4_rgcn.py
│ │ ├── 6_line_graph.py
│ │ ├── 9_gat.py
│ │ └── README.txt
│ ├── 2_small_graph/
│ │ ├── 3_tree-lstm.py
│ │ └── README.txt
│ ├── 3_generative_model/
│ │ ├── 5_dgmg.py
│ │ └── README.txt
│ ├── 4_old_wines/
│ │ ├── 2_capsule.py
│ │ ├── 7_transformer.py
│ │ └── README.txt
│ └── README.txt
├── multi/
│ ├── 1_graph_classification.py
│ ├── 2_node_classification.py
│ └── README.txt
└── requirements.txt
Showing preview only (953K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (12494 symbols across 1403 files)
FILE: benchmarks/benchmarks/api/bench_add_self_loop.py
function track_time (line 15) | def track_time(graph_name, format):
FILE: benchmarks/benchmarks/api/bench_batch.py
function track_time (line 12) | def track_time(batch_size):
FILE: benchmarks/benchmarks/api/bench_builtin_apply_edges.py
function track_time (line 17) | def track_time(graph_name, format, feat_size, reduce_type):
FILE: benchmarks/benchmarks/api/bench_builtin_apply_edges_hetero.py
function track_time (line 17) | def track_time(num_relations, format, feat_size, reduce_type):
FILE: benchmarks/benchmarks/api/bench_builtin_multi_update_all.py
function track_time (line 15) | def track_time(feat_size, num_relations, multi_reduce_type):
FILE: benchmarks/benchmarks/api/bench_builtin_update_all_coo.py
function track_time (line 18) | def track_time(graph_name, format, feat_size, msg_type, reduce_type):
FILE: benchmarks/benchmarks/api/bench_builtin_update_all_csc.py
function track_time (line 18) | def track_time(graph_name, format, feat_size, msg_type, reduce_type):
FILE: benchmarks/benchmarks/api/bench_edge_ids.py
function track_time (line 19) | def track_time(graph_name, format, fraction, return_uv):
FILE: benchmarks/benchmarks/api/bench_edge_subgraph.py
function track_time (line 16) | def track_time(graph_name, format, seed_egdes_num):
FILE: benchmarks/benchmarks/api/bench_find_edges.py
function track_time (line 16) | def track_time(graph_name, format, fraction):
FILE: benchmarks/benchmarks/api/bench_format_conversion.py
function track_time (line 27) | def track_time(graph_name, format):
FILE: benchmarks/benchmarks/api/bench_fused_sample_neighbors.py
function track_time (line 18) | def track_time(graph_name, format, seed_nodes_num, fanout):
FILE: benchmarks/benchmarks/api/bench_heterograph_construction.py
function track_time (line 14) | def track_time(num_relations):
FILE: benchmarks/benchmarks/api/bench_homograph_edge_construction.py
function track_time (line 15) | def track_time(size):
FILE: benchmarks/benchmarks/api/bench_homograph_scipy_construction.py
function track_time (line 16) | def track_time(size, scipy_format):
FILE: benchmarks/benchmarks/api/bench_in_degrees.py
function track_time (line 18) | def track_time(graph_name, format, fraction):
FILE: benchmarks/benchmarks/api/bench_in_edges.py
function track_time (line 18) | def track_time(graph_name, format, fraction):
FILE: benchmarks/benchmarks/api/bench_in_subgraph.py
function track_time (line 16) | def track_time(graph_name, format, seed_nodes_num):
FILE: benchmarks/benchmarks/api/bench_khop.py
function track_time (line 15) | def track_time(graph_name, format, k):
FILE: benchmarks/benchmarks/api/bench_knn_graph.py
function track_time (line 22) | def track_time(size, dim, k, algorithm):
FILE: benchmarks/benchmarks/api/bench_metis_partition.py
function track_time (line 15) | def track_time(graph_name, k):
FILE: benchmarks/benchmarks/api/bench_nn_graphconv.py
function track_time (line 19) | def track_time(graph_name, feat_dim, aggr_type):
FILE: benchmarks/benchmarks/api/bench_nn_heterographconv.py
function track_time (line 18) | def track_time(feat_dim, num_relations):
FILE: benchmarks/benchmarks/api/bench_node_subgraph.py
function track_time (line 16) | def track_time(graph_name, format, seed_nodes_num):
FILE: benchmarks/benchmarks/api/bench_random_walk.py
function _random_walk (line 10) | def _random_walk(g, seeds, length):
function _node2vec (line 14) | def _node2vec(g, seeds, length):
function track_time (line 24) | def track_time(graph_name, num_seeds, length, algorithm):
FILE: benchmarks/benchmarks/api/bench_readout.py
function track_time (line 15) | def track_time(batch_size, feat_size, readout_op, type):
FILE: benchmarks/benchmarks/api/bench_reverse.py
function track_time (line 15) | def track_time(graph_name, format):
FILE: benchmarks/benchmarks/api/bench_sample_neighbors.py
function track_time (line 18) | def track_time(graph_name, format, seed_nodes_num, fanout):
FILE: benchmarks/benchmarks/api/bench_to_block.py
function track_time (line 16) | def track_time(graph_name, num_seed_nodes, fanout):
FILE: benchmarks/benchmarks/api/bench_udf_apply_edges.py
function track_time (line 17) | def track_time(graph_name, format, feat_size, reduce_type):
FILE: benchmarks/benchmarks/api/bench_udf_multi_update_all.py
function track_time (line 16) | def track_time(feat_size, num_relations, multi_reduce_type):
FILE: benchmarks/benchmarks/api/bench_udf_update_all.py
function track_time (line 18) | def track_time(graph_name, format, feat_size, msg_type, reduce_type):
FILE: benchmarks/benchmarks/api/bench_unbatch.py
function track_time (line 12) | def track_time(batch_size):
FILE: benchmarks/benchmarks/kernel/bench_edgesoftmax.py
function track_time (line 14) | def track_time(graph, num_heads):
FILE: benchmarks/benchmarks/kernel/bench_gsddmm_u_dot_v.py
function calc_gflops (line 10) | def calc_gflops(graph, feat_size, num_heads, time):
function track_flops (line 27) | def track_flops(graph, feat_size, num_heads):
FILE: benchmarks/benchmarks/kernel/bench_gspmm_copy_u.py
function calc_gflops (line 10) | def calc_gflops(graph, feat_size, time):
function track_flops (line 18) | def track_flops(graph, feat_size, reducer):
FILE: benchmarks/benchmarks/kernel/bench_gspmm_u_mul_e_sum.py
function calc_gflops (line 10) | def calc_gflops(graph, feat_size, num_heads, time):
function track_flops (line 27) | def track_flops(graph, feat_size, num_heads):
FILE: benchmarks/benchmarks/model_acc/bench_gat.py
class GAT (line 10) | class GAT(nn.Module):
method __init__ (line 11) | def __init__(
method forward (line 70) | def forward(self, g, inputs):
function evaluate (line 79) | def evaluate(model, g, features, labels, mask):
function track_acc (line 92) | def track_acc(data):
FILE: benchmarks/benchmarks/model_acc/bench_gcn.py
class GCN (line 10) | class GCN(nn.Module):
method __init__ (line 11) | def __init__(
method forward (line 27) | def forward(self, g, features):
function evaluate (line 36) | def evaluate(model, g, features, labels, mask):
function track_acc (line 49) | def track_acc(data):
FILE: benchmarks/benchmarks/model_acc/bench_gcn_udf.py
class GraphConv (line 9) | class GraphConv(nn.Module):
method __init__ (line 10) | def __init__(self, in_dim, out_dim, activation=None):
method forward (line 20) | def forward(self, graph, feat):
method mfunc (line 36) | def mfunc(self, edges):
method rfunc (line 39) | def rfunc(self, nodes):
class GCN (line 45) | class GCN(nn.Module):
method __init__ (line 46) | def __init__(
method forward (line 62) | def forward(self, g, features):
function evaluate (line 71) | def evaluate(model, g, features, labels, mask):
function track_acc (line 84) | def track_acc(data):
FILE: benchmarks/benchmarks/model_acc/bench_rgcn_base.py
function track_acc (line 12) | def track_acc(dataset, ns_mode):
FILE: benchmarks/benchmarks/model_acc/bench_rgcn_ns.py
class EntityClassify (line 17) | class EntityClassify(nn.Module):
method __init__ (line 41) | def __init__(
method forward (line 110) | def forward(self, blocks, feats, norm=None):
class RelGraphEmbedLayer (line 121) | class RelGraphEmbedLayer(nn.Module):
method __init__ (line 142) | def __init__(
method forward (line 177) | def forward(self, node_ids, node_tids, type_ids, features):
function evaluate (line 212) | def evaluate(model, embed_layer, eval_loader, node_feats):
function track_acc (line 239) | def track_acc(data):
FILE: benchmarks/benchmarks/model_acc/bench_sage.py
class GraphSAGE (line 10) | class GraphSAGE(nn.Module):
method __init__ (line 11) | def __init__(
method forward (line 36) | def forward(self, graph, inputs):
function evaluate (line 46) | def evaluate(model, g, features, labels, mask):
function track_acc (line 59) | def track_acc(data):
FILE: benchmarks/benchmarks/model_acc/bench_sage_ns.py
class SAGE (line 15) | class SAGE(nn.Module):
method __init__ (line 16) | def __init__(
method forward (line 31) | def forward(self, blocks, x):
method inference (line 40) | def inference(self, g, x, batch_size, device):
function compute_acc (line 87) | def compute_acc(pred, labels):
function evaluate (line 95) | def evaluate(model, g, inputs, labels, val_nid, batch_size, device):
function load_subtensor (line 112) | def load_subtensor(g, seeds, input_nodes, device):
function track_acc (line 123) | def track_acc(data):
FILE: benchmarks/benchmarks/model_speed/bench_gat.py
class GAT (line 13) | class GAT(nn.Module):
method __init__ (line 14) | def __init__(
method forward (line 73) | def forward(self, g, inputs):
function track_time (line 84) | def track_time(data):
FILE: benchmarks/benchmarks/model_speed/bench_gat_ns.py
class GAT (line 16) | class GAT(nn.Module):
method __init__ (line 17) | def __init__(
method forward (line 68) | def forward(self, blocks, x):
function load_subtensor (line 78) | def load_subtensor(g, seeds, input_nodes, device):
function track_time (line 89) | def track_time(data):
FILE: benchmarks/benchmarks/model_speed/bench_gcn_udf.py
class GraphConv (line 12) | class GraphConv(nn.Module):
method __init__ (line 13) | def __init__(self, in_dim, out_dim, activation=None):
method forward (line 23) | def forward(self, graph, feat):
method mfunc (line 39) | def mfunc(self, edges):
method rfunc (line 42) | def rfunc(self, nodes):
class GCN (line 48) | class GCN(nn.Module):
method __init__ (line 49) | def __init__(
method forward (line 65) | def forward(self, g, features):
function track_time (line 76) | def track_time(data):
FILE: benchmarks/benchmarks/model_speed/bench_pinsage.py
function _init_input_modules (line 17) | def _init_input_modules(g, ntype, textset, hidden_dims):
class BagOfWordsPretrained (line 52) | class BagOfWordsPretrained(nn.Module):
method __init__ (line 53) | def __init__(self, field, hidden_dims):
method forward (line 69) | def forward(self, x, length):
class BagOfWords (line 78) | class BagOfWords(nn.Module):
method __init__ (line 79) | def __init__(self, field, hidden_dims):
method forward (line 89) | def forward(self, x, length):
class WeightedSAGEConv (line 93) | class WeightedSAGEConv(nn.Module):
method __init__ (line 94) | def __init__(self, input_dims, hidden_dims, output_dims, act=F.relu):
method reset_parameters (line 103) | def reset_parameters(self):
method forward (line 110) | def forward(self, g, h, weights):
class SAGENet (line 133) | class SAGENet(nn.Module):
method __init__ (line 134) | def __init__(self, hidden_dims, n_layers):
method forward (line 150) | def forward(self, blocks, h):
class LinearProjector (line 157) | class LinearProjector(nn.Module):
method __init__ (line 162) | def __init__(self, full_graph, ntype, textset, hidden_dims):
method forward (line 170) | def forward(self, ndata):
class ItemToItemScorer (line 190) | class ItemToItemScorer(nn.Module):
method __init__ (line 191) | def __init__(self, full_graph, ntype):
method _add_bias (line 197) | def _add_bias(self, edges):
method forward (line 202) | def forward(self, item_item_graph, h):
class PinSAGEModel (line 215) | class PinSAGEModel(nn.Module):
method __init__ (line 216) | def __init__(self, full_graph, ntype, textsets, hidden_dims, n_layers):
method forward (line 223) | def forward(self, pos_graph, neg_graph, blocks):
method get_repr (line 229) | def get_repr(self, blocks):
function compact_and_copy (line 235) | def compact_and_copy(frontier, seeds):
class ItemToItemBatchSampler (line 244) | class ItemToItemBatchSampler(IterableDataset):
method __init__ (line 245) | def __init__(self, g, user_type, item_type, batch_size):
method __iter__ (line 253) | def __iter__(self):
class NeighborSampler (line 271) | class NeighborSampler(object):
method __init__ (line 272) | def __init__(
method sample_blocks (line 301) | def sample_blocks(self, seeds, heads=None, tails=None, neg_tails=None):
method sample_from_item_pairs (line 323) | def sample_from_item_pairs(self, heads, tails, neg_tails):
function assign_simple_node_features (line 339) | def assign_simple_node_features(ndata, g, ntype, assign_id=False):
function assign_textual_node_features (line 350) | def assign_textual_node_features(ndata, textset, ntype):
function assign_features_to_blocks (line 385) | def assign_features_to_blocks(blocks, g, textset, ntype):
class PinSAGECollator (line 394) | class PinSAGECollator(object):
method __init__ (line 395) | def __init__(self, sampler, g, ntype, textset):
method collate_train (line 401) | def collate_train(self, batches):
method collate_test (line 411) | def collate_test(self, samples):
function track_time (line 420) | def track_time(data):
FILE: benchmarks/benchmarks/model_speed/bench_rgcn_base.py
function track_time (line 12) | def track_time(data):
FILE: benchmarks/benchmarks/model_speed/bench_rgcn_hetero_ns.py
class RelGraphConvLayer (line 17) | class RelGraphConvLayer(nn.Module):
method __init__ (line 42) | def __init__(
method forward (line 102) | def forward(self, g, inputs):
class RelGraphEmbed (line 149) | class RelGraphEmbed(nn.Module):
method __init__ (line 152) | def __init__(
method forward (line 188) | def forward(self, block=None):
class EntityClassify (line 217) | class EntityClassify(nn.Module):
method __init__ (line 218) | def __init__(
method forward (line 281) | def forward(self, h, blocks):
function track_time (line 289) | def track_time(data):
FILE: benchmarks/benchmarks/model_speed/bench_rgcn_homogeneous_ns.py
class EntityClassify (line 17) | class EntityClassify(nn.Module):
method __init__ (line 41) | def __init__(
method forward (line 110) | def forward(self, blocks, feats, norm=None):
class RelGraphEmbedLayer (line 121) | class RelGraphEmbedLayer(nn.Module):
method __init__ (line 142) | def __init__(
method forward (line 177) | def forward(self, node_ids, node_tids, type_ids, features):
function track_time (line 214) | def track_time(data):
FILE: benchmarks/benchmarks/model_speed/bench_sage.py
class GraphSAGE (line 13) | class GraphSAGE(nn.Module):
method __init__ (line 14) | def __init__(
method forward (line 39) | def forward(self, graph, inputs):
function track_time (line 51) | def track_time(data):
FILE: benchmarks/benchmarks/model_speed/bench_sage_ns.py
class SAGE (line 15) | class SAGE(nn.Module):
method __init__ (line 16) | def __init__(
method forward (line 31) | def forward(self, blocks, x):
function load_subtensor (line 41) | def load_subtensor(g, seeds, input_nodes, device):
function track_time (line 52) | def track_time(data):
FILE: benchmarks/benchmarks/model_speed/bench_sage_unsupervised_ns.py
class NegativeSampler (line 16) | class NegativeSampler(object):
method __init__ (line 17) | def __init__(self, g, k, neg_share=False):
method __call__ (line 22) | def __call__(self, g, eids):
function load_subtensor (line 34) | def load_subtensor(g, input_nodes, device):
class SAGE (line 42) | class SAGE(nn.Module):
method __init__ (line 43) | def __init__(
method forward (line 58) | def forward(self, blocks, x):
function load_subtensor (line 68) | def load_subtensor(g, input_nodes, device):
class CrossEntropyLoss (line 76) | class CrossEntropyLoss(nn.Module):
method forward (line 77) | def forward(self, block_outputs, pos_graph, neg_graph):
function track_time (line 99) | def track_time(data, num_negs, batch_size):
FILE: benchmarks/benchmarks/multigpu/bench_multigpu_rgcn.py
class EntityClassify (line 31) | class EntityClassify(nn.Module):
method __init__ (line 32) | def __init__(
method forward (line 101) | def forward(self, blocks, feats, norm=None):
function gen_norm (line 112) | def gen_norm(g):
class NeighborSampler (line 123) | class NeighborSampler:
method __init__ (line 124) | def __init__(self, g, target_idx, fanouts):
method sample_blocks (line 129) | def sample_blocks(self, seeds):
function run (line 149) | def run(proc_id, n_gpus, n_cpus, args, devices, dataset, split, queue=No...
function track_time (line 363) | def track_time(data, dgl_sparse):
function config (line 539) | def config():
FILE: benchmarks/benchmarks/multigpu/bench_multigpu_sage.py
class SAGE (line 20) | class SAGE(nn.Module):
method __init__ (line 21) | def __init__(
method forward (line 36) | def forward(self, blocks, x):
function load_subtensor (line 46) | def load_subtensor(nfeat, labels, seeds, input_nodes, dev_id):
function run (line 57) | def run(result_queue, proc_id, n_gpus, args, devices, data):
function track_time (line 150) | def track_time(data):
FILE: benchmarks/benchmarks/multigpu/rgcn_model.py
class BaseRGCN (line 6) | class BaseRGCN(nn.Module):
method __init__ (line 7) | def __init__(
method build_model (line 33) | def build_model(self):
method build_input_layer (line 48) | def build_input_layer(self):
method build_hidden_layer (line 51) | def build_hidden_layer(self, idx):
method build_output_layer (line 54) | def build_output_layer(self):
method forward (line 57) | def forward(self, g, h, r, norm):
function initializer (line 63) | def initializer(emb):
class RelGraphEmbedLayer (line 68) | class RelGraphEmbedLayer(nn.Module):
method __init__ (line 89) | def __init__(
method dgl_emb (line 132) | def dgl_emb(self):
method forward (line 140) | def forward(self, node_ids, node_tids, type_ids, features):
FILE: benchmarks/benchmarks/rgcn.py
class RGCN (line 10) | class RGCN(nn.Module):
method __init__ (line 11) | def __init__(
method forward (line 42) | def forward(self, g, nids=None):
function load_data (line 58) | def load_data(data_name, get_norm=False, inv_target=False):
FILE: benchmarks/benchmarks/utils.py
function _download (line 20) | def _download(url, path, filename):
function thread_wrapped_func (line 42) | def thread_wrapped_func(func):
function get_graph (line 71) | def get_graph(name, format=None):
function get_ogb_graph (line 118) | def get_ogb_graph(name):
function get_livejournal (line 124) | def get_livejournal():
function get_friendster (line 145) | def get_friendster():
class OGBDataset (line 166) | class OGBDataset(object):
method __init__ (line 167) | def __init__(self, g, num_labels, predict_category=None):
method num_labels (line 173) | def num_labels(self):
method num_classes (line 177) | def num_classes(self):
method predict_category (line 181) | def predict_category(self):
method __getitem__ (line 184) | def __getitem__(self, idx):
function load_ogb_product (line 188) | def load_ogb_product():
function load_ogb_mag (line 224) | def load_ogb_mag():
class PinsageDataset (line 258) | class PinsageDataset:
method __init__ (line 259) | def __init__(self, g, user_ntype, item_ntype, textset):
method user_ntype (line 266) | def user_ntype(self):
method item_ntype (line 270) | def item_ntype(self):
method textset (line 274) | def textset(self):
method __getitem__ (line 277) | def __getitem__(self, idx):
function load_nowplaying_rs (line 281) | def load_nowplaying_rs():
function process_data (line 311) | def process_data(name):
function get_bench_device (line 336) | def get_bench_device():
function setup_track_time (line 344) | def setup_track_time(*args, **kwargs):
function setup_track_acc (line 350) | def setup_track_acc(*args, **kwargs):
function setup_track_flops (line 356) | def setup_track_flops(*args, **kwargs):
function parametrize (line 375) | def parametrize(param_name, params):
function noop_decorator (line 440) | def noop_decorator(param_name, params):
class TestFilter (line 449) | class TestFilter:
method __init__ (line 450) | def __init__(self):
method check (line 471) | def check(self, func):
function skip_if_gpu (line 501) | def skip_if_gpu():
function _cuda_device_count (line 514) | def _cuda_device_count(q):
function get_num_gpu (line 520) | def get_num_gpu():
function skip_if_not_4gpu (line 533) | def skip_if_not_4gpu():
function benchmark (line 546) | def benchmark(track_type, timeout=60):
class Timer (line 587) | class Timer:
method __init__ (line 588) | def __init__(self, device=None):
method __enter__ (line 595) | def __enter__(self):
method __exit__ (line 604) | def __exit__(self, type, value, traceback):
FILE: benchmarks/scripts/fix_ram_info.py
function main (line 5) | def main():
FILE: benchmarks/scripts/generate_excel.py
function get_branch_name_from_hash (line 8) | def get_branch_name_from_hash(hash):
function main (line 23) | def main():
function dict_to_csv (line 60) | def dict_to_csv(output_results_dict):
function side_by_side_view (line 89) | def side_by_side_view(df):
FILE: benchmarks/scripts/replace_branch.py
function json_minify (line 7) | def json_minify(string, strip_space=True):
function add_prefix (line 63) | def add_prefix(branch_name):
function change_branch (line 70) | def change_branch(branch_str: str):
FILE: dgl_sparse/include/sparse/elementwise_op.h
function namespace (line 11) | namespace dgl {
FILE: dgl_sparse/include/sparse/matrix_ops.h
function namespace (line 13) | namespace dgl {
FILE: dgl_sparse/include/sparse/reduction.h
function namespace (line 13) | namespace dgl {
FILE: dgl_sparse/include/sparse/sddmm.h
function namespace (line 12) | namespace dgl {
FILE: dgl_sparse/include/sparse/softmax.h
function namespace (line 11) | namespace dgl {
FILE: dgl_sparse/include/sparse/sparse_format.h
function namespace (line 19) | namespace dgl {
FILE: dgl_sparse/include/sparse/sparse_matrix.h
function namespace (line 22) | namespace dgl {
FILE: dgl_sparse/include/sparse/spmm.h
function namespace (line 12) | namespace dgl {
FILE: dgl_sparse/include/sparse/spspmm.h
function namespace (line 12) | namespace dgl {
FILE: dgl_sparse/src/cpu/matrix_ops_impl.cc
type dgl (line 8) | namespace dgl {
type sparse (line 9) | namespace sparse {}
FILE: dgl_sparse/src/elemenwise_op.cc
type dgl (line 16) | namespace dgl {
type sparse (line 17) | namespace sparse {
function SpSpAdd (line 21) | c10::intrusive_ptr<SparseMatrix> SpSpAdd(
class SpSpMulAutoGrad (line 36) | class SpSpMulAutoGrad : public Function<SpSpMulAutoGrad> {
function variable_list (line 46) | variable_list SpSpMulAutoGrad::forward(
function tensor_list (line 77) | tensor_list SpSpMulAutoGrad::backward(
function SpSpMul (line 102) | c10::intrusive_ptr<SparseMatrix> SpSpMul(
function SpSpDiv (line 121) | c10::intrusive_ptr<SparseMatrix> SpSpDiv(
FILE: dgl_sparse/src/matmul.cc
type dgl (line 17) | namespace dgl {
type sparse (line 18) | namespace sparse {
function SpMMNoAutoGrad (line 20) | torch::Tensor SpMMNoAutoGrad(
function SDDMMNoAutoGrad (line 77) | torch::Tensor SDDMMNoAutoGrad(
function BroadcastOpNoAutoGrad (line 113) | torch::Tensor BroadcastOpNoAutoGrad(
function BroadcastSubNoAutoGrad (line 146) | torch::Tensor BroadcastSubNoAutoGrad(
function BroadcastDivNoAutoGrad (line 152) | torch::Tensor BroadcastDivNoAutoGrad(
function BroadcastMulNoAutoGrad (line 158) | torch::Tensor BroadcastMulNoAutoGrad(
function SpSpMMNoAutoGrad (line 164) | c10::intrusive_ptr<SparseMatrix> SpSpMMNoAutoGrad(
FILE: dgl_sparse/src/matmul.h
function namespace (line 14) | namespace dgl {
FILE: dgl_sparse/src/matrix_ops.cc
type dgl (line 9) | namespace dgl {
type sparse (line 10) | namespace sparse {
function COOIntersection (line 22) | std::tuple<std::shared_ptr<COO>, torch::Tensor, torch::Tensor> COOIn...
function RevertPermutation (line 59) | static torch::Tensor RevertPermutation(const torch::Tensor& perm) {
function CompactIndices (line 75) | static std::tuple<torch::Tensor, torch::Tensor> CompactIndices(
function CompactCOO (line 112) | static std::tuple<c10::intrusive_ptr<SparseMatrix>, torch::Tensor> C...
function CompactCSR (line 138) | static std::tuple<c10::intrusive_ptr<SparseMatrix>, torch::Tensor> C...
function Compact (line 167) | std::tuple<c10::intrusive_ptr<SparseMatrix>, torch::Tensor> Compact(
FILE: dgl_sparse/src/matrix_ops_impl.h
function namespace (line 17) | namespace dgl {
FILE: dgl_sparse/src/python_binding.cc
type dgl (line 21) | namespace dgl {
type sparse (line 22) | namespace sparse {
function TORCH_LIBRARY (line 24) | TORCH_LIBRARY(dgl_sparse, m) {
FILE: dgl_sparse/src/reduction.cc
type dgl (line 18) | namespace dgl {
type sparse (line 19) | namespace sparse {
function ReduceAlong (line 23) | torch::Tensor ReduceAlong(
function ReduceAll (line 70) | torch::Tensor ReduceAll(
function Reduce (line 90) | torch::Tensor Reduce(
FILE: dgl_sparse/src/sddmm.cc
type dgl (line 15) | namespace dgl {
type sparse (line 16) | namespace sparse {
class SDDMMAutoGrad (line 20) | class SDDMMAutoGrad : public Function<SDDMMAutoGrad> {
function _SDDMMSanityCheck (line 29) | void _SDDMMSanityCheck(
function tensor_list (line 88) | tensor_list SDDMMAutoGrad::backward(
function SDDMM (line 108) | c10::intrusive_ptr<SparseMatrix> SDDMM(
FILE: dgl_sparse/src/softmax.cc
type dgl (line 14) | namespace dgl {
type sparse (line 15) | namespace sparse {
class SoftmaxAutoGrad (line 19) | class SoftmaxAutoGrad : public Function<SoftmaxAutoGrad> {
function tensor_list (line 52) | tensor_list SoftmaxAutoGrad::backward(
function Softmax (line 76) | c10::intrusive_ptr<SparseMatrix> Softmax(
FILE: dgl_sparse/src/sparse_format.cc
type dgl (line 14) | namespace dgl {
type sparse (line 15) | namespace sparse {
function COOFromOldDGLCOO (line 17) | std::shared_ptr<COO> COOFromOldDGLCOO(const aten::COOMatrix& dgl_coo) {
function COOToOldDGLCOO (line 27) | aten::COOMatrix COOToOldDGLCOO(const std::shared_ptr<COO>& coo) {
function CSRFromOldDGLCSR (line 35) | std::shared_ptr<CSR> CSRFromOldDGLCSR(const aten::CSRMatrix& dgl_csr) {
function CSRToOldDGLCSR (line 44) | aten::CSRMatrix CSRToOldDGLCSR(const std::shared_ptr<CSR>& csr) {
function COOToTorchCOO (line 52) | torch::Tensor COOToTorchCOO(
function CSRToCOO (line 64) | std::shared_ptr<COO> CSRToCOO(const std::shared_ptr<CSR>& csr) {
function CSCToCOO (line 70) | std::shared_ptr<COO> CSCToCOO(const std::shared_ptr<CSR>& csc) {
function COOToCSR (line 77) | std::shared_ptr<CSR> COOToCSR(const std::shared_ptr<COO>& coo) {
function CSCToCSR (line 83) | std::shared_ptr<CSR> CSCToCSR(const std::shared_ptr<CSR>& csc) {
function COOToCSC (line 89) | std::shared_ptr<CSR> COOToCSC(const std::shared_ptr<COO>& coo) {
function CSRToCSC (line 96) | std::shared_ptr<CSR> CSRToCSC(const std::shared_ptr<CSR>& csr) {
function DiagToCOO (line 102) | std::shared_ptr<COO> DiagToCOO(
function DiagToCSR (line 111) | std::shared_ptr<CSR> DiagToCSR(
function DiagToCSC (line 124) | std::shared_ptr<CSR> DiagToCSC(
function COOTranspose (line 137) | std::shared_ptr<COO> COOTranspose(const std::shared_ptr<COO>& coo) {
function COOSort (line 143) | std::pair<std::shared_ptr<COO>, torch::Tensor> COOSort(
FILE: dgl_sparse/src/sparse_matrix.cc
type dgl (line 17) | namespace dgl {
type sparse (line 18) | namespace sparse {
FILE: dgl_sparse/src/sparse_matrix_coalesce.cc
type dgl (line 14) | namespace dgl {
type sparse (line 15) | namespace sparse {
FILE: dgl_sparse/src/spmm.cc
type dgl (line 17) | namespace dgl {
type sparse (line 18) | namespace sparse {
class SpMMAutoGrad (line 22) | class SpMMAutoGrad : public Function<SpMMAutoGrad> {
function _SpMMSanityCheck (line 31) | void _SpMMSanityCheck(
function tensor_list (line 88) | tensor_list SpMMAutoGrad::backward(
function SpMM (line 114) | torch::Tensor SpMM(
FILE: dgl_sparse/src/spspmm.cc
type dgl (line 15) | namespace dgl {
type sparse (line 16) | namespace sparse {
class SpSpMMAutoGrad (line 20) | class SpSpMMAutoGrad : public Function<SpSpMMAutoGrad> {
function _SpSpMMSanityCheck (line 30) | void _SpSpMMSanityCheck(
function _CSRMask (line 62) | torch::Tensor _CSRMask(
function variable_list (line 73) | variable_list SpSpMMAutoGrad::forward(
function tensor_list (line 93) | tensor_list SpSpMMAutoGrad::backward(
function DiagSpSpMM (line 119) | c10::intrusive_ptr<SparseMatrix> DiagSpSpMM(
function SpSpMM (line 155) | c10::intrusive_ptr<SparseMatrix> SpSpMM(
FILE: dgl_sparse/src/utils.h
function namespace (line 18) | namespace dgl {
FILE: dglgo/dglgo/apply_pipeline/graphpred/gen.py
class ApplyGraphpredPipelineCfg (line 26) | class ApplyGraphpredPipelineCfg(BaseModel):
class ApplyGraphpredPipeline (line 33) | class ApplyGraphpredPipeline(PipelineBase):
method __init__ (line 34) | def __init__(self):
method setup_user_cfg_cls (line 38) | def setup_user_cfg_cls(cls):
method user_cfg_cls (line 52) | def user_cfg_cls(self):
method get_cfg_func (line 55) | def get_cfg_func(self):
method gen_script (line 116) | def gen_script(cls, user_cfg_dict):
method get_description (line 155) | def get_description() -> str:
FILE: dglgo/dglgo/apply_pipeline/nodepred/gen.py
class ApplyNodepredPipeline (line 21) | class ApplyNodepredPipeline(PipelineBase):
method __init__ (line 22) | def __init__(self):
method setup_user_cfg_cls (line 26) | def setup_user_cfg_cls(cls):
method user_cfg_cls (line 37) | def user_cfg_cls(self):
method get_cfg_func (line 40) | def get_cfg_func(self):
method gen_script (line 98) | def gen_script(cls, user_cfg_dict):
method get_description (line 138) | def get_description() -> str:
FILE: dglgo/dglgo/apply_pipeline/nodepred_sample/gen.py
class ApplyNodepredNsPipeline (line 21) | class ApplyNodepredNsPipeline(PipelineBase):
method __init__ (line 22) | def __init__(self):
method setup_user_cfg_cls (line 26) | def setup_user_cfg_cls(cls):
method user_cfg_cls (line 37) | def user_cfg_cls(self):
method get_cfg_func (line 40) | def get_cfg_func(self):
method gen_script (line 98) | def gen_script(cls, user_cfg_dict):
method get_description (line 138) | def get_description() -> str:
FILE: dglgo/dglgo/cli/apply_cli.py
function apply (line 11) | def apply(cfg: str = typer.Option(..., help="config yaml file name")):
FILE: dglgo/dglgo/cli/cli.py
function main (line 25) | def main():
FILE: dglgo/dglgo/cli/export_cli.py
function export (line 14) | def export(
FILE: dglgo/dglgo/cli/recipe_cli.py
function list_recipes (line 10) | def list_recipes():
function get_recipe (line 43) | def get_recipe(
FILE: dglgo/dglgo/cli/train_cli.py
function train (line 13) | def train(
FILE: dglgo/dglgo/model/edge_encoder/bilinear.py
class BilinearPredictor (line 6) | class BilinearPredictor(nn.Module):
method __init__ (line 7) | def __init__(
method forward (line 37) | def forward(self, h_src, h_dst):
FILE: dglgo/dglgo/model/edge_encoder/dot.py
class DotPredictor (line 6) | class DotPredictor(nn.Module):
method __init__ (line 7) | def __init__(
method forward (line 23) | def forward(self, h_src, h_dst):
FILE: dglgo/dglgo/model/edge_encoder/ele.py
class ElementWiseProductPredictor (line 6) | class ElementWiseProductPredictor(nn.Module):
method __init__ (line 7) | def __init__(
method forward (line 38) | def forward(self, h_src, h_dst):
FILE: dglgo/dglgo/model/graph_encoder/gin_ogbg.py
class MLP (line 9) | class MLP(nn.Module):
method __init__ (line 10) | def __init__(self, feat_size: int):
method forward (line 21) | def forward(self, h):
class OGBGGIN (line 25) | class OGBGGIN(nn.Module):
method __init__ (line 26) | def __init__(
method forward (line 89) | def forward(self, graph, node_feat, edge_feat):
FILE: dglgo/dglgo/model/graph_encoder/pna.py
function aggregate_mean (line 12) | def aggregate_mean(h):
function aggregate_max (line 17) | def aggregate_max(h):
function aggregate_min (line 22) | def aggregate_min(h):
function aggregate_sum (line 27) | def aggregate_sum(h):
function aggregate_var (line 32) | def aggregate_var(h):
function aggregate_std (line 40) | def aggregate_std(h):
function scale_identity (line 55) | def scale_identity(h, D, delta):
function scale_amplification (line 60) | def scale_amplification(h, D, delta):
function scale_attenuation (line 65) | def scale_attenuation(h, D, delta):
class MLP (line 77) | class MLP(nn.Module):
method __init__ (line 78) | def __init__(
method forward (line 105) | def forward(self, h):
class SimplePNAConv (line 113) | class SimplePNAConv(nn.Module):
method __init__ (line 116) | def __init__(
method reduce (line 145) | def reduce(self, nodes):
method forward (line 154) | def forward(self, g, h):
class PNA (line 172) | class PNA(nn.Module):
method __init__ (line 173) | def __init__(
method forward (line 279) | def forward(self, graph, node_feat, edge_feat=None):
FILE: dglgo/dglgo/model/node_encoder/gat.py
class GAT (line 10) | class GAT(nn.Module):
method __init__ (line 11) | def __init__(
method forward (line 82) | def forward(self, graph, node_feat, edge_feat=None):
method forward_block (line 96) | def forward_block(self, blocks, node_feat, edge_feat=None):
FILE: dglgo/dglgo/model/node_encoder/gcn.py
class GCN (line 7) | class GCN(nn.Module):
method __init__ (line 8) | def __init__(
method forward (line 66) | def forward(self, g, node_feat, edge_feat=None):
method forward_block (line 82) | def forward_block(self, blocks, node_feat, edge_feat=None):
FILE: dglgo/dglgo/model/node_encoder/gin.py
class GIN (line 6) | class GIN(nn.Module):
method __init__ (line 7) | def __init__(
method forward (line 55) | def forward(self, graph, node_feat, edge_feat=None):
FILE: dglgo/dglgo/model/node_encoder/sage.py
class GraphSAGE (line 6) | class GraphSAGE(nn.Module):
method __init__ (line 7) | def __init__(
method forward (line 57) | def forward(self, graph, node_feat, edge_feat=None):
method forward_block (line 73) | def forward_block(self, blocks, node_feat, edge_feat=None):
FILE: dglgo/dglgo/model/node_encoder/sgc.py
class SGC (line 8) | class SGC(nn.Module):
method __init__ (line 9) | def __init__(self, data_info: dict, embed_size: int = -1, bias=True, k...
method forward (line 43) | def forward(self, g, node_feat, edge_feat=None):
method normalize (line 54) | def normalize(h):
FILE: dglgo/dglgo/pipeline/graphpred/gen.py
class GraphpredPipelineCfg (line 28) | class GraphpredPipelineCfg(BaseModel):
class GraphpredPipeline (line 43) | class GraphpredPipeline(PipelineBase):
method __init__ (line 44) | def __init__(self):
method setup_user_cfg_cls (line 48) | def setup_user_cfg_cls(cls):
method user_cfg_cls (line 63) | def user_cfg_cls(self):
method get_cfg_func (line 66) | def get_cfg_func(self):
method gen_script (line 114) | def gen_script(cls, user_cfg_dict):
method get_description (line 160) | def get_description() -> str:
FILE: dglgo/dglgo/pipeline/linkpred/gen.py
class LinkpredPipelineCfg (line 25) | class LinkpredPipelineCfg(BaseModel):
class LinkpredPipeline (line 49) | class LinkpredPipeline(PipelineBase):
method __init__ (line 54) | def __init__(self):
method setup_user_cfg_cls (line 58) | def setup_user_cfg_cls(cls):
method user_cfg_cls (line 79) | def user_cfg_cls(self):
method get_cfg_func (line 82) | def get_cfg_func(self):
method gen_script (line 154) | def gen_script(cls, user_cfg_dict):
method get_description (line 225) | def get_description() -> str:
FILE: dglgo/dglgo/pipeline/nodepred/gen.py
class NodepredPipelineCfg (line 33) | class NodepredPipelineCfg(BaseModel):
class NodepredPipeline (line 44) | class NodepredPipeline(PipelineBase):
method __init__ (line 48) | def __init__(self):
method setup_user_cfg_cls (line 52) | def setup_user_cfg_cls(cls):
method user_cfg_cls (line 67) | def user_cfg_cls(self):
method get_cfg_func (line 70) | def get_cfg_func(self):
method gen_script (line 116) | def gen_script(cls, user_cfg_dict):
method get_description (line 162) | def get_description() -> str:
FILE: dglgo/dglgo/pipeline/nodepred_sample/gen.py
class SamplerConfig (line 26) | class SamplerConfig(BaseModel):
class Config (line 34) | class Config:
class NodepredNSPipelineCfg (line 57) | class NodepredNSPipelineCfg(BaseModel):
class NodepredNsPipeline (line 69) | class NodepredNsPipeline(PipelineBase):
method __init__ (line 70) | def __init__(self):
method setup_user_cfg_cls (line 75) | def setup_user_cfg_cls(cls):
method user_cfg_cls (line 91) | def user_cfg_cls(self):
method get_cfg_func (line 94) | def get_cfg_func(self):
method gen_script (line 152) | def gen_script(user_cfg_dict):
method get_description (line 203) | def get_description() -> str:
FILE: dglgo/dglgo/utils/base_model.py
class DeviceEnum (line 15) | class DeviceEnum(str, Enum):
class DGLBaseModel (line 20) | class DGLBaseModel(PydanticBaseModel):
class Config (line 21) | class Config:
method with_fields (line 26) | def with_fields(cls, model_name, **field_definitions):
function get_literal_value (line 30) | def get_literal_value(type_):
function extract_name (line 38) | def extract_name(union_type):
class EarlyStopConfig (line 47) | class EarlyStopConfig(DGLBaseModel):
FILE: dglgo/dglgo/utils/early_stop.py
class EarlyStopping (line 4) | class EarlyStopping:
method __init__ (line 5) | def __init__(
method step (line 14) | def step(self, acc, model):
method save_checkpoint (line 32) | def save_checkpoint(self, model):
method load_checkpoint (line 36) | def load_checkpoint(self, model):
FILE: dglgo/dglgo/utils/enter_config.py
class PipelineConfig (line 16) | class PipelineConfig(DGLBaseModel):
class UserConfig (line 25) | class UserConfig(DGLBaseModel):
FILE: dglgo/dglgo/utils/factory.py
class PipelineBase (line 21) | class PipelineBase(ABC):
method __init__ (line 23) | def __init__(self) -> None:
method get_cfg_func (line 27) | def get_cfg_func(self):
method gen_script (line 31) | def gen_script(user_cfg_dict: dict):
method get_description (line 35) | def get_description() -> str:
class DataFactoryClass (line 39) | class DataFactoryClass:
method __init__ (line 40) | def __init__(self):
method register (line 45) | def register(
method get_dataset_enum (line 66) | def get_dataset_enum(self):
method get_dataset_classname (line 72) | def get_dataset_classname(self, name):
method get_constructor_arg_type (line 75) | def get_constructor_arg_type(self, model_name):
method get_pydantic_config (line 82) | def get_pydantic_config(self):
method get_import_code (line 105) | def get_import_code(self, name):
method get_import_code (line 108) | def get_import_code(self, name):
method get_extra_args (line 111) | def get_extra_args(self, name):
method get_class_name (line 114) | def get_class_name(self, name):
method get_generated_code_dict (line 117) | def get_generated_code_dict(self, name, args='**cfg["data"]'):
method filter (line 127) | def filter(self, pipeline_name):
method get_base_class (line 138) | def get_base_class(dataset_name, pipeline_name):
class PipelineFactory (line 250) | class PipelineFactory:
method register (line 258) | def register(cls, name: str) -> Callable:
method register_default_config_generator (line 270) | def register_default_config_generator(cls, name: str) -> Callable:
method call_default_config_generator (line 282) | def call_default_config_generator(
method call_generator (line 290) | def call_generator(cls, generator_name, cfg):
method get_pipeline_enum (line 294) | def get_pipeline_enum(cls):
class ApplyPipelineFactory (line 301) | class ApplyPipelineFactory:
method register (line 308) | def register(cls, name: str) -> Callable:
class ModelFactory (line 323) | class ModelFactory:
method __init__ (line 326) | def __init__(self):
method get_model_enum (line 332) | def get_model_enum(self):
method register (line 338) | def register(self, model_name: str) -> Callable:
method get_source_code (line 352) | def get_source_code(self, model_name):
method get_constructor_default_args (line 355) | def get_constructor_default_args(self, model_name):
method get_pydantic_constructor_arg_type (line 362) | def get_pydantic_constructor_arg_type(self, model_name: str):
method get_constructor_doc_dict (line 381) | def get_constructor_doc_dict(self, name):
method get_pydantic_model_config (line 390) | def get_pydantic_model_config(self):
method get_model_class_name (line 399) | def get_model_class_name(self, model_name):
method get_constructor_arg_type (line 402) | def get_constructor_arg_type(self, model_name):
method filter (line 409) | def filter(self, filter_func):
class SamplerFactory (line 418) | class SamplerFactory:
method __init__ (line 421) | def __init__(self):
method get_model_enum (line 424) | def get_model_enum(self):
method register (line 430) | def register(self, sampler_name: str) -> Callable:
method get_constructor_default_args (line 441) | def get_constructor_default_args(self, sampler_name):
method get_pydantic_constructor_arg_type (line 448) | def get_pydantic_constructor_arg_type(self, sampler_name: str):
method get_pydantic_model_config (line 470) | def get_pydantic_model_config(self):
method get_model_class_name (line 479) | def get_model_class_name(self, model_name):
method get_constructor_arg_type (line 482) | def get_constructor_arg_type(self, model_name):
method get_constructor_doc_dict (line 489) | def get_constructor_doc_dict(self, name):
FILE: dglgo/dglgo/utils/yaml_dump.py
function deep_convert_dict (line 4) | def deep_convert_dict(layer):
function merge_comment (line 20) | def merge_comment(d, comment_dict, column=30):
FILE: dglgo/tests/test_pipeline.py
class ExperimentSpec (line 12) | class ExperimentSpec(NamedTuple):
function test_train (line 28) | def test_train(spec):
function setup_recipe_folder (line 67) | def setup_recipe_folder():
function test_recipe (line 78) | def test_recipe(file, setup_recipe_folder):
FILE: examples/advanced/cugraph/graphsage.py
class SAGE (line 18) | class SAGE(nn.Module):
method __init__ (line 19) | def __init__(self, in_size, hid_size, out_size):
method forward (line 30) | def forward(self, blocks, x):
method inference (line 39) | def inference(self, g, device, batch_size):
function evaluate (line 76) | def evaluate(model, graph, dataloader):
function layerwise_infer (line 94) | def layerwise_infer(device, graph, nid, model, batch_size):
function train (line 108) | def train(args, device, g, dataset, model):
FILE: examples/advanced/cugraph/rgcn.py
class RGCN (line 23) | class RGCN(nn.Module):
method __init__ (line 24) | def __init__(self, num_nodes, h_dim, out_dim, num_rels, num_bases):
method forward (line 47) | def forward(self, g, fanouts=[None, None]):
function evaluate (line 54) | def evaluate(model, labels, dataloader, inv_target):
function train (line 75) | def train(device, g, target_idx, labels, train_mask, model, fanouts):
FILE: examples/core/Graphormer/dataset.py
class MolHIVDataset (line 13) | class MolHIVDataset(th.utils.data.Dataset):
method __init__ (line 14) | def __init__(self):
method collate (line 31) | def collate(self, samples):
FILE: examples/core/Graphormer/main.py
function train_epoch (line 46) | def train_epoch(model, optimizer, data_loader, lr_scheduler):
function evaluate_network (line 106) | def evaluate_network(model, data_loader):
function train_val_pipeline (line 153) | def train_val_pipeline(params):
FILE: examples/core/Graphormer/model.py
class Graphormer (line 10) | class Graphormer(nn.Module):
method __init__ (line 11) | def __init__(
method reset_output_layer_parameters (line 78) | def reset_output_layer_parameters(self):
method forward (line 82) | def forward(
FILE: examples/core/gat/train.py
class GAT (line 13) | class GAT(nn.Module):
method __init__ (line 14) | def __init__(self, in_size, hid_size, out_size, heads):
method forward (line 39) | def forward(self, g, inputs):
function evaluate (line 50) | def evaluate(g, features, labels, mask, model):
function train (line 61) | def train(g, features, labels, masks, model, num_epochs):
FILE: examples/core/gated_gcn/train.py
class GatedGCN (line 19) | class GatedGCN(nn.Module):
method __init__ (line 20) | def __init__(
method forward (line 54) | def forward(self, g, node_feat, edge_feat):
function train (line 69) | def train(model, device, data_loader, opt, loss_fn):
function evaluate (line 87) | def evaluate(model, device, data_loader, evaluator):
FILE: examples/core/graphsage/node_classification.py
class SAGE (line 33) | class SAGE(nn.Module):
method __init__ (line 34) | def __init__(self, in_size, hidden_size, out_size):
method forward (line 42) | def forward(self, graph, x):
function evaluate (line 53) | def evaluate(g, features, labels, mask, model):
function train (line 64) | def train(g, features, labels, masks, model):
FILE: examples/core/rgcn/hetero_rgcn.py
function prepare_data (line 71) | def prepare_data(args, device):
function extract_embed (line 134) | def extract_embed(node_embed, input_nodes):
function rel_graph_embed (line 141) | def rel_graph_embed(graph, embed_size):
class RelGraphConvLayer (line 181) | class RelGraphConvLayer(nn.Module):
method __init__ (line 182) | def __init__(
method reset_parameters (line 248) | def reset_parameters(self):
method forward (line 255) | def forward(self, g, inputs):
class EntityClassify (line 311) | class EntityClassify(nn.Module):
method __init__ (line 312) | def __init__(self, g, in_size, out_size):
method reset_parameters (line 351) | def reset_parameters(self):
method forward (line 356) | def forward(self, h, blocks):
function extract_node_features (line 362) | def extract_node_features(name, g, input_nodes, node_embed, feats, device):
function train (line 385) | def train(
function evaluate (line 472) | def evaluate(
function main (line 536) | def main(args):
FILE: examples/distributed/graphsage/node_classification.py
class DistSAGE (line 16) | class DistSAGE(nn.Module):
method __init__ (line 36) | def __init__(
method forward (line 51) | def forward(self, blocks, x):
method inference (line 70) | def inference(self, g, x, batch_size, device):
function compute_acc (line 139) | def compute_acc(pred, labels):
function evaluate (line 159) | def evaluate(model, g, inputs, labels, val_nid, test_nid, batch_size, de...
function run (line 198) | def run(args, device, data):
function main (line 338) | def main(args):
FILE: examples/distributed/graphsage/node_classification_unsupervised.py
class DistSAGE (line 20) | class DistSAGE(nn.Module):
method __init__ (line 21) | def __init__(
method forward (line 36) | def forward(self, blocks, x):
method inference (line 45) | def inference(self, g, x, batch_size, device):
method join (line 108) | def join(self):
function load_subtensor (line 113) | def load_subtensor(g, input_nodes, device):
class CrossEntropyLoss (line 121) | class CrossEntropyLoss(nn.Module):
method forward (line 122) | def forward(self, block_outputs, pos_graph, neg_graph):
function generate_emb (line 140) | def generate_emb(model, g, inputs, batch_size, device):
function compute_acc (line 155) | def compute_acc(emb, labels, train_nids, val_nids, test_nids):
function run (line 187) | def run(args, device, data):
function main (line 373) | def main(args):
FILE: examples/distributed/graphsage/partition_graph.py
function load_reddit (line 10) | def load_reddit(self_loop=True):
function load_ogb (line 19) | def load_ogb(name, root="dataset"):
FILE: examples/distributed/rgcn/lp_perf.py
function run (line 16) | def run(args, g, train_eids):
function rand_init_prob (line 133) | def rand_init_prob(shape, dtype):
function rand_init_mask (line 139) | def rand_init_mask(shape, dtype):
function main (line 145) | def main(args):
FILE: examples/distributed/rgcn/node_classification.py
class RelGraphConvLayer (line 38) | class RelGraphConvLayer(nn.Module):
method __init__ (line 62) | def __init__(
method forward (line 122) | def forward(self, g, inputs):
class EntityClassify (line 167) | class EntityClassify(nn.Module):
method __init__ (line 191) | def __init__(
method forward (line 251) | def forward(self, blocks, feats, norm=None):
function init_emb (line 262) | def init_emb(shape, dtype):
class DistEmbedLayer (line 268) | class DistEmbedLayer(nn.Module):
method __init__ (line 288) | def __init__(
method forward (line 352) | def forward(self, node_ids):
function compute_acc (line 378) | def compute_acc(results, labels):
function evaluate (line 386) | def evaluate(
function run (line 448) | def run(args, device, data):
function main (line 707) | def main(args):
FILE: examples/distributed/rgcn/partition_graph.py
function load_ogb (line 11) | def load_ogb(dataset):
FILE: examples/graphbolt/disk_based_feature/node_classification.py
function accuracy (line 18) | def accuracy(out, labels):
class SAGE (line 27) | class SAGE(nn.Module):
method __init__ (line 28) | def __init__(self, in_size, hidden_size, out_size, num_layers, dropout):
method set_layer_dtype (line 42) | def set_layer_dtype(self, _dtype):
method forward (line 47) | def forward(self, blocks, x):
method inference (line 57) | def inference(self, graph, features, dataloader, storage_device):
function create_dataloader (line 88) | def create_dataloader(
function train_step (line 139) | def train_step(minibatch, optimizer, model, loss_fn):
function train_helper (line 151) | def train_helper(
function train (line 191) | def train(
function layerwise_infer (line 239) | def layerwise_infer(
function evaluate_step (line 271) | def evaluate_step(minibatch, model):
function evaluate (line 280) | def evaluate(
function parse_args (line 307) | def parse_args():
function main (line 401) | def main():
FILE: examples/graphbolt/lightning/node_classification.py
class SAGE (line 50) | class SAGE(LightningModule):
method __init__ (line 51) | def __init__(self, in_feats, n_hidden, n_classes):
method forward (line 64) | def forward(self, blocks, x):
method log_node_and_edge_counts (line 73) | def log_node_and_edge_counts(self, blocks):
method training_step (line 95) | def training_step(self, batch, batch_idx):
method validation_step (line 112) | def validation_step(self, batch, batch_idx):
method configure_optimizers (line 128) | def configure_optimizers(self):
class DataModule (line 135) | class DataModule(LightningDataModule):
method __init__ (line 136) | def __init__(self, dataset, fanouts, batch_size, num_workers):
method create_dataloader (line 147) | def create_dataloader(self, node_set, is_train):
method train_dataloader (line 171) | def train_dataloader(self):
method val_dataloader (line 174) | def val_dataloader(self):
FILE: examples/graphbolt/link_prediction.py
class SAGE (line 57) | class SAGE(nn.Module):
method __init__ (line 58) | def __init__(self, in_size, hidden_size):
method forward (line 73) | def forward(self, blocks, x):
method inference (line 82) | def inference(self, graph, features, dataloader, storage_device):
function create_dataloader (line 113) | def create_dataloader(args, graph, features, itemset, is_train=True):
function compute_mrr (line 250) | def compute_mrr(args, model, node_emb, seeds, labels, indexes):
function evaluate (line 279) | def evaluate(args, model, graph, features, all_nodes_set, valid_set, tes...
function train (line 305) | def train(args, model, graph, features, train_set):
function parse_args (line 345) | def parse_args():
function main (line 381) | def main(args):
FILE: examples/graphbolt/node_classification.py
function create_dataloader (line 52) | def create_dataloader(
class SAGE (line 168) | class SAGE(nn.Module):
method __init__ (line 169) | def __init__(self, in_size, hidden_size, out_size):
method set_layer_dtype (line 182) | def set_layer_dtype(self, _dtype):
method forward (line 187) | def forward(self, blocks, x):
method inference (line 197) | def inference(self, graph, features, dataloader, storage_device):
function layerwise_infer (line 229) | def layerwise_infer(
function evaluate (line 256) | def evaluate(args, model, graph, features, itemset, num_classes):
function train (line 284) | def train(args, graph, features, train_set, valid_set, num_classes, model):
function parse_args (line 332) | def parse_args():
function main (line 396) | def main(args):
FILE: examples/graphbolt/pyg/hetero/node_classification.py
function accuracy (line 17) | def accuracy(out, labels):
function create_dataloader (line 26) | def create_dataloader(
class RelGraphConvLayer (line 81) | class RelGraphConvLayer(nn.Module):
method __init__ (line 82) | def __init__(
method forward (line 124) | def forward(self, subgraph, x):
class EntityClassify (line 162) | class EntityClassify(nn.Module):
method __init__ (line 163) | def __init__(self, graph, in_size, hidden_size, out_size, n_layers):
method forward (line 179) | def forward(self, subgraphs, h):
function evaluate_step (line 186) | def evaluate_step(minibatch, model):
function evaluate (line 200) | def evaluate(
function train_step (line 229) | def train_step(minibatch, optimizer, model, loss_fn):
function train_helper (line 248) | def train_helper(
function train (line 286) | def train(
function parse_args (line 322) | def parse_args():
function main (line 412) | def main():
FILE: examples/graphbolt/pyg/labor/load_dataset.py
function load_dgl (line 4) | def load_dgl(name):
function load_dataset (line 31) | def load_dataset(dataset_name, disk_based_feature_keys=None):
FILE: examples/graphbolt/pyg/labor/node_classification.py
function accuracy (line 24) | def accuracy(out, labels):
class GraphSAGE (line 33) | class GraphSAGE(torch.nn.Module):
method __init__ (line 34) | def __init__(
method forward (line 56) | def forward(self, subgraphs, x):
method inference (line 68) | def inference(self, graph, features, dataloader, storage_device):
function create_dataloader (line 105) | def create_dataloader(
function train_step (line 155) | def train_step(minibatch, optimizer, model, loss_fn, multilabel, eval_fn):
function train_helper (line 168) | def train_helper(
function train (line 210) | def train(
function layerwise_infer (line 263) | def layerwise_infer(
function evaluate_step (line 297) | def evaluate_step(minibatch, model, eval_fn):
function evaluate (line 306) | def evaluate(
function parse_args (line 334) | def parse_args():
function main (line 436) | def main():
FILE: examples/graphbolt/pyg/labor/sage_conv.py
class SAGEConv (line 13) | class SAGEConv(MessagePassing):
method __init__ (line 59) | def __init__(
method reset_parameters (line 103) | def reset_parameters(self):
method forward (line 110) | def forward(
method message (line 133) | def message(self, x_j: Tensor) -> Tensor:
method message_and_aggregate (line 136) | def message_and_aggregate(self, adj_t: Adj, x: OptPairTensor) -> Tensor:
method __repr__ (line 141) | def __repr__(self) -> str:
FILE: examples/graphbolt/pyg/link_prediction.py
class GraphSAGE (line 52) | class GraphSAGE(torch.nn.Module):
method __init__ (line 60) | def __init__(self, in_size, hidden_size, n_layers):
method forward (line 75) | def forward(self, subgraphs, x):
method inference (line 91) | def inference(self, graph, features, dataloader, storage_device):
function create_dataloader (line 124) | def create_dataloader(
function predictions_step (line 188) | def predictions_step(model, h_src, h_dst):
function compute_predictions (line 192) | def compute_predictions(model, node_emb, seeds, device):
function evaluate (line 218) | def evaluate(model, graph, features, all_nodes_set, valid_set, test_set):
function train_step (line 250) | def train_step(minibatch, optimizer, model):
function train_helper (line 265) | def train_helper(dataloader, model, optimizer, device):
function train (line 281) | def train(dataloader, model, device):
function parse_args (line 308) | def parse_args():
function main (line 390) | def main():
FILE: examples/graphbolt/pyg/multigpu/node_classification.py
function accuracy (line 72) | def accuracy(out, labels):
class GraphSAGE (line 81) | class GraphSAGE(torch.nn.Module):
method __init__ (line 91) | def __init__(self, in_size, hidden_size, out_size, n_layers, cooperati...
method forward (line 101) | def forward(self, minibatch, x):
function create_dataloader (line 124) | def create_dataloader(
function weighted_reduce (line 184) | def weighted_reduce(tensor, weight, dst=0):
function train_step (line 202) | def train_step(minibatch, optimizer, model, loss_fn):
function train_helper (line 214) | def train_helper(rank, dataloader, model, optimizer, loss_fn, device):
function train (line 236) | def train(args, rank, train_dataloader, valid_dataloader, model, device):
function evaluate_step (line 276) | def evaluate_step(minibatch, model):
function evaluate (line 285) | def evaluate(rank, model, dataloader, device):
function parse_args (line 299) | def parse_args():
function run (line 390) | def run(rank, world_size, args, dataset):
FILE: examples/graphbolt/pyg/node_classification.py
class GraphSAGE (line 64) | class GraphSAGE(torch.nn.Module):
method __init__ (line 76) | def __init__(self, in_size, hidden_size, out_size):
method forward (line 83) | def forward(self, x, edge_index):
method inference (line 91) | def inference(self, dataloader, x_all, device):
function create_dataloader (line 110) | def create_dataloader(
function train (line 134) | def train(model, dataloader, optimizer):
function evaluate (line 167) | def evaluate(model, dataloader, num_classes):
function layerwise_infer (line 187) | def layerwise_infer(
function main (line 204) | def main():
FILE: examples/graphbolt/pyg/node_classification_advanced.py
function accuracy (line 69) | def accuracy(out, labels):
class GraphSAGE (line 78) | class GraphSAGE(torch.nn.Module):
method __init__ (line 88) | def __init__(self, in_size, hidden_size, out_size, n_layers):
method forward (line 97) | def forward(self, subgraphs, x):
method inference (line 113) | def inference(self, graph, features, dataloader, storage_device):
function create_dataloader (line 146) | def create_dataloader(
function train_step (line 204) | def train_step(minibatch, optimizer, model, loss_fn):
function train_helper (line 216) | def train_helper(dataloader, model, optimizer, loss_fn, device):
function train (line 238) | def train(train_dataloader, valid_dataloader, model, device):
function layerwise_infer (line 272) | def layerwise_infer(args, graph, features, test_set, all_nodes_set, model):
function evaluate_step (line 291) | def evaluate_step(minibatch, model):
function evaluate (line 300) | def evaluate(model, dataloader, device):
function parse_args (line 312) | def parse_args():
function main (line 401) | def main():
FILE: examples/graphbolt/quickstart/link_prediction.py
function create_dataloader (line 21) | def create_dataloader(dataset, device, is_train=True):
class GraphSAGE (line 57) | class GraphSAGE(nn.Module):
method __init__ (line 58) | def __init__(self, in_size, hidden_size=16):
method forward (line 69) | def forward(self, blocks, x):
function evaluate (line 80) | def evaluate(model, dataset, device):
function train (line 117) | def train(model, dataset, device):
FILE: examples/graphbolt/quickstart/node_classification.py
function create_dataloader (line 16) | def create_dataloader(dataset, itemset, device):
class GCN (line 35) | class GCN(nn.Module):
method __init__ (line 36) | def __init__(self, in_size, out_size, hidden_size=16):
method forward (line 42) | def forward(self, blocks, x):
function evaluate (line 53) | def evaluate(model, dataset, itemset, device):
function train (line 72) | def train(model, dataset, device):
FILE: examples/graphbolt/rgcn/hetero_rgcn.py
function load_dataset (line 66) | def load_dataset(dataset_name):
function create_dataloader (line 93) | def create_dataloader(
function extract_embed (line 152) | def extract_embed(node_embed, input_nodes):
function extract_node_features (line 159) | def extract_node_features(name, block, data, node_embed, device):
function rel_graph_embed (line 185) | def rel_graph_embed(graph, embed_size):
class RelGraphConvLayer (line 230) | class RelGraphConvLayer(nn.Module):
method __init__ (line 231) | def __init__(
method reset_parameters (line 297) | def reset_parameters(self):
method forward (line 304) | def forward(self, g, inputs):
class EntityClassify (line 359) | class EntityClassify(nn.Module):
method __init__ (line 360) | def __init__(self, graph, in_size, out_size):
method reset_parameters (line 401) | def reset_parameters(self):
method forward (line 406) | def forward(self, blocks, h):
function evaluate (line 413) | def evaluate(
function train (line 478) | def train(
function main (line 560) | def main(args):
FILE: examples/graphbolt/sparse/graphsage.py
class SAGEConv (line 42) | class SAGEConv(nn.Module):
method __init__ (line 47) | def __init__(
method reset_parameters (line 60) | def reset_parameters(self):
method forward (line 65) | def forward(self, A, feat):
class SAGE (line 81) | class SAGE(nn.Module):
method __init__ (line 82) | def __init__(self, in_size, hid_size, out_size):
method forward (line 93) | def forward(self, sampled_matrices, x):
class SparseNeighborSampler (line 106) | class SparseNeighborSampler(SubgraphSampler):
method __init__ (line 107) | def __init__(self, datapipe, matrix, fanouts):
method sample_subgraphs (line 117) | def sample_subgraphs(self, seeds, seeds_timestamp=None):
function create_dataloader (line 141) | def create_dataloader(A, fanouts, ids, features, device):
function evaluate (line 152) | def evaluate(model, dataloader, num_classes):
function validate (line 172) | def validate(device, dataset, model, num_classes):
function train (line 181) | def train(device, A, features, dataset, num_classes, model):
FILE: examples/graphbolt/temporal_link_prediction.py
class CategoricalEncoder (line 61) | class CategoricalEncoder(nn.Module):
method __init__ (line 62) | def __init__(
method reset_parameters (line 71) | def reset_parameters(self):
method forward (line 74) | def forward(self, input_feat: torch.Tensor):
class HeteroSAGE (line 78) | class HeteroSAGE(nn.Module):
method __init__ (line 79) | def __init__(self, in_size, hidden_size):
method forward (line 105) | def forward(self, blocks, X_node_dict):
function create_dataloader (line 117) | def create_dataloader(args, graph, features, itemset, is_train=True):
function train (line 163) | def train(args, model, graph, features, train_set, encoders):
function parse_args (line 221) | def parse_args():
function download_datasets (line 269) | def download_datasets(name, root="datasets"):
function main (line 282) | def main(args):
FILE: examples/legacy/link_prediction.py
function to_bidirected_with_reverse_mapping (line 61) | def to_bidirected_with_reverse_mapping(g):
class SAGE (line 133) | class SAGE(nn.Module):
method __init__ (line 134) | def __init__(self, in_size, hidden_size):
method forward (line 150) | def forward(self, pair_graph, neg_pair_graph, blocks, x):
method inference (line 163) | def inference(self, g, device, batch_size):
function compute_mrr (line 234) | def compute_mrr(
function evaluate (line 265) | def evaluate(device, graph, edge_split, model, batch_size):
function train (line 287) | def train(
function parse_args (line 391) | def parse_args():
function main (line 439) | def main(args):
FILE: examples/legacy/node_classification.py
class SAGE (line 56) | class SAGE(nn.Module):
method __init__ (line 57) | def __init__(self, in_size, hidden_size, out_size):
method forward (line 68) | def forward(self, blocks, x):
method inference (line 78) | def inference(self, g, device, batch_size, fused_sampling: bool = True):
function evaluate (line 155) | def evaluate(model, graph, dataloader, num_classes):
function layerwise_infer (line 172) | def layerwise_infer(
function train (line 184) | def train(device, g, dataset, model, num_classes, use_uva, fused_sampling):
FILE: examples/multigpu/graphbolt/node_classification.py
class SAGE (line 56) | class SAGE(nn.Module):
method __init__ (line 57) | def __init__(self, in_size, hidden_size, out_size):
method set_layer_dtype (line 70) | def set_layer_dtype(self, dtype):
method forward (line 75) | def forward(self, blocks, x):
function create_dataloader (line 86) | def create_dataloader(
function weighted_reduce (line 153) | def weighted_reduce(tensor, weight, dst=0):
function evaluate (line 171) | def evaluate(rank, model, dataloader, num_classes, device):
function train (line 192) | def train(
function run (line 275) | def run(rank, world_size, args, devices, dataset):
function parse_args (line 370) | def parse_args():
FILE: examples/multigpu/node_classification_sage.py
class SAGE (line 61) | class SAGE(nn.Module):
method __init__ (line 62) | def __init__(self, in_size, hid_size, out_size):
method forward (line 73) | def forward(self, blocks, x):
method inference (line 82) | def inference(self, g, device, batch_size, use_uva):
function evaluate (line 126) | def evaluate(device, model, g, num_classes, dataloader):
function layerwise_infer (line 144) | def layerwise_infer(
function train (line 161) | def train(
function run (line 250) | def run(proc_id, nprocs, devices, g, data, args):
FILE: examples/mxnet/appnp/appnp.py
class APPNP (line 19) | class APPNP(nn.Block):
method __init__ (line 20) | def __init__(
method forward (line 51) | def forward(self, features):
function evaluate (line 64) | def evaluate(model, features, labels, mask):
function main (line 70) | def main(args):
FILE: examples/mxnet/gat/gat.py
class GAT (line 15) | class GAT(nn.Block):
method __init__ (line 16) | def __init__(
method forward (line 70) | def forward(self, inputs):
FILE: examples/mxnet/gat/train.py
function elu (line 30) | def elu(data):
function evaluate (line 34) | def evaluate(model, features, labels, mask):
function main (line 43) | def main(args):
FILE: examples/mxnet/gat/utils.py
class EarlyStopping (line 4) | class EarlyStopping:
method __init__ (line 5) | def __init__(self, patience=10):
method step (line 11) | def step(self, acc, model):
method save_checkpoint (line 29) | def save_checkpoint(self, model):
FILE: examples/mxnet/gcn/gcn.py
class GCN (line 14) | class GCN(gluon.Block):
method __init__ (line 15) | def __init__(
method forward (line 32) | def forward(self, features):
FILE: examples/mxnet/gcn/gcn_concat.py
class GCNLayer (line 23) | class GCNLayer(gluon.Block):
method __init__ (line 24) | def __init__(self, g, out_feats, activation, dropout):
method forward (line 30) | def forward(self, h):
class GCN (line 44) | class GCN(gluon.Block):
method __init__ (line 45) | def __init__(self, g, n_hidden, n_classes, n_layers, activation, dropo...
method forward (line 54) | def forward(self, features):
function evaluate (line 65) | def evaluate(model, features, labels, mask):
function main (line 71) | def main(args):
FILE: examples/mxnet/gcn/gcn_mp.py
function gcn_msg (line 12) | def gcn_msg(edge):
function gcn_reduce (line 17) | def gcn_reduce(node):
class NodeUpdate (line 22) | class NodeUpdate(gluon.Block):
method __init__ (line 23) | def __init__(self, out_feats, activation=None, bias=True):
method forward (line 34) | def forward(self, node):
class GCNLayer (line 43) | class GCNLayer(gluon.Block):
method __init__ (line 44) | def __init__(self, g, in_feats, out_feats, activation, dropout, bias=T...
method forward (line 54) | def forward(self, h):
class GCN (line 64) | class GCN(gluon.Block):
method __init__ (line 65) | def __init__(
method forward (line 80) | def forward(self, features):
FILE: examples/mxnet/gcn/train.py
function evaluate (line 17) | def evaluate(model, features, labels, mask):
function main (line 23) | def main(args):
FILE: examples/mxnet/gin/dataloader.py
class SubsetRandomSampler (line 15) | class SubsetRandomSampler(Sampler):
method __init__ (line 16) | def __init__(self, indices):
method __iter__ (line 19) | def __iter__(self):
method __len__ (line 24) | def __len__(self):
function collate (line 29) | def collate(samples):
class GraphDataLoader (line 43) | class GraphDataLoader:
method __init__ (line 44) | def __init__(
method train_valid_loader (line 87) | def train_valid_loader(self):
method _split_fold10 (line 90) | def _split_fold10(self, labels, fold_idx=0, seed=0, shuffle=True):
method _split_rand (line 108) | def _split_rand(self, labels, split_ratio=0.7, seed=0, shuffle=True):
FILE: examples/mxnet/gin/gin.py
class ApplyNodeFunc (line 16) | class ApplyNodeFunc(nn.Block):
method __init__ (line 19) | def __init__(self, mlp):
method forward (line 25) | def forward(self, h):
class MLP (line 32) | class MLP(nn.Block):
method __init__ (line 35) | def __init__(self, num_layers, input_dim, hidden_dim, output_dim):
method forward (line 73) | def forward(self, x):
class GIN (line 83) | class GIN(nn.Block):
method __init__ (line 86) | def __init__(
method forward (line 173) | def forward(self, g, h):
FILE: examples/mxnet/gin/main.py
function train (line 15) | def train(args, net, trainloader, trainer, criterion, epoch):
function eval_net (line 47) | def eval_net(args, net, dataloader, criterion):
function main (line 73) | def main(args):
FILE: examples/mxnet/gin/parser.py
class Parser (line 8) | class Parser:
method __init__ (line 9) | def __init__(self, description):
method _parse (line 17) | def _parse(self):
FILE: examples/mxnet/graphsage/main.py
class GraphSAGE (line 26) | class GraphSAGE(nn.Block):
method __init__ (line 27) | def __init__(
method forward (line 75) | def forward(self, features):
function evaluate (line 82) | def evaluate(model, features, labels, mask):
function main (line 88) | def main(args):
FILE: examples/mxnet/monet/citation.py
class MoNet (line 20) | class MoNet(nn.Block):
method __init__ (line 21) | def __init__(
method forward (line 55) | def forward(self, feat, pseudo):
function evaluate (line 64) | def evaluate(model, features, pseudo, labels, mask):
function main (line 70) | def main(args):
FILE: examples/mxnet/rgcn/entity_classify.py
class EntityClassify (line 26) | class EntityClassify(BaseRGCN):
method build_input_layer (line 27) | def build_input_layer(self):
method build_hidden_layer (line 39) | def build_hidden_layer(self, idx):
method build_output_layer (line 51) | def build_output_layer(self):
function main (line 63) | def main(args):
FILE: examples/mxnet/rgcn/model.py
class BaseRGCN (line 5) | class BaseRGCN(gluon.Block):
method __init__ (line 6) | def __init__(
method build_model (line 32) | def build_model(self):
method build_input_layer (line 47) | def build_input_layer(self):
method build_hidden_layer (line 50) | def build_hidden_layer(self):
method build_output_layer (line 53) | def build_output_layer(self):
method forward (line 56) | def forward(self, g, h, r, norm):
FILE: examples/mxnet/scenegraph/data/dataloader.py
function dgl_mp_batchify_fn (line 7) | def dgl_mp_batchify_fn(data):
FILE: examples/mxnet/scenegraph/data/object.py
class VGObject (line 16) | class VGObject(COCODetection):
method __init__ (line 170) | def __init__(self, **kwargs):
method annotation_dir (line 174) | def annotation_dir(self):
method _parse_image_path (line 177) | def _parse_image_path(self, entry):
FILE: examples/mxnet/scenegraph/data/prepare_visualgenome.py
function parse_args (line 16) | def parse_args():
function download_vg (line 42) | def download_vg(path, overwrite=False):
function download_json (line 72) | def download_json(path, overwrite=False):
FILE: examples/mxnet/scenegraph/data/relation.py
class VGRelation (line 22) | class VGRelation(VisionDataset):
method __init__ (line 23) | def __init__(
method __len__ (line 68) | def __len__(self):
method _hash_bbox (line 71) | def _hash_bbox(self, object):
method __getitem__ (line 75) | def __getitem__(self, idx):
FILE: examples/mxnet/scenegraph/demo_reldn.py
function parse_args (line 14) | def parse_args():
FILE: examples/mxnet/scenegraph/model/faster_rcnn.py
class FasterRCNN (line 30) | class FasterRCNN(RCNN):
method __init__ (line 170) | def __init__(
method target_generator (line 275) | def target_generator(self):
method reset_class (line 286) | def reset_class(self, classes, reuse_weights=None):
method _pyramid_roi_feats (line 317) | def _pyramid_roi_feats(
method hybrid_forward (line 416) | def hybrid_forward(self, F, x, gt_box=None, gt_label=None, m_rpn_box=N...
function get_faster_rcnn (line 697) | def get_faster_rcnn(
function faster_rcnn_resnet50_v1b_coco (line 747) | def faster_rcnn_resnet50_v1b_coco(
function faster_rcnn_resnet50_v1b_custom (line 836) | def faster_rcnn_resnet50_v1b_custom(
function faster_rcnn_resnet101_v1d_coco (line 941) | def faster_rcnn_resnet101_v1d_coco(
function faster_rcnn_resnet101_v1d_custom (line 1029) | def faster_rcnn_resnet101_v1d_custom(
FILE: examples/mxnet/scenegraph/model/reldn.py
class EdgeConfMLP (line 16) | class EdgeConfMLP(nn.Block):
method __init__ (line 19) | def __init__(self):
method forward (line 22) | def forward(self, edges):
class EdgeBBoxExtend (line 32) | class EdgeBBoxExtend(nn.Block):
method __init__ (line 35) | def __init__(self):
method bbox_delta (line 38) | def bbox_delta(self, bbox_a, bbox_b):
method forward (line 53) | def forward(self, edges):
class EdgeFreqPrior (line 72) | class EdgeFreqPrior(nn.Block):
method __init__ (line 75) | def __init__(self, prior_pkl):
method forward (line 81) | def forward(self, edges):
class EdgeSpatial (line 90) | class EdgeSpatial(nn.Block):
method __init__ (line 93) | def __init__(self, n_classes):
method forward (line 102) | def forward(self, edges):
class EdgeVisual (line 113) | class EdgeVisual(nn.Block):
method __init__ (line 116) | def __init__(self, n_classes, vis_feat_dim=7 * 7 * 3):
method forward (line 129) | def forward(self, edges):
class RelDN (line 142) | class RelDN(nn.Block):
method __init__ (line 145) | def __init__(self, n_classes, prior_pkl, semantic_only=False):
method forward (line 160) | def forward(self, g):
FILE: examples/mxnet/scenegraph/train_faster_rcnn.py
function parse_args (line 43) | def parse_args():
function get_dataset (line 273) | def get_dataset(dataset, args):
function get_dataloader (line 317) | def get_dataloader(
function save_params (line 373) | def save_params(
function split_and_load (line 399) | def split_and_load(batch, ctx_list):
function validate (line 411) | def validate(net, val_data, ctx, eval_metric, args):
function get_lr_at_iter (line 456) | def get_lr_at_iter(alpha, lr_warmup_factor=1.0 / 3.0):
class ForwardBackwardTask (line 460) | class ForwardBackwardTask(Parallelizable):
method __init__ (line 461) | def __init__(
method forward_backward (line 480) | def forward_backward(self, x):
function train (line 569) | def train(net, train_data, val_data, eval_metric, batch_size, ctx, args):
FILE: examples/mxnet/scenegraph/train_freq_prior.py
function parse_args (line 9) | def parse_args():
function with_overlap (line 33) | def with_overlap(boxA, boxB):
function box_ious (line 47) | def box_ious(boxes):
FILE: examples/mxnet/scenegraph/train_reldn.py
function parse_args (line 17) | def parse_args():
function get_data_batch (line 193) | def get_data_batch(g_list, img_list, ctx_list):
function batch_print (line 233) | def batch_print(
FILE: examples/mxnet/scenegraph/utils/build_graph.py
function bbox_improve (line 6) | def bbox_improve(bbox):
function extract_edge_bbox (line 12) | def extract_edge_bbox(g):
function build_graph_train (line 26) | def build_graph_train(
function build_graph_validate_gt_obj (line 167) | def build_graph_validate_gt_obj(
function build_graph_validate_gt_bbox (line 222) | def build_graph_validate_gt_bbox(
function build_graph_validate_pred (line 284) | def build_graph_validate_pred(
FILE: examples/mxnet/scenegraph/utils/metric.py
function iou (line 17) | def iou(boxA, boxB):
function object_iou_thresh (line 37) | def object_iou_thresh(gt_object, pred_object, iou_thresh=0.5):
function triplet_iou_thresh (line 44) | def triplet_iou_thresh(pred_triplet, gt_triplet, iou_thresh=0.5):
class AUCMetric (line 55) | class AUCMetric(mx.metric.EvalMetric):
method __init__ (line 56) | def __init__(self, name="auc", eps=1e-12):
method update (line 60) | def update(self, labels, preds):
class PredCls (line 91) | class PredCls(mx.metric.EvalMetric):
method __init__ (line 94) | def __init__(self, topk=20, iou_thresh=0.99):
method update (line 99) | def update(self, labels, preds):
class PhrCls (line 127) | class PhrCls(mx.metric.EvalMetric):
method __init__ (line 130) | def __init__(self, topk=20, iou_thresh=0.99):
method update (line 135) | def update(self, labels, preds):
class SGDet (line 165) | class SGDet(mx.metric.EvalMetric):
method __init__ (line 168) | def __init__(self, topk=20, iou_thresh=0.5):
method update (line 173) | def update(self, labels, preds):
class SGDetPlus (line 203) | class SGDetPlus(mx.metric.EvalMetric):
method __init__ (line 206) | def __init__(self, topk=20, iou_thresh=0.5):
method update (line 211) | def update(self, labels, preds):
function extract_gt (line 266) | def extract_gt(g, img_size):
function extract_pred (line 308) | def extract_pred(g, topk=100, joint_preds=False):
FILE: examples/mxnet/scenegraph/utils/sampling.py
function l0_sample (line 7) | def l0_sample(g, positive_max=128, negative_ratio=3):
FILE: examples/mxnet/scenegraph/utils/viz.py
function plot_sg (line 6) | def plot_sg(img, preds, obj_classes, rel_classes, topk=1):
FILE: examples/mxnet/scenegraph/validate_reldn.py
function parse_args (line 16) | def parse_args():
function get_data_batch (line 163) | def get_data_batch(g_list, img_list, ctx_list):
FILE: examples/mxnet/sgc/sgc.py
function evaluate (line 27) | def evaluate(model, g, features, labels, mask):
function main (line 33) | def main(args):
FILE: examples/mxnet/tagcn/tagcn.py
class TAGCN (line 13) | class TAGCN(gluon.Block):
method __init__ (line 14) | def __init__(
method forward (line 29) | def forward(self, features):
FILE: examples/mxnet/tagcn/train.py
function evaluate (line 19) | def evaluate(model, features, labels, mask):
function main (line 25) | def main(args):
FILE: examples/mxnet/tree_lstm/train.py
function batcher (line 23) | def batcher(ctx):
function prepare_glove (line 36) | def prepare_glove():
function main (line 60) | def main(args):
FILE: examples/mxnet/tree_lstm/tree_lstm.py
class _TreeLSTMCellNodeFunc (line 16) | class _TreeLSTMCellNodeFunc(gluon.HybridBlock):
method hybrid_forward (line 17) | def hybrid_forward(self, F, iou, b_iou, c):
class _TreeLSTMCellReduceFunc (line 27) | class _TreeLSTMCellReduceFunc(gluon.HybridBlock):
method __init__ (line 28) | def __init__(self, U_iou, U_f):
method hybrid_forward (line 33) | def hybrid_forward(self, F, h, c):
class _TreeLSTMCell (line 41) | class _TreeLSTMCell(gluon.HybridBlock):
method __init__ (line 42) | def __init__(self, h_size):
method message_func (line 49) | def message_func(self, edges):
method apply_node_func (line 52) | def apply_node_func(self, nodes):
class TreeLSTMCell (line 59) | class TreeLSTMCell(_TreeLSTMCell):
method __init__ (line 60) | def __init__(self, x_size, h_size):
method reduce_func (line 68) | def reduce_func(self, nodes):
class ChildSumTreeLSTMCell (line 74) | class ChildSumTreeLSTMCell(_TreeLSTMCell):
method __init__ (line 75) | def __init__(self, x_size, h_size):
method reduce_func (line 81) | def reduce_func(self, nodes):
class TreeLSTM (line 88) | class TreeLSTM(gluon.nn.Block):
method __init__ (line 89) | def __init__(
method forward (line 113) | def forward(self, batch, h, c):
FILE: examples/pytorch/GATNE-T/src/main.py
function get_graph (line 20) | def get_graph(network_data, vocab):
class NeighborSampler (line 53) | class NeighborSampler(object):
method __init__ (line 54) | def __init__(self, g, num_fanouts):
method sample (line 58) | def sample(self, pairs):
class DGLGATNE (line 77) | class DGLGATNE(nn.Module):
method __init__ (line 78) | def __init__(
method reset_parameters (line 113) | def reset_parameters(self):
method forward (line 127) | def forward(self, block):
class NSLoss (line 201) | class NSLoss(nn.Module):
method __init__ (line 202) | def __init__(self, num_nodes, num_sampled, embedding_size):
method reset_parameters (line 222) | def reset_parameters(self):
method forward (line 225) | def forward(self, input, embs, label):
function train_model (line 242) | def train_model(network_data):
FILE: examples/pytorch/GATNE-T/src/main_sparse.py
function get_graph (line 20) | def get_graph(network_data, vocab):
class NeighborSampler (line 53) | class NeighborSampler(object):
method __init__ (line 54) | def __init__(self, g, num_fanouts):
method sample (line 58) | def sample(self, pairs):
class DGLGATNE (line 78) | class DGLGATNE(nn.Module):
method __init__ (line 79) | def __init__(
method reset_parameters (line 114) | def reset_parameters(self):
method forward (line 128) | def forward(self, block):
class NSLoss (line 201) | class NSLoss(nn.Module):
method __init__ (line 202) | def __init__(self, num_nodes, num_sampled, embedding_size):
method reset_parameters (line 222) | def reset_parameters(self):
method forward (line 227) | def forward(self, input, embs, label):
function train_model (line 248) | def train_model(network_data):
FILE: examples/pytorch/GATNE-T/src/main_sparse_multi_gpus.py
function setup_seed (line 23) | def setup_seed(seed):
function get_graph (line 31) | def get_graph(network_data, vocab):
class NeighborSampler (line 64) | class NeighborSampler(object):
method __init__ (line 65) | def __init__(self, g, num_fanouts):
method sample (line 69) | def sample(self, pairs):
class DGLGATNE (line 89) | class DGLGATNE(nn.Module):
method __init__ (line 90) | def __init__(
method reset_parameters (line 125) | def reset_parameters(self):
method forward (line 139) | def forward(self, block):
class NSLoss (line 212) | class NSLoss(nn.Module):
method __init__ (line 213) | def __init__(self, num_nodes, num_sampled, embedding_size):
method reset_parameters (line 233) | def reset_parameters(self):
method forward (line 238) | def forward(self, input, embs, label):
function run (line 259) | def run(proc_id, n_gpus, args, devices, data):
function train_model (line 505) | def train_model(network_data):
FILE: examples/pytorch/GATNE-T/src/utils.py
function parse_args (line 15) | def parse_args():
function load_training_data (line 135) | def load_training_data(f_name):
function load_testing_data (line 154) | def load_testing_data(f_name):
function load_node_type (line 178) | def load_node_type(f_name):
function generate_pairs_parallel (line 188) | def generate_pairs_parallel(walks, skip_window=None, layer_id=None):
function generate_pairs (line 201) | def generate_pairs(all_walks, window_size, num_workers):
function generate_vocab (line 236) | def generate_vocab(network_data):
function get_score (line 258) | def get_score(local_model, edge):
function evaluate (line 270) | def evaluate(model, true_edges, false_edges, num_workers):
FILE: examples/pytorch/GNN-FiLM/data_loader.py
function batcher (line 12) | def batcher(device):
function load_PPI (line 23) | def load_PPI(batch_size=1, device="cpu"):
FILE: examples/pytorch/GNN-FiLM/main.py
class GNNFiLMLayer (line 15) | class GNNFiLMLayer(nn.Module):
method __init__ (line 16) | def __init__(self, in_size, out_size, etypes, dropout=0.1):
method forward (line 40) | def forward(self, g, feat_dict):
class GNNFiLM (line 76) | class GNNFiLM(nn.Module):
method __init__ (line 77) | def __init__(
method forward (line 91) | def forward(self, g, out_key):
function main (line 104) | def main(args):
FILE: examples/pytorch/GNN-FiLM/utils.py
function evaluate_f1_score (line 6) | def evaluate_f1_score(pred, label):
FILE: examples/pytorch/NGCF/NGCF/main.py
function main (line 11) | def main(args):
FILE: examples/pytorch/NGCF/NGCF/model.py
class NGCFLayer (line 7) | class NGCFLayer(nn.Module):
method __init__ (line 8) | def __init__(self, in_size, out_size, norm_dict, dropout):
method forward (line 32) | def forward(self, g, feat_dict):
class NGCF (line 70) | class NGCF(nn.Module):
method __init__ (line 71) | def __init__(self, g, in_size, layer_size, dropout, lmbd=1e-5):
method create_bpr_loss (line 114) | def create_bpr_loss(self, users, pos_items, neg_items):
method rating (line 130) | def rating(self, u_g_embeddings, pos_i_g_embeddings):
method forward (line 133) | def forward(self, g, user_key, item_key, users, pos_items, neg_items):
FILE: examples/pytorch/NGCF/NGCF/utility/batch_test.py
function ranklist_by_heapq (line 25) | def ranklist_by_heapq(user_pos_test, test_items, rating, Ks):
function get_auc (line 43) | def get_auc(item_score, user_pos_test):
function ranklist_by_sorted (line 59) | def ranklist_by_sorted(user_pos_test, test_items, rating, Ks):
function get_performance (line 77) | def get_performance(user_pos_test, r, auc, Ks):
function test_one_user (line 95) | def test_one_user(x):
function test (line 120) | def test(model, g, users_to_test, batch_test_flag=False):
FILE: examples/pytorch/NGCF/NGCF/utility/helper.py
function txt2list (line 13) | def txt2list(file_src):
function ensureDir (line 19) | def ensureDir(dir_path):
function uni2str (line 25) | def uni2str(unicode_str):
function hasNumbers (line 29) | def hasNumbers(inputString):
function delMultiChar (line 33) | def delMultiChar(inputString, chars):
function merge_two_dicts (line 39) | def merge_two_dicts(x, y):
function early_stopping (line 45) | def early_stopping(
FILE: examples/pytorch/NGCF/NGCF/utility/load_data.py
class Data (line 11) | class Data(object):
method __init__ (line 12) | def __init__(self, path, batch_size):
method sample (line 94) | def sample(self):
method get_num_users_items (line 138) | def get_num_users_items(self):
method print_statistics (line 141) | def print_statistics(self):
FILE: examples/pytorch/NGCF/NGCF/utility/metrics.py
function recall (line 15) | def recall(rank, ground_truth, N):
function precision_at_k (line 21) | def precision_at_k(r, k):
function average_precision (line 34) | def average_precision(r, cut):
function mean_average_precision (line 47) | def mean_average_precision(rs):
function dcg_at_k (line 56) | def dcg_at_k(r, k, method=1):
function ndcg_at_k (line 74) | def ndcg_at_k(r, k, method=1):
function recall_at_k (line 87) | def recall_at_k(r, k, all_pos_num):
function hit_at_k (line 92) | def hit_at_k(r, k):
function F1 (line 100) | def F1(pre, rec):
function auc (line 107) | def auc(ground_truth, prediction):
FILE: examples/pytorch/NGCF/NGCF/utility/parser.py
function parse_args (line 7) | def parse_args():
FILE: examples/pytorch/P-GNN/main.py
function get_loss (line 16) | def get_loss(p, data, out, loss_func, device, get_auc=True):
function train_model (line 59) | def train_model(data, model, loss_func, optimizer, device, g_data):
function eval_model (line 73) | def eval_model(data, g_data, model, loss_func, device):
function main (line 90) | def main(args):
FILE: examples/pytorch/P-GNN/model.py
class PGNN_layer (line 7) | class PGNN_layer(nn.Module):
method __init__ (line 8) | def __init__(self, input_dim, output_dim):
method forward (line 17) | def forward(self, graph, feature, anchor_eid, dists_max):
class PGNN (line 46) | class PGNN(nn.Module):
method __init__ (line 47) | def __init__(self, input_dim, feature_dim=32, dropout=0.5):
method forward (line 55) | def forward(self, data):
FILE: examples/pytorch/P-GNN/utils.py
function get_communities (line 11) | def get_communities(remove_feature):
function to_single_directed (line 59) | def to_single_directed(edges):
function split_edges (line 71) | def split_edges(p, edges, data, non_train_ratio=0.2):
function to_bidirected (line 86) | def to_bidirected(edges):
function get_negative_edges (line 90) | def get_negative_edges(positive_edges, num_nodes, num_negative_edges):
function get_pos_neg_edges (line 112) | def get_pos_neg_edges(data, infer_link_positive=True):
function shortest_path (line 128) | def shortest_path(graph, node_range, cutoff):
function merge_dicts (line 137) | def merge_dicts(dicts):
function all_pairs_shortest_path (line 144) | def all_pairs_shortest_path(graph, cutoff=None, num_workers=4):
function precompute_dist_data (line 167) | def precompute_dist_data(edge_index, num_nodes, approximate=0):
function get_dataset (line 191) | def get_dataset(args):
function get_anchors (line 220) | def get_anchors(n):
function get_dist_max (line 233) | def get_dist_max(anchor_set_id, dist):
function get_a_graph (line 249) | def get_a_graph(dists_max, dists_argmax):
function get_graphs (line 272) | def get_graphs(data, anchor_sets):
function merge_result (line 288) | def merge_result(outputs):
function preselect_anchor (line 303) | def preselect_anchor(data, args, num_workers=4):
FILE: examples/pytorch/TAHIN/TAHIN.py
class SemanticAttention (line 10) | class SemanticAttention(nn.Module):
method __init__ (line 11) | def __init__(self, in_size, hidden_size=128):
method forward (line 20) | def forward(self, z):
class HANLayer (line 36) | class HANLayer(nn.Module):
method __init__ (line 37) | def __init__(
method forward (line 66) | def forward(self, g, h):
class RelationalAGG (line 88) | class RelationalAGG(nn.Module):
method __init__ (line 89) | def __init__(self, g, in_size, out_size, dropout=0.1):
method forward (line 113) | def forward(self, g, feat_dict):
class TAHIN (line 156) | class TAHIN(nn.Module):
method __init__ (line 157) | def __init__(
method forward (line 205) | def forward(self, g, user_key, item_key, user_idx, item_idx):
FILE: examples/pytorch/TAHIN/data_loader.py
function split_data (line 13) | def split_data(hg, etype_name):
function process_amazon (line 47) | def process_amazon(root_path):
function process_movielens (line 169) | def process_movielens(root_path):
class MyDataset (line 302) | class MyDataset(Dataset):
method __init__ (line 303) | def __init__(self, triple):
method __getitem__ (line 307) | def __getitem__(self, index):
method __len__ (line 314) | def __len__(self):
function load_data (line 318) | def load_data(dataset, batch_size=128, num_workers=10, root_path="./data"):
FILE: examples/pytorch/TAHIN/main.py
function main (line 20) | def main(args):
FILE: examples/pytorch/TAHIN/utils.py
function evaluate_auc (line 4) | def evaluate_auc(pred, label):
function evaluate_acc (line 9) | def evaluate_acc(pred, label):
function evaluate_f1_score (line 16) | def evaluate_f1_score(pred, label):
function evaluate_logloss (line 23) | def evaluate_logloss(pred, label):
FILE: examples/pytorch/appnp/appnp.py
class APPNP (line 13) | class APPNP(nn.Module):
method __init__ (line 14) | def __init__(
method reset_parameters (line 44) | def reset_parameters(self):
method forward (line 48) | def forward(self, features):
FILE: examples/pytorch/appnp/train.py
function evaluate (line 19) | def evaluate(model, features, labels, mask):
function main (line 30) | def main(args):
FILE: examples/pytorch/argo/argo.py
function transform (line 22) | def transform(self, X):
function inverse_transform (line 48) | def inverse_transform(self, X):
class ARGO (line 66) | class ARGO:
method __init__ (line 67) | def __init__(
method core_binder (line 104) | def core_binder(
method auto_tuning (line 154) | def auto_tuning(self, train: Callable, args) -> List[int]:
method mp_engine (line 190) | def mp_engine(self, x: List[int], train: Callable, args, ep: int) -> f...
method run (line 251) | def run(self, train, args):
FILE: examples/pytorch/argo/main.py
class GNN (line 23) | class GNN(nn.Module):
method __init__ (line 24) | def __init__(
method forward (line 57) | def forward(self, blocks, x):
function _train (line 74) | def _train(**kwargs):
function train (line 117) | def train(
FILE: examples/pytorch/argo/ogb_example.py
class SAGE (line 20) | class SAGE(nn.Module):
method __init__ (line 21) | def __init__(
method forward (line 36) | def forward(self, blocks, x):
method inference (line 52) | def inference(self, g, x, device):
function compute_acc (line 100) | def compute_acc(pred, labels):
function evaluate (line 107) | def evaluate(model, g, nfeat, labels, val_nid, test_nid, device):
function load_subtensor (line 127) | def load_subtensor(nfeat, labels, seeds, input_nodes):
function train (line 137) | def train(args, device, data):
FILE: examples/pytorch/argo/ogb_example_ARGO.py
class SAGE (line 31) | class SAGE(nn.Module):
method __init__ (line 32) | def __init__(
method forward (line 47) | def forward(self, blocks, x):
method inference (line 63) | def inference(self, g, x, device):
function compute_acc (line 111) | def compute_acc(pred, labels):
function evaluate (line 118) | def evaluate(model, g, nfeat, labels, val_nid, test_nid, device):
function load_subtensor (line 138) | def load_subtensor(nfeat, labels, seeds, input_nodes):
function train (line 148) | def train(
FILE: examples/pytorch/arma/citation.py
function main (line 16) | def main(args):
FILE: examples/pytorch/arma/model.py
function glorot (line 10) | def glorot(tensor):
function zeros (line 16) | def zeros(tensor):
class ARMAConv (line 21) | class ARMAConv(nn.Module):
method __init__ (line 22) | def __init__(
method reset_parameters (line 72) | def reset_parameters(self):
method forward (line 79) | def forward(self, g, feats):
class ARMA4NC (line 114) | class ARMA4NC(nn.Module):
method __init__ (line 115) | def __init__(
method forward (line 147) | def forward(self, g, feats):
FILE: examples/pytorch/bgnn/BGNN.py
class BGNNPredictor (line 15) | class BGNNPredictor:
method __init__ (line 56) | def __init__(
method init_gbdt_model (line 90) | def init_gbdt_model(self, num_epochs, epoch):
method fit_gbdt (line 111) | def fit_gbdt(self, pool, trees_per_epoch, epoch):
method append_gbdt_model (line 116) | def append_gbdt_model(self, new_gbdt_model, weights):
method train_gbdt (line 121) | def train_gbdt(
method update_node_features (line 139) | def update_node_features(self, node_features, X, original_X):
method update_gbdt_targets (line 168) | def update_gbdt_targets(
method init_node_features (line 178) | def init_node_features(self, X):
method init_optimizer (line 188) | def init_optimizer(
method train_model (line 197) | def train_model(self, model_in, target_labels, train_mask, optimizer):
method evaluate_model (line 221) | def evaluate_model(self, logits, target_labels, mask):
method train_and_evaluate (line 246) | def train_and_evaluate(
method update_early_stopping (line 279) | def update_early_stopping(
method log_epoch (line 300) | def log_epoch(
method fit (line 323) | def fit(
method predict (line 486) | def predict(self, graph, X, test_mask):
method plot_interactive (line 496) | def plot_interactive(
FILE: examples/pytorch/bgnn/run.py
class GNNModelDGL (line 23) | class GNNModelDGL(torch.nn.Module):
method __init__ (line 24) | def __init__(
method forward (line 86) | def forward(self, graph, features):
function read_input (line 117) | def read_input(input_folder):
function normalize_features (line 145) | def normalize_features(X, train_mask, val_mask, test_mask):
function replace_na (line 153) | def replace_na(X, train_mask):
function encode_cat_features (line 159) | def encode_cat_features(X, y, cat_features, train_mask, val_mask, test_m...
FILE: examples/pytorch/bgrl/eval_function.py
function fit_logistic_regression (line 10) | def fit_logistic_regression(X, y, data_random_seed=1, repeat=1):
function fit_logistic_regression_preset_splits (line 53) | def fit_logistic_regression_preset_splits(
function fit_ppi_linear (line 103) | def fit_ppi_linear(
FILE: examples/pytorch/bgrl/main.py
function train (line 29) | def train(
function eval (line 76) | def eval(model, dataset, device, args, train_data, val_data, test_data):
function main (line 123) | def main(args):
FILE: examples/pytorch/bgrl/model.py
class LayerNorm (line 12) | class LayerNorm(nn.Module):
method __init__ (line 13) | def __init__(self, in_channels, eps=1e-5, affine=True):
method reset_parameters (line 27) | def reset_parameters(self):
method forward (line 31) | def forward(self, x, batch=None):
method __repr__ (line 68) | def __repr__(self):
class MLP_Predictor (line 72) | class MLP_Predictor(nn.Module):
method __init__ (line 80) | def __init__(self, input_size, output_size, hidden_size=512):
method forward (line 90) | def forward(self, x):
method reset_parameters (line 93) | def reset_parameters(self):
class GCN (line 100) | class GCN(nn.Module):
method __init__ (line 101) | def __init__(self, layer_sizes, batch_norm_mm=0.99):
method forward (line 110) | def forward(self, g):
method reset_parameters (line 119) | def reset_parameters(self):
class GraphSAGE_GCN (line 125) | class GraphSAGE_GCN(nn.Module):
method __init__ (line 126) | def __init__(self, layer_sizes):
method forward (line 162) | def forward(self, g):
method reset_parameters (line 184) | def reset_parameters(self):
class BGRL (line 195) | class BGRL(nn.Module):
method __init__ (line 205) | def __init__(self, encoder, predictor):
method trainable_parameters (line 221) | def trainable_parameters(self):
method update_target_network (line 228) | def update_target_network(self, mm):
method forward (line 238) | def forward(self, online_x, target_x):
function compute_representations (line 251) | def compute_representations(net, dataset, device):
FILE: examples/pytorch/bgrl/utils.py
class CosineDecayScheduler (line 18) | class CosineDecayScheduler:
method __init__ (line 19) | def __init__(self, max_val, warmup_steps, total_steps):
method get (line 24) | def get(self, step):
function get_graph_drop_transform (line 48) | def get_graph_drop_transform(drop_edge_p, feat_mask_p):
function get_wiki_cs (line 65) | def get_wiki_cs(transform=RowFeatNormalizer(subtract_min=True)):
function get_ppi (line 74) | def get_ppi():
function get_dataset (line 88) | def get_dataset(name, transform=RowFeatNormalizer(subtract_min=True)):
FILE: examples/pytorch/capsule/DGLDigitCapsule.py
class DGLDigitCapsuleLayer (line 9) | class DGLDigitCapsuleLayer(nn.Module):
method __init__ (line 10) | def __init__(
method forward (line 26) | def forward(self, x):
method compute_uhat (line 46) | def compute_uhat(self, x):
FILE: examples/pytorch/capsule/DGLRoutingLayer.py
class DGLRoutingLayer (line 7) | class DGLRoutingLayer(nn.Module):
method __init__ (line 8) | def __init__(self, in_nodes, out_nodes, f_size, batch_size=0, device="...
method forward (line 18) | def forward(self, u_hat, routing_num=1):
function squash (line 63) | def squash(s, dim=1):
function init_graph (line 70) | def init_graph(in_nodes, out_nodes, f_size, device="cpu"):
FILE: examples/pytorch/capsule/main.py
function train (line 9) | def train(args, model, device, train_loader, optimizer, epoch):
function test (line 30) | def test(args, model, device, test_loader):
function main (line 57) | def main():
FILE: examples/pytorch/capsule/model.py
class Net (line 7) | class Net(nn.Module):
method __init__ (line 8) | def __init__(self, device="cpu"):
method forward (line 19) | def forward(self, x):
method margin_loss (line 25) | def margin_loss(self, input, target):
class PrimaryCapsuleLayer (line 44) | class PrimaryCapsuleLayer(nn.Module):
method __init__ (line 45) | def __init__(self, in_channel=256, num_unit=8, device="cpu"):
method forward (line 54) | def forward(self, x):
FILE: examples/pytorch/caregnn/main.py
function main (line 13) | def main(args):
FILE: examples/pytorch/caregnn/main_sampling.py
function evaluate (line 13) | def evaluate(model, loss_fn, dataloader, device="cpu"):
function main (line 40) | def main(args):
FILE: examples/pytorch/caregnn/model.py
class CAREConv (line 7) | class CAREConv(nn.Module):
method __init__ (line 10) | def __init__(
method _calc_distance (line 42) | def _calc_distance(self, edges):
method _top_p_sampling (line 52) | def _top_p_sampling(self, g, p):
method forward (line 70) | def forward(self, g, feat):
class CAREGNN (line 103) | class CAREGNN(nn.Module):
method __init__ (line 104) | def __init__(
method forward (line 176) | def forward(self, graph, feat):
method RLModule (line 187) | def RLModule(self, graph, epoch, idx):
FILE: examples/pytorch/caregnn/model_sampling.py
function _l1_dist (line 8) | def _l1_dist(edges):
class CARESampler (line 14) | class CARESampler(dgl.dataloading.BlockSampler):
method __init__ (line 15) | def __init__(self, p, dists, num_layers):
method sample_frontier (line 21) | def sample_frontier(self, block_id, g, seed_nodes, *args, **kwargs):
method sample_blocks (line 49) | def sample_blocks(self, g, seed_nodes, exclude_eids=None):
method __len__ (line 62) | def __len__(self):
class CAREConv (line 66) | class CAREConv(nn.Module):
method __init__ (line 69) | def __init__(
method forward (line 101) | def forward(self, g, feat):
class CAREGNN (line 124) | class CAREGNN(nn.Module):
method __init__ (line 125) | def __init__(
method forward (line 197) | def forward(self, blocks, feat):
method RLModule (line 206) | def RLModule(self, graph, epoch, idx, dists):
FILE: examples/pytorch/caregnn/utils.py
class EarlyStopping (line 7) | class EarlyStopping:
method __init__ (line 8) | def __init__(self, patience=10):
method step (line 14) | def step(self, acc, model):
method save_checkpoint (line 32) | def save_checkpoint(self, model):
FILE: examples/pytorch/cluster_gcn/cluster_gcn.py
class SAGE (line 14) | class SAGE(nn.Module):
method __init__ (line 15) | def __init__(self, in_feats, n_hidden, n_classes):
method forward (line 23) | def forward(self, sg, x):
FILE: examples/pytorch/compGCN/data_loader.py
class TrainDataset (line 11) | class TrainDataset(Dataset):
method __init__ (line 25) | def __init__(self, triples, num_ent, lbl_smooth):
method __len__ (line 31) | def __len__(self):
method __getitem__ (line 34) | def __getitem__(self, idx):
method collate_fn (line 47) | def collate_fn(data):
method get_label (line 58) | def get_label(self, label):
class TestDataset (line 65) | class TestDataset(Dataset):
method __init__ (line 78) | def __init__(self, triples, num_ent):
method __len__ (line 82) | def __len__(self):
method __getitem__ (line 85) | def __getitem__(self, idx):
method collate_fn (line 93) | def collate_fn(data):
method get_label (line 104) | def get_label(self, label):
class Data (line 111) | class Data(object):
method __init__ (line 112) | def __init__(self, dataset, lbl_smooth, num_workers, batch_size):
FILE: examples/pytorch/compGCN/main.py
function predict (line 13) | def predict(model, graph, device, data_iter, split="valid", mode="tail"):
function evaluate (line 57) | def evaluate(model, graph, device, data_iter, split="valid"):
function main (line 94) | def main(args):
FILE: examples/pytorch/compGCN/models.py
class CompGraphConv (line 10) | class CompGraphConv(nn.Module):
method __init__ (line 13) | def __init__(
method forward (line 42) | def forward(self, g, n_in_feats, r_feats):
class CompGCN (line 120) | class CompGCN(nn.Module):
method __init__ (line 121) | def __init__(
method forward (line 187) | def forward(self, graph):
class CompGCN_ConvE (line 204) | class CompGCN_ConvE(nn.Module):
method __init__ (line 205) | def __init__(
method concat (line 272) | def concat(self, e1_embed, rel_embed):
method forward (line 281) | def forward(self, graph, sub, rel):
FILE: examples/pytorch/compGCN/utils.py
function com_mult (line 9) | def com_mult(a, b):
function conj (line 15) | def conj(a):
function ccorr (line 20) | def ccorr(a, b):
function in_out_norm (line 42) | def in_out_norm(graph):
FILE: examples/pytorch/correct_and_smooth/main.py
function evaluate (line 14) | def evaluate(y_pred, y_true, idx, evaluator):
function main (line 18) | def main():
FILE: examples/pytorch/correct_and_smooth/model.py
class MLPLinear (line 7) | class MLPLinear(nn.Module):
method __init__ (line 8) | def __init__(self, in_dim, out_dim):
method reset_parameters (line 13) | def reset_parameters(self):
method forward (line 16) | def forward(self, x):
class MLP (line 20) | class MLP(nn.Module):
method __init__ (line 21) | def __init__(self, in_dim, hid_dim, out_dim, num_layers, dropout=0.0):
method reset_parameters (line 38) | def reset_parameters(self):
method forward (line 44) | def forward(self, x):
class LabelPropagation (line 54) | class LabelPropagation(nn.Module):
method __init__ (line 79) | def __init__(self, num_layers, alpha, adj="DAD"):
method forward (line 87) | def forward(
class CorrectAndSmooth (line 124) | class CorrectAndSmooth(nn.Module):
method __init__ (line 155) | def __init__(
method correct (line 178) | def correct(self, g, y_soft, y_true, mask):
method smooth (line 217) | def smooth(self, g, y_soft, y_true, mask):
FILE: examples/pytorch/dagnn/main.py
class DAGNNConv (line 14) | class DAGNNConv(nn.Module):
method __init__ (line 15) | def __init__(self, in_dim, k):
method reset_parameters (line 23) | def reset_parameters(self):
method forward (line 27) | def forward(self, graph, feats):
class MLPLayer (line 51) | class MLPLayer(nn.Module):
method __init__ (line 52) | def __init__(self, in_dim, out_dim, bias=True, activation=None, dropou...
method reset_parameters (line 60) | def reset_parameters(self):
method forward (line 68) | def forward(self, feats):
class DAGNN (line 77) | class DAGNN(nn.Module):
method __init__ (line 78) | def __init__(
method forward (line 110) | def forward(self, graph, feats):
function main (line 117) | def main(args):
FILE: examples/pytorch/dagnn/utils.py
function evaluate (line 8) | def evaluate(model, graph, feats, labels, idxs):
function generate_random_seeds (line 22) | def generate_random_seeds(seed, nums):
function set_random_state (line 27) | def set_random_state(seed):
FILE: examples/pytorch/deepergcn/layers.py
class GENConv (line 10) | class GENConv(nn.Module):
method __init__ (line 43) | def __init__(
method forward (line 83) | def forward(self, g, node_feats, edge_feats):
FILE: examples/pytorch/deepergcn/main.py
function train (line 13) | def train(model, device, data_loader, opt, loss_fn):
function test (line 32) | def test(model, device, data_loader, evaluator):
function main (line 48) | def main():
FILE: examples/pytorch/deepergcn/models.py
class DeeperGCN (line 9) | class DeeperGCN(nn.Module):
method __init__ (line 40) | def __init__(
method forward (line 77) | def forward(self, g, edge_feats, node_feats=None):
FILE: examples/pytorch/deepergcn/modules.py
class MLP (line 6) | class MLP(nn.Sequential):
method __init__ (line 14) | def __init__(self, channels, act="relu", dropout=0.0, bias=True):
class MessageNorm (line 27) | class MessageNorm(nn.Module):
method __init__ (line 40) | def __init__(self, learn_scale=False):
method forward (line 46) | def forward(self, feats, msg, p=2):
FILE: examples/pytorch/dgi/dgi.py
class Encoder (line 17) | class Encoder(nn.Module):
method __init__ (line 18) | def __init__(self, g, in_feats, n_hidden, n_layers, activation, dropout):
method forward (line 25) | def forward(self, features, corrupt=False):
class Discriminator (line 33) | class Discriminator(nn.Module):
method __init__ (line 34) | def __init__(self, n_hidden):
method uniform (line 39) | def uniform(self, size, tensor):
method reset_parameters (line 44) | def reset_parameters(self):
method forward (line 48) | def forward(self, features, summary):
class DGI (line 53) | class DGI(nn.Module):
method __init__ (line 54) | def __init__(self, g, in_feats, n_hidden, n_layers, activation, dropout):
method forward (line 62) | def forward(self, features):
class Classifier (line 76) | class Classifier(nn.Module):
method __init__ (line 77) | def __init__(self, n_hidden, n_classes):
method reset_parameters (line 82) | def reset_parameters(self):
method forward (line 85) | def forward(self, features):
FILE: examples/pytorch/dgi/gcn.py
class GCN (line 10) | class GCN(nn.Module):
method __init__ (line 11) | def __init__(
method forward (line 28) | def forward(self, features):
FILE: examples/pytorch/dgi/train.py
function evaluate (line 14) | def evaluate(model, features, labels, mask):
function main (line 25) | def main(args):
FILE: examples/pytorch/dgmg/configure.py
function dataset_based_configure (line 6) | def dataset_based_configure(opts):
FILE: examples/pytorch/dgmg/cycles.py
function get_previous (line 10) | def get_previous(i, v_max):
function get_next (line 17) | def get_next(i, v_max):
function is_cycle (line 24) | def is_cycle(g):
function get_decision_sequence (line 45) | def get_decision_sequence(size):
function generate_dataset (line 72) | def generate_dataset(v_min, v_max, n_samples, fname):
class CycleDataset (line 82) | class CycleDataset(Dataset):
method __init__ (line 83) | def __init__(self, fname):
method __len__ (line 89) | def __len__(self):
method __getitem__ (line 92) | def __getitem__(self, index):
method collate_single (line 95) | def collate_single(self, batch):
method collate_batch (line 99) | def collate_batch(self, batch):
function dglGraph_to_adj_list (line 103) | def dglGraph_to_adj_list(g):
class CycleModelEvaluation (line 112) | class CycleModelEvaluation(object):
method __init__ (line 113) | def __init__(self, v_min, v_max, dir):
method rollout_and_examine (line 121) | def rollout_and_examine(self, model, num_samples):
method write_summary (line 181) | def write_summary(self):
class CyclePrinting (line 210) | class CyclePrinting(object):
method __init__ (line 211) | def __init__(self, num_epochs, num_batches):
method update (line 218) | def update(self, epoch, metrics):
FILE: examples/pytorch/dgmg/main.py
function main (line 18) | def main(opts):
FILE: examples/pytorch/dgmg/model.py
class GraphEmbed (line 10) | class GraphEmbed(nn.Module):
method __init__ (line 11) | def __init__(self, node_hidden_size):
method forward (line 23) | def forward(self, g):
class GraphProp (line 34) | class GraphProp(nn.Module):
method __init__ (line 35) | def __init__(self, num_prop_rounds, node_hidden_size):
method dgmg_msg (line 63) | def dgmg_msg(self, edges):
method dgmg_reduce (line 67) | def dgmg_reduce(self, nodes, round):
method forward (line 77) | def forward(self, g):
function bernoulli_action_log_prob (line 90) | def bernoulli_action_log_prob(logit, action):
class AddNode (line 99) | class AddNode(nn.Module):
method __init__ (line 100) | def __init__(self, graph_embed_func, node_hidden_size):
method _initialize_node_repr (line 117) | def _initialize_node_repr(self, g, node_type, graph_embed):
method prepare_training (line 131) | def prepare_training(self):
method forward (line 134) | def forward(self, g, action=None):
class AddEdge (line 155) | class AddEdge(nn.Module):
method __init__ (line 156) | def __init__(self, graph_embed_func, node_hidden_size):
method prepare_training (line 164) | def prepare_training(self):
method forward (line 167) | def forward(self, g, action=None):
class ChooseDestAndUpdate (line 185) | class ChooseDestAndUpdate(nn.Module):
method __init__ (line 186) | def __init__(self, graph_prop_func, node_hidden_size):
method _initialize_edge_repr (line 192) | def _initialize_edge_repr(self, g, src_list, dest_list):
method prepare_training (line 199) | def prepare_training(self):
method forward (line 202) | def forward(self, g, dest):
class DGMG (line 235) | class DGMG(nn.Module):
method __init__ (line 236) | def __init__(self, v_max, node_hidden_size, num_prop_rounds):
method init_weights (line 258) | def init_weights(self):
method action_step (line 270) | def action_step(self):
method prepare_for_train (line 276) | def prepare_for_train(self):
method add_node_and_update (line 283) | def add_node_and_update(self, a=None):
method add_edge_or_not (line 289) | def add_edge_or_not(self, a=None):
method choose_dest_and_update (line 294) | def choose_dest_and_update(self, a=None):
method get_log_prob (line 300) | def get_log_prob(self):
method forward_train (line 307) | def forward_train(self, actions):
method forward_inference (line 321) | def forward_inference(self):
method forward (line 334) | def forward(self, actions=None):
FILE: examples/pytorch/dgmg/utils.py
function mkdir_p (line 17) | def mkdir_p(path):
function date_filename (line 30) | def date_filename(base_dir="./"):
function setup_log_dir (line 40) | def setup_log_dir(opts):
function save_arg_dict (line 46) | def save_arg_dict(opts, filename="settings.txt"):
function setup (line 62) | def setup(args):
function weights_init (line 120) | def weights_init(m):
function dgmg_message_weight_init (line 138) | def dgmg_message_weight_init(m):
FILE: examples/pytorch/diffpool/data_utils.py
function one_hotify (line 5) | def one_hotify(labels, pad=-1):
function pre_process (line 21) | def pre_process(dataset, prog_args):
FILE: examples/pytorch/diffpool/model/dgl_layers/aggregator.py
class Aggregator (line 6) | class Aggregator(nn.Module):
method __init__ (line 14) | def __init__(self):
method forward (line 17) | def forward(self, node):
method aggre (line 22) | def aggre(self, neighbour):
class MeanAggregator (line 27) | class MeanAggregator(Aggregator):
method __init__ (line 32) | def __init__(self):
method aggre (line 35) | def aggre(self, neighbour):
class MaxPoolAggregator (line 40) | class MaxPoolAggregator(Aggregator):
method __init__ (line 45) | def __init__(self, in_feats, out_feats, activation, bias):
method aggre (line 54) | def aggre(self, neighbour):
class LSTMAggregator (line 62) | class LSTMAggregator(Aggregator):
method __init__ (line 67) | def __init__(self, in_feats, hidden_feats):
method init_hidden (line 77) | def init_hidden(self):
method aggre (line 86) | def aggre(self, neighbours):
method forward (line 99) | def forward(self, node):
FILE: examples/pytorch/diffpool/model/dgl_layers/bundler.py
class Bundler (line 6) | class Bundler(nn.Module):
method __init__ (line 11) | def __init__(self, in_feats, out_feats, activation, dropout, bias=True):
method concat (line 21) | def concat(self, h, aggre_result):
method forward (line 26) | def forward(self, node):
FILE: examples/pytorch/diffpool/model/dgl_layers/gnn.py
class GraphSageLayer (line 15) | class GraphSageLayer(nn.Module):
method __init__ (line 21) | def __init__(
method forward (line 47) | def forward(self, g, h):
class GraphSage (line 60) | class GraphSage(nn.Module):
method __init__ (line 65) | def __init__(
method forward (line 96) | def forward(self, g, features):
class DiffPoolBatchedGraphLayer (line 103) | class DiffPoolBatchedGraphLayer(nn.Module):
method __init__ (line 104) | def __init__(
method forward (line 129) | def forward(self, g, h):
FILE: examples/pytorch/diffpool/model/encoder.py
class DiffPool (line 17) | class DiffPool(nn.Module):
method __init__ (line 22) | def __init__(
method gcn_forward (line 153) | def gcn_forward(self, g, h, gc_layers, cat=False):
method gcn_forward_tensorized (line 169) | def gcn_forward_tensorized(self, h, adj, gc_layers, cat=False):
method forward (line 180) | def forward(self, g):
method loss (line 231) | def loss(self, pred, label):
FILE: examples/pytorch/diffpool/model/loss.py
class EntropyLoss (line 5) | class EntropyLoss(nn.Module):
method forward (line 7) | def forward(self, adj, anext, s_l):
class LinkPredLoss (line 17) | class LinkPredLoss(nn.Module):
method forward (line 18) | def forward(self, adj, anext, s_l):
FILE: examples/pytorch/diffpool/model/model_utils.py
function batch2tensor (line 5) | def batch2tensor(batch_adj, batch_feat, node_per_pool_graph):
function masked_softmax (line 25) | def masked_softmax(
FILE: examples/pytorch/diffpool/model/tensorized_layers/assignment.py
class DiffPoolAssignment (line 9) | class DiffPoolAssignment(nn.Module):
method __init__ (line 10) | def __init__(self, nfeat, nnext):
method forward (line 14) | def forward(self, x, adj, log=False):
FILE: examples/pytorch/diffpool/model/tensorized_layers/diffpool.py
class BatchedDiffPool (line 9) | class BatchedDiffPool(nn.Module):
method __init__ (line 10) | def __init__(self, nfeat, nnext, nhid, link_pred=False, entropy=True):
method forward (line 24) | def forward(self, x, adj, log=False):
FILE: examples/pytorch/diffpool/model/tensorized_layers/graphsage.py
class BatchedGraphSAGE (line 6) | class BatchedGraphSAGE(nn.Module):
method __init__ (line 7) | def __init__(
method forward (line 20) | def forward(self, x, adj):
method __repr__ (line 39) | def __repr__(self):
FILE: examples/pytorch/diffpool/train.py
function arg_parse (line 23) | def arg_parse():
function prepare_data (line 138) | def prepare_data(dataset, prog_args, train=False, pre_process=None):
function graph_classify_task (line 159) | def graph_classify_task(prog_args):
function train (line 243) | def train(dataset, model, prog_args, same_feat=True, val_dataset=None):
function evaluate (line 327) | def evaluate(dataloader, model, prog_args, logger=None):
function main (line 360) | def main():
FILE: examples/pytorch/dimenet/convert_tf_ckpt_to_pytorch.py
function main (line 28) | def main(model_cnf, convert_cnf):
FILE: examples/pytorch/dimenet/main.py
function split_dataset (line 23) | def split_dataset(
function ema (line 68) | def ema(ema_model, model, decay):
function edge_init (line 75) | def edge_init(edges):
function _collate_fn (line 82) | def _collate_fn(batch):
function train (line 89) | def train(device, model, opt, loss_fn, train_loader):
function evaluate (line 110) | def evaluate(device, model, valid_loader):
function main (line 137) | def main(model_cnf):
FILE: examples/pytorch/dimenet/modules/activations.py
function swish (line 4) | def swish(x):
FILE: examples/pytorch/dimenet/modules/basis_utils.py
function Jn (line 7) | def Jn(r, n):
function Jn_zeros (line 23) | def Jn_zeros(n, k):
function spherical_bessel_formulas (line 45) | def spherical_bessel_formulas(n):
function bessel_basis (line 64) | def bessel_basis(n, k):
function sph_harm_prefactor (line 99) | def sph_harm_prefactor(l, m):
function associated_legendre_polynomials (line 116) | def associated_legendre_polynomials(l, zero_m_only=True):
function real_sph_harm (line 155) | def real_sph_harm(l, zero_m_only=True, spherical_coordinates=True):
FILE: examples/pytorch/dimenet/modules/bessel_basis_layer.py
class BesselBasisLayer (line 7) | class BesselBasisLayer(nn.Module):
method __init__ (line 8) | def __init__(self, num_radial, cutoff, envelope_exponent=5):
method reset_params (line 16) | def reset_params(self):
method forward (line 23) | def forward(self, g):
FILE: examples/pytorch/dimenet/modules/dimenet.py
class DimeNet (line 11) | class DimeNet(nn.Module):
method __init__ (line 45) | def __init__(
method edge_init (line 121) | def edge_init(self, edges):
method forward (line 135) | def forward(self, g, l_g):
FILE: examples/pytorch/dimenet/modules/dimenet_pp.py
class DimeNetPP (line 11) | class DimeNetPP(nn.Module):
method __init__ (line 51) | def __init__(
method edge_init (line 133) | def edge_init(self, edges):
method forward (line 148) | def forward(self, g, l_g):
FILE: examples/pytorch/dimenet/modules/embedding_block.py
class EmbeddingBlock (line 8) | class EmbeddingBlock(nn.Module):
method __init__ (line 9) | def __init__(
method reset_params (line 30) | def reset_params(self):
method edge_init (line 35) | def edge_init(self, edges):
method forward (line 57) | def forward(self, g):
FILE: examples/pytorch/dimenet/modules/envelope.py
class Envelope (line 4) | class Envelope(nn.Module):
method __init__ (line 9) | def __init__(self, exponent):
method forward (line 17) | def forward(self, x):
FILE: examples/pytorch/dimenet/modules/initializers.py
function GlorotOrthogonal (line 4) | def GlorotOrthogonal(tensor, scale=2.0):
FILE: examples/pytorch/dimenet/modules/interaction_block.py
class InteractionBlock (line 8) | class InteractionBlock(nn.Module):
method __init__ (line 9) | def __init__(
method reset_params (line 53) | def reset_params(self):
method edge_transfer (line 60) | def edge_transfer(self, edges):
method msg_func (line 73) | def msg_func(self, edges):
method forward (line 82) | def forward(self, g, l_g):
FILE: examples/pytorch/dimenet/modules/interaction_pp_block.py
class InteractionPPBlock (line 8) | class InteractionPPBlock(nn.Module):
method __init__ (line 9) | def __init__(
method reset_params (line 54) | def reset_params(self):
method edge_transfer (line 66) | def edge_transfer(self, edges):
method msg_func (line 82) | def msg_func(self, edges):
method forward (line 88) | def forward(self, g, l_g):
FILE: examples/pytorch/dimenet/modules/output_block.py
class OutputBlock (line 7) | class OutputBlock(nn.Module):
method __init__ (line 8) | def __init__(
method reset_params (line 28) | def reset_params(self):
method forward (line 34) | def forward(self, g):
FILE: examples/pytorch/dimenet/modules/output_pp_block.py
class OutputPPBlock (line 7) | class OutputPPBlock(nn.Module):
method __init__ (line 8) | def __init__(
method reset_params (line 32) | def reset_params(self):
method forward (line 39) | def forward(self, g):
FILE: examples/pytorch/dimenet/modules/residual_layer.py
class ResidualLayer (line 5) | class ResidualLayer(nn.Module):
method __init__ (line 6) | def __init__(self, units, activation=None):
method reset_params (line 15) | def reset_params(self):
method forward (line 21) | def forward(self, inputs):
FILE: examples/pytorch/dimenet/modules/spherical_basis_layer.py
class SphericalBasisLayer (line 8) | class SphericalBasisLayer(nn.Module):
method __init__ (line 9) | def __init__(self, num_spherical, num_radial, cutoff, envelope_exponen...
method get_bessel_funcs (line 49) | def get_bessel_funcs(self):
method get_sph_funcs (line 52) | def get_sph_funcs(self):
FILE: examples/pytorch/dimenet/qm9.py
class QM9 (line 15) | class QM9(QM9Dataset):
method __init__ (line 100) | def __init__(
method graph_path (line 134) | def graph_path(self):
method line_graph_path (line 138) | def line_graph_path(self):
method has_cache (line 141) | def has_cache(self):
method process (line 147) | def process(self):
method _load_graph (line 171) | def _load_graph(self):
method save (line 206) | def save(self):
method load (line 211) | def load(self):
method __getitem__ (line 219) | def __getitem__(self, idx):
FILE: examples/pytorch/dtgrnn/dataloading.py
function download_file (line 12) | def download_file(dataset):
class SnapShotDataset (line 24) | class SnapShotDataset(Dataset):
method __init__ (line 25) | def __init__(self, path, npz_file):
method __len__ (line 34) | def __len__(self):
method __getitem__ (line 37) | def __getitem__(self, idx):
function METR_LAGraphDataset (line 44) | def METR_LAGraphDataset():
class METR_LATrainDataset (line 53) | class METR_LATrainDataset(SnapShotDataset):
method __init__ (line 54) | def __init__(self):
class METR_LATestDataset (line 60) | class METR_LATestDataset(SnapShotDataset):
method __init__ (line 61) | def __init__(self):
class METR_LAValidDataset (line 65) | class METR_LAValidDataset(SnapShotDataset):
method __init__ (line 66) | def __init__(self):
function PEMS_BAYGraphDataset (line 70) | def PEMS_BAYGraphDataset():
class PEMS_BAYTrainDataset (line 79) | class PEMS_BAYTrainDataset(SnapShotDataset):
method __init__ (line 80) | def __init__(self):
class PEMS_BAYTestDataset (line 86) | class PEMS_BAYTestDataset(SnapShotDataset):
method __init__ (line 87) | def __init__(self):
class PEMS_BAYValidDataset (line 91) | class PEMS_BAYValidDataset(SnapShotDataset):
method __init__ (line 92) | def __init__(self):
FILE: examples/pytorch/dtgrnn/dcrnn.py
class DiffConv (line 10) | class DiffConv(nn.Module):
method __init__ (line 30) | def __init__(
method attach_graph (line 49) | def attach_graph(g, k):
method get_weight_matrix (line 73) | def get_weight_matrix(g):
method diffuse (line 82) | def diffuse(progress_g, weighted_adj, degree):
method forward (line 93) | def forward(self, g, x):
FILE: examples/pytorch/dtgrnn/gaan.py
class WeightedGATConv (line 11) | class WeightedGATConv(dglnn.GATConv):
method forward (line 17) | def forward(self, graph, feat, get_attention=False):
class GatedGAT (line 99) | class GatedGAT(nn.Module):
method __init__ (line 118) | def __init__(self, in_feats, out_feats, map_feats, num_heads):
method forward (line 135) | def forward(self, g, x):
FILE: examples/pytorch/dtgrnn/model.py
class GraphGRUCell (line 12) | class GraphGRUCell(nn.Module):
method __init__ (line 27) | def __init__(self, in_feats, out_feats, net):
method forward (line 41) | def forward(self, g, x, h):
class StackedEncoder (line 52) | class StackedEncoder(nn.Module):
method __init__ (line 71) | def __init__(self, in_feats, out_feats, num_layers, net):
method forward (line 89) | def forward(self, g, x, hidden_states):
class StackedDecoder (line 97) | class StackedDecoder(nn.Module):
method __init__ (line 119) | def __init__(self, in_feats, hid_feats, out_feats, num_layers, net):
method forward (line 136) | def forward(self, g, x, hidden_states):
class GraphRNN (line 145) | class GraphRNN(nn.Module):
method __init__ (line 170) | def __init__(
method compute_thresh (line 195) | def compute_thresh(self, batch_cnt):
method encode (line 200) | def encode(self, g, inputs, device):
method decode (line 210) | def decode(self, g, teacher_states, hidden_states, batch_cnt, device):
method forward (line 227) | def forward(self, g, inputs, teacher_states, batch_cnt, device):
FILE: examples/pytorch/dtgrnn/train.py
function train (line 28) | def train(
function eval (line 94) | def eval(model, graph, dataloader, normalizer, loss_fn, device, args):
FILE: examples/pytorch/dtgrnn/utils.py
class NormalizationLayer (line 8) | class NormalizationLayer(nn.Module):
method __init__ (line 9) | def __init__(self, mean, std):
method normalize (line 14) | def normalize(self, x):
method denormalize (line 17) | def denormalize(self, x):
function masked_mae_loss (line 21) | def masked_mae_loss(y_pred, y_true):
function get_learning_rate (line 31) | def get_learning_rate(optimizer):
FILE: examples/pytorch/eeg-gcnn/EEGGraphDataset.py
class EEGGraphDataset (line 12) | class EEGGraphDataset(DGLDataset):
method __init__ (line 27) | def __init__(self, x, y, num_nodes, indices):
method get_sensor_distances (line 70) | def get_sensor_distances(self):
method get_geodesic_distance (line 84) | def get_geodesic_distance(
method __len__ (line 113) | def __len__(self):
method __getitem__ (line 117) | def __getitem__(self, idx):
FILE: examples/pytorch/eeg-gcnn/deep_EEGGraphConvNet.py
class EEGGraphConvNet (line 8) | class EEGGraphConvNet(nn.Module):
method __init__ (line 15) | def __init__(self, num_feats):
method forward (line 37) | def forward(self, g, return_graph_embedding=False):
FILE: examples/pytorch/eeg-gcnn/main.py
function _load_memory_mapped_array (line 17) | def _load_memory_mapped_array(file_name):
FILE: examples/pytorch/eeg-gcnn/shallow_EEGGraphConvNet.py
class EEGGraphConvNet (line 7) | class EEGGraphConvNet(nn.Module):
method __init__ (line 14) | def __init__(self, num_feats):
method forward (line 29) | def forward(self, g, return_graph_embedding=False):
FILE: examples/pytorch/eges/main.py
function train (line 11) | def train(args, train_g, sku_info, num_skus, num_brands, num_shops, num_...
function eval (line 58) | def eval(model, test_graph, sku_info):
FILE: examples/pytorch/eges/model.py
class EGES (line 4) | class EGES(th.nn.Module):
method __init__ (line 5) | def __init__(self, dim, num_nodes, num_brands, num_shops, num_cates):
method forward (line 17) | def forward(self, srcs, dsts):
method query_node_embed (line 24) | def query_node_embed(self, nodes):
method loss (line 57) | def loss(self, srcs, dsts, labels):
FILE: examples/pytorch/eges/sampler.py
class Sampler (line 6) | class Sampler:
method __init__ (line 7) | def __init__(
method sample (line 17) | def sample(self, batch, sku_info):
method filter_padding (line 40) | def filter_padding(self, traces):
method generate_pos_pairs (line 44) | def generate_pos_pairs(self, nodes):
method compute_node_sample_weight (line 69) | def compute_node_sample_weight(self):
method generate_neg_pairs (line 75) | def generate_neg_pairs(self, pos_pairs):
FILE: examples/pytorch/eges/utils.py
function init_args (line 12) | def init_args():
function construct_graph (line 35) | def construct_graph(datapath, session_interval_gap_sec, valid_sku_raw_ids):
function convert_to_dgl_graph (line 70) | def convert_to_dgl_graph(graph):
function add_session (line 81) | def add_session(session, graph):
function parse_actions (line 98) | def parse_actions(datapath, valid_sku_raw_ids):
function encode_id (line 129) | def encode_id(encoder, decoder, raw_id, encoded_id):
function get_valid_sku_set (line 140) | def get_valid_sku_set(datapath):
function encode_sku_fields (line 151) | def encode_sku_fields(datapath, sku_encoder, sku_decoder):
class TestEdge (line 197) | class TestEdge:
method __init__ (line 198) | def __init__(self, src, dst, label):
function split_train_test_graph (line 204) | def split_train_test_graph(graph):
FILE: examples/pytorch/evolveGCN/dataset.py
function process_raw_data (line 10) | def process_raw_data(raw_dir, processed_dir):
class EllipticDataset (line 98) | class EllipticDataset:
method __init__ (line 99) | def __init__(
method process (line 107) | def process(self):
method num_classes (line 178) | def num_classes(self):
FILE: examples/pytorch/evolveGCN/model.py
class MatGRUCell (line 9) | class MatGRUCell(torch.nn.Module):
method __init__ (line 15) | def __init__(self, in_feats, out_feats):
method forward (line 23) | def forward(self, prev_Q, z_topk=None):
class MatGRUGate (line 38) | class MatGRUGate(torch.nn.Module):
method __init__ (line 44) | def __init__(self, rows, cols, activation):
method reset_parameters (line 52) | def reset_parameters(self):
method forward (line 57) | def forward(self, x, hidden):
class TopK (line 65) | class TopK(torch.nn.Module):
method __init__ (line 72) | def __init__(self, feats, k):
method reset_parameters (line 79) | def reset_parameters(self):
method forward (line 82) | def forward(self, node_embs):
class EvolveGCNH (line 94) | class EvolveGCNH(nn.Module):
method __init__ (line 95) | def __init__(
method reset_parameters (line 153) | def reset_parameters(self):
method forward (line 157) | def forward(self, g_list):
class EvolveGCNO (line 172) | class EvolveGCNO(nn.Module):
method __init__ (line 173) | def __init__(
method reset_parameters (line 235) | def reset_parameters(self):
method forward (line 239) | def forward(self, g_list):
FILE: examples/pytorch/evolveGCN/train.py
function train (line 13) | def train(args, device):
FILE: examples/pytorch/evolveGCN/utils.py
function calculate_measure (line 1) | def calculate_measure(tp, fn, fp):
class Measure (line 15) | class Measure(object):
method __init__ (line 16) | def __init__(self, num_classes, target_class):
method reset_info (line 32) | def reset_info(self):
method append_measures (line 46) | def append_measures(self, predictions, labels):
method get_each_timestamp_measure (line 61) | def get_each_timestamp_measure(self):
method get_total_measure (line 76) | def get_total_measure(self):
method update_best_f1 (line 84) | def update_best_f1(self, cur_f1, cur_epoch):
FILE: examples/pytorch/gas/dataloader.py
class GASDataset (line 12) | class GASDataset(DGLBuiltinDataset):
method __init__ (line 15) | def __init__(
method process (line 25) | def process(self):
method graph_path (line 72) | def graph_path(self):
method save (line 75) | def save(self):
method has_cache (line 79) | def has_cache(self):
method load (line 83) | def load(self):
method num_classes (line 89) | def num_classes(self):
method __getitem__ (line 93) | def __getitem__(self, idx):
method __len__ (line 106) | def __len__(self):
method _random_split (line 114) | def _random_split(self, graph, seed=717, train_size=0.7, val_size=0.1):
FILE: examples/pytorch/gas/main.py
function main (line 11) | def main(args):
FILE: examples/pytorch/gas/main_sampling.py
function evaluate (line 12) | def evaluate(model, loss_fn, dataloader, device="cpu"):
function main (line 45) | def main(args):
FILE: examples/pytorch/gas/model.py
class MLP (line 7) | class MLP(nn.Module):
method __init__ (line 8) | def __init__(self, in_dim, out_dim):
method apply_edges (line 12) | def apply_edges(self, edges):
method forward (line 19) | def forward(self, g, e_feat, u_feat, v_feat):
class GASConv (line 28) | class GASConv(nn.Module):
method __init__ (line 31) | def __init__(
method forward (line 64) | def forward(self, g, e_feat, u_feat, v_feat):
class GAS (line 158) | class GAS(nn.Module):
method __init__ (line 159) | def __init__(
method forward (line 215) | def forward(self, graph, e_feat, u_feat, v_feat):
FILE: examples/pytorch/gas/model_sampling.py
class MLP (line 7) | class MLP(nn.Module):
method __init__ (line 8) | def __init__(self, in_dim, out_dim):
method apply_edges (line 12) | def apply_edges(self, edges):
method forward (line 19) | def forward(self, g, e_feat, u_feat, v_feat):
class GASConv (line 28) | class GASConv(nn.Module):
method __init__ (line 31) | def __init__(
method forward (line 64) | def forward(self, g, f_feat, b_feat, u_feat, v_feat):
class GAS (line 183) | class GAS(nn.Module):
method __init__ (line 184) | def __init__(
method forward (line 240) | def forward(self, subgraph, blocks, f_feat, b_feat, u_feat, v_feat):
FILE: examples/pytorch/gat/train.py
class GAT (line 13) | class GAT(nn.Module):
method __init__ (line 14) | def __init__(self, in_size, hid_size, out_size, heads):
method forward (line 39) | def forward(self, g, inputs):
function evaluate (line 50) | def evaluate(g, features, labels, mask, model):
function train (line 61) | def train(g, features, labels, masks, model):
FILE: examples/pytorch/gat/train_ppi.py
class GAT (line 11) | class GAT(nn.Module):
method __init__ (line 12) | def __init__(self, in_size, hid_size, out_size, heads):
method forward (line 38) | def forward(self, g, inputs):
function evaluate (line 49) | def evaluate(g, features, labels, model):
function evaluate_in_batches (line 58) | def evaluate_in_batches(dataloader, device, model):
function train (line 69) | def train(train_dataloader, val_dataloader, device, model):
FILE: examples/pytorch/gatv2/gatv2.py
class GATv2 (line 15) | class GATv2(nn.Module):
method __init__ (line 16) | def __init__(
method forward (line 81) | def forward(self, g, inputs):
FILE: examples/pytorch/gatv2/train.py
class EarlyStopping (line 23) | class EarlyStopping:
method __init__ (line 24) | def __init__(self, patience=10):
method step (line 30) | def step(self, acc, model):
method save_checkpoint (line 48) | def save_checkpoint(self, model):
function accuracy (line 53) | def accuracy(logits, labels):
function evaluate (line 59) | def evaluate(g, model, features, labels, mask):
function main (line 68) | def main(args):
FILE: examples/pytorch/gcmc/data.py
class MovieLens (line 45) | class MovieLens(object):
method __init__ (line 118) | def __init__(
method _generate_pair_value (line 354) | def _generate_pair_value(self, rating_info):
method _generate_enc_graph (line 374) | def _generate_enc_graph(
method _generate_dec_graph (line 443) | def _generate_dec_graph(self, rating_pairs):
method num_links (line 459) | def num_links(self):
method num_user (line 463) | def num_user(self):
method num_movie (line 467) | def num_movie(self):
method _drop_unseen_nodes (line 470) | def _drop_unseen_nodes(
method _load_raw_rates (line 496) | def _load_raw_rates(self, file_path, sep):
method _load_raw_user_info (line 530) | def _load_raw_user_info(self):
method _process_user_fea (line 586) | def _process_user_fea(self):
method _load_raw_movie_info (line 636) | def _load_raw_movie_info(self):
method _process_movie_fea (line 718) | def _process_movie_fea(self):
FILE: examples/pytorch/gcmc/model.py
class GCMCGraphConv (line 11) | class GCMCGraphConv(nn.Module):
method __init__ (line 28) | def __init__(
method reset_parameters (line 43) | def reset_parameters(self):
method forward (line 48) | def forward(self, graph, feat, weight=None):
class GCMCLayer (line 102) | class GCMCLayer(nn.Module):
method __init__ (line 151) | def __init__(
method partial_to (line 227) | def partial_to(self, device):
method reset_parameters (line 242) | def reset_parameters(self):
method forward (line 247) | def forward(self, graph, ufeat=None, ifeat=None):
class BiDecoder (line 294) | class BiDecoder(nn.Module):
method __init__ (line 321) | def __init__(self, in_units, num_classes, num_basis=2, dropout_rate=0.0):
method reset_parameters (line 331) | def reset_parameters(self):
method forward (line 336) | def forward(self, graph, ufeat, ifeat):
class DenseBiDecoder (line 367) | class DenseBiDecoder(nn.Module):
method __init__ (line 386) | def __init__(self, in_units, num_classes, num_basis=2, dropout_rate=0.0):
method reset_parameters (line 394) | def reset_parameters(self):
method forward (line 399) | def forward(self, ufeat, ifeat):
function dot_or_identity (line 423) | def dot_or_identity(A, B, device=None):
FILE: examples/pytorch/gcmc/train.py
class Net (line 26) | class Net(nn.Module):
method __init__ (line 27) | def __init__(self, args):
method forward (line 48) | def forward(self, enc_graph, dec_graph, ufeat, ifeat):
function evaluate (line 54) | def evaluate(args, net, dataset, segment="valid"):
function train (line 85) | def train(args):
function config (line 258) | def config():
FILE: examples/pytorch/gcmc/train_sampling.py
class Net (line 34) | class Net(nn.Module):
method __init__ (line 35) | def __init__(self, args, dev_id):
method forward (line 64) | def forward(
function load_subtensor (line 72) | def load_subtensor(input_nodes, pair_graph, blocks, dataset, parent_graph):
function flatten_etypes (line 102) | def flatten_etypes(pair_graph, dataset, segment):
function evaluate (line 134) | def evaluate(args, dev_id, net, dataset, dataloader, segment="valid"):
function config (line 185) | def config():
function run (line 244) | def run(proc_id, n_gpus, args, devices, dataset):
FILE: examples/pytorch/gcmc/utils.py
class MetricLogger (line 11) | class MetricLogger(object):
method __init__ (line 12) | def __init__(self, attr_names, parse_formats, save_path):
method log (line 19) | def log(self, **kwargs):
method close (line 28) | def close(self):
function torch_total_param_num (line 32) | def torch_total_param_num(net):
function torch_net_info (line 36) | def torch_net_info(net, save_path=None):
function get_activation (line 50) | def get_activation(act):
function get_optimizer (line 80) | def get_optimizer(opt):
function to_etype_name (line 89) | def to_etype_name(rating):
FILE: examples/pytorch/gcn/train.py
class GCN (line 13) | class GCN(nn.Module):
method __init__ (line 14) | def __init__(self, in_size, hid_size, out_size):
method forward (line 24) | def forward(self, g, features):
function evaluate (line 33) | def evaluate(g, features, labels, mask, model):
function train (line 44) | def train(g, features, labels, masks, model):
FILE: examples/pytorch/geniepath/model.py
class GeniePathConv (line 8) | class GeniePathConv(nn.Module):
method __init__ (line 9) | def __init__(self, in_dim, hid_dim, out_dim, num_heads=1, residual=Fal...
method forward (line 16) | def forward(self, graph, x, h, c):
class GeniePath (line 25) | class GeniePath(nn.Module):
method __init__ (line 26) | def __init__(
method forward (line 51) | def forward(self, graph, x):
class GeniePathLazy (line 63) | class GeniePathLazy(nn.Module):
method __init__ (line 64) | def __init__(
method forward (line 87) | def forward(self, graph, x):
FILE: examples/pytorch/geniepath/ppi.py
function evaluate (line 13) | def evaluate(model, loss_fn, dataloader, device="cpu"):
function main (line 32) | def main(args):
FILE: examples/pytorch/geniepath/pubmed.py
function main (line 11) | def main(args):
FILE: examples/pytorch/ggnn/data_utils.py
function get_babi_dataloaders (line 20) | def get_babi_dataloaders(batch_size, train_size=50, task_id=4, q_type=0):
function _ns_dataloader (line 92) | def _ns_dataloader(
function _convert_ns_dataset (line 155) | def _convert_ns_dataset(train_size, node_dict, edge_dict, path, q_type):
function _gc_dataloader (line 205) | def _gc_dataloader(
function _convert_gc_dataset (line 273) | def _convert_gc_dataset(
function _path_finding_dataloader (line 327) | def _path_finding_dataloader(
function _convert_path_finding (line 401) | def _convert_path_finding(train_size, node_dict, edge_dict, path):
function _download_babi_data (line 450) | def _download_babi_data():
FILE: examples/pytorch/ggnn/ggnn_gc.py
class GraphClsGGNN (line 10) | class GraphClsGGNN(nn.Module):
method __init__ (line 11) | def __init__(self, annotation_size, out_feats, n_steps, n_etypes, num_...
method forward (line 30) | def forward(self, graph, labels=None):
FILE: examples/pytorch/ggnn/ggnn_ns.py
class NodeSelectionGGNN (line 10) | class NodeSelectionGGNN(nn.Module):
method __init__ (line 11) | def __init__(self, annotation_size, out_feats, n_steps, n_etypes):
method forward (line 27) | def forward(self, graph, labels=None):
FILE: examples/pytorch/ggnn/ggsnn.py
class GGSNN (line 12) | class GGSNN(nn.Module):
method __init__ (line 13) | def __init__(
method forward (line 45) | def forward(self, graph, seq_lengths, ground_truth=None):
function sequence_loss (line 79) | def sequence_loss(logits, ground_truth, seq_length=None):
FILE: examples/pytorch/ggnn/train_gc.py
function main (line 14) | def main(args):
FILE: examples/pytorch/ggnn/train_ns.py
function main (line 15) | def main(args):
FILE: examples/pytorch/ggnn/train_path_finding.py
function main (line 15) | def main(args):
FILE: examples/pytorch/gin/train.py
class MLP (line 17) | class MLP(nn.Module):
method __init__ (line 20) | def __init__(self, input_dim, hidden_dim, output_dim):
method forward (line 28) | def forward(self, x):
class GIN (line 34) | class GIN(nn.Module):
method __init__ (line 35) | def __init__(self, input_dim, hidden_dim, output_dim):
method forward (line 62) | def forward(self, g, h):
function split_fold10 (line 78) | def split_fold10(labels, fold_idx=0):
function evaluate (line 87) | def evaluate(dataloader, device, model):
function train (line 103) | def train(train_loader, val_loader, device, model):
FILE: examples/pytorch/gnn_explainer/explain_main.py
function main (line 19) | def main(args):
FILE: examples/pytorch/gnn_explainer/models.py
class Layer (line 7) | class Layer(nn.Module):
method __init__ (line 8) | def __init__(self, in_dim, out_dim):
method forward (line 12) | def forward(self, graph, feat, eweight=None):
class Model (line 27) | class Model(nn.Module):
method __init__ (line 28) | def __init__(self, in_dim, out_dim, hid_dim=40):
method forward (line 34) | def forward(self, graph, feat, eweight=None):
FILE: examples/pytorch/gnn_explainer/train_main.py
function main (line 18) | def main(args):
FILE: examples/pytorch/grace/aug.py
function aug (line 8) | def aug(graph, x, feat_drop_rate, edge_mask_rate):
function drop_feature (line 26) | def drop_feature(x, drop_prob):
function mask_edge (line 37) | def mask_edge(graph, mask_prob):
FILE: examples/pytorch/grace/dataset.py
function load (line 4) | def load(name):
FILE: examples/pytorch/grace/eval.py
function repeat (line 16) | def repeat(n_times):
function prob_to_one_hot (line 36) | def prob_to_one_hot(y_pred):
function print_statistics (line 44) | def print_statistics(statistics, function_name):
function label_classification (line 57) | def label_classification(
FILE: examples/pytorch/grace/main.py
function count_parameters (line 15) | def count_parameters(model):
FILE: examples/pytorch/grace/model.py
class GCN (line 9) | class GCN(nn.Module):
method __init__ (line 10) | def __init__(self, in_dim, out_dim, act_fn, num_layers=2):
method forward (line 24) | def forward(self, graph, feat):
class MLP (line 32) | class MLP(nn.Module):
method __init__ (line 33) | def __init__(self, in_dim, out_dim):
method forward (line 38) | def forward(self, x):
class Grace (line 43) | class Grace(nn.Module):
method __init__ (line 62) | def __init__(self, in_dim, hid_dim, out_dim, num_layers, act_fn, temp):
method sim (line 68) | def sim(self, z1, z2):
method get_loss (line 76) | def get_loss(self, z1, z2):
method get_embedding (line 89) | def get_embedding(self, graph, feat):
method forward (line 95) | def forward(self, graph1, graph2, feat1, feat2):
FILE: examples/pytorch/grand/main.py
function argument (line 17) | def argument():
function consis_loss (line 95) | def consis_loss(logps, temp, lam):
FILE: examples/pytorch/grand/model.py
function drop_node (line 8) | def drop_node(feats, drop_rate, training):
class MLP (line 22) | class MLP(nn.Module):
method __init__ (line 23) | def __init__(
method reset_parameters (line 37) | def reset_parameters(self):
method forward (line 41) | def forward(self, x):
function GRANDConv (line 55) | def GRANDConv(graph, feats, order):
class GRAND (line 87) | class GRAND(nn.Module):
method __init__ (line 113) | def __init__(
method forward (line 139) | def forward(self, graph, feats, training=True):
FILE: examples/pytorch/graph_matching/ged.py
function validate_cost_functions (line 14) | def validate_cost_functions(
function construct_cost_functions (line 83) | def construct_cost_functions(
function get_edges_to_match (line 177) | def get_edges_to_match(G, node_id, matched_nodes):
function subset_cost_matrix (line 222) | def subset_cost_matrix(cost_matrix, row_ids, col_ids, num_rows, num_cols):
class search_tree_node (line 234) | class search_tree_node:
method __init__ (line 235) | def __init__(
method __lt__ (line 449) | def __lt__(self, other):
function edit_cost_from_node_matching (line 477) | def edit_cost_from_node_matching(
function contextual_cost_matrix_construction (line 587) | def contextual_cost_matrix_construction(
function hausdorff_matching (line 764) | def hausdorff_matching(
function a_star_search (line 994) | def a_star_search(G1, G2, cost_matrix_nodes, cost_matrix_edges, max_beam...
function get_sorted_mapping (line 1136) | def get_sorted_mapping(mapping_tuple, len1, len2):
function graph_edit_distance (line 1147) | def graph_edit_distance(
FILE: examples/pytorch/graphsage/advanced/model.py
class SAGE (line 11) | class SAGE(nn.Module):
method __init__ (line 12) | def __init__(
method init (line 18) | def init(
method forward (line 35) | def forward(self, blocks, x):
method inference (line 44) | def inference(self, g, x, device, batch_size, num_workers):
function compute_acc_unsupervised (line 92) | def compute_acc_unsupervised(emb, labels, train_nids, val_nids, test_nids):
FILE: examples/pytorch/graphsage/advanced/negative_sampler.py
class NegativeSampler (line 5) | class NegativeSampler(object):
method __init__ (line 6) | def __init__(self, g, k, neg_share=False, device=None):
method __call__ (line 13) | def __call__(self, g, eids):
FILE: examples/pytorch/graphsage/advanced/train_lightning_unsupervised.py
class CrossEntropyLoss (line 27) | class CrossEntropyLoss(nn.Module):
method forward (line 28) | def forward(self, block_outputs, pos_graph, neg_graph):
class SAGELightning (line 46) | class SAGELightning(LightningModule):
method __init__ (line 47) | def __init__(
method training_step (line 58) | def training_step(self, batch, batch_idx):
method validation_step (line 72) | def validation_step(self, batch, batch_idx):
method configure_optimizers (line 80) | def configure_optimizers(self):
class DataModule (line 85) | class DataModule(LightningDataModule):
method __init__ (line 86) | def __init__(
method train_dataloader (line 144) | def train_dataloader(self):
method val_dataloader (line 164) | def val_dataloader(self):
class UnsupervisedClassification (line 179) | class UnsupervisedClassification(Callback):
method on_validation_epoch_start (line 180) | def on_validation_epoch_start(self, trainer, pl_module):
method on_validation_batch_end (line 183) | def on_validation_batch_end(
method on_validation_epoch_end (line 188) | def on_validation_epoch_end(self, trainer, pl_module):
FILE: examples/pytorch/graphsage/lightning/node_classification.py
class SAGE (line 19) | class SAGE(LightningModule):
method __init__ (line 20) | def __init__(self, in_feats, n_hidden, n_classes):
method forward (line 33) | def forward(self, blocks, x):
method inference (line 42) | def inference(self, g, device, batch_size, num_workers, buffer_device=...
method training_step (line 79) | def training_step(self, batch, batch_idx):
method validation_step (line 95) | def validation_step(self, batch, batch_idx):
method configure_optimizers (line 110) | def configure_optimizers(self):
class DataModule (line 117) | class DataModule(LightningDataModule):
method __init__ (line 118) | def __init__(
method train_dataloader (line 134) | def train_dataloader(self):
method val_dataloader (line 150) | def val_dataloader(self):
FILE: examples/pytorch/graphsage/link_pred.py
function to_bidirected_with_reverse_mapping (line 19) | def to_bidirected_with_reverse_mapping(g):
class SAGE (line 46) | class SAGE(nn.Module):
method __init__ (line 47) | def __init__(self, in_size, hid_size):
method forward (line 63) | def forward(self, pair_graph, neg_pair_graph, blocks, x):
method inference (line 75) | def inference(self, g, device, batch_size):
function compute_mrr (line 111) | def compute_mrr(
function evaluate (line 127) | def evaluate(device, graph, edge_split, model, batch_size):
function train (line 145) | def train(args, device, g, reverse_eids, seed_edges, model):
FILE: examples/pytorch/graphsage/load_graph.py
function load_reddit (line 5) | def load_reddit(self_loop=True):
function load_ogb (line 16) | def load_ogb(name, root="dataset"):
function inductive_split (line 50) | def inductive_split(g):
FILE: examples/pytorch/graphsage/node_classification.py
class SAGE (line 19) | class SAGE(nn.Module):
method __init__ (line 20) | def __init__(self, in_size, hid_size, out_size):
method forward (line 31) | def forward(self, blocks, x):
method inference (line 40) | def inference(self, g, device, batch_size):
function evaluate (line 78) | def evaluate(model, graph, dataloader, num_classes):
function layerwise_infer (line 95) | def layerwise_infer(device, graph, nid, model, num_classes, batch_size):
function train (line 108) | def train(args, device, g, dataset, model, num_classes):
FILE: examples/pytorch/graphsage/train_full.py
class SAGE (line 13) | class SAGE(nn.Module):
method __init__ (line 14) | def __init__(self, in_size, hid_size, out_size):
method forward (line 22) | def forward(self, graph, x):
function evaluate (line 32) | def evaluate(g, features, labels, mask, model):
function train (line 43) | def train(g, features, labels, masks, model):
FILE: examples/pytorch/graphsaint/modules.py
class GCNLayer (line 7) | class GCNLayer(nn.Module):
method __init__ (line 8) | def __init__(
method reset_parameters (line 39) | def reset_parameters(self):
method feat_trans (line 43) | def feat_trans(
method forward (line 58) | def forward(self, graph, features):
class GCNNet (line 90) | class GCNNet(nn.Module):
method __init__ (line 91) | def __init__(
method forward (line 156) | def forward(self, graph):
FILE: examples/pytorch/graphsaint/sampler.py
class SAINTSampler (line 17) | class SAINTSampler:
method __init__ (line 72) | def __init__(
method __len__ (line 165) | def __len__(self):
method __getitem__ (line 174) | def __getitem__(self, idx):
method __collate_fn__ (line 191) | def __collate_fn__(self, batch):
method __clear__ (line 206) | def __clear__(self):
method __generate_fn__ (line 212) | def __generate_fn__(self):
method __compute_norm__ (line 215) | def __compute_norm__(self):
method __compute_degree_norm (line 231) | def __compute_degree_norm(self):
method __sample__ (line 239) | def __sample__(self):
class SAINTNodeSampler (line 243) | class SAINTNodeSampler(SAINTSampler):
method __init__ (line 255) | def __init__(self, node_budget, **kwargs):
method __generate_fn__ (line 261) | def __generate_fn__(self):
method __sample__ (line 274) | def __sample__(self):
class SAINTEdgeSampler (line 284) | class SAINTEdgeSampler(SAINTSampler):
method __init__ (line 296) | def __init__(self, edge_budget, **kwargs):
method __generate_fn__ (line 304) | def __generate_fn__(self):
method __sample__ (line 319) | def __sample__(self):
class SAINTRandomWalkSampler (line 352) | class SAINTRandomWalkSampler(SAINTSampler):
method __init__ (line 367) | def __init__(self, num_roots, length, **kwargs):
method __generate_fn__ (line 373) | def __generate_fn__(self):
method __sample__ (line 386) | def __sample__(self):
FILE: examples/pytorch/graphsaint/train_sampling.py
function main (line 15) | def main(args, task):
FILE: examples/pytorch/graphsaint/utils.py
class Logger (line 14) | class Logger(object):
method __init__ (line 17) | def __init__(self, path):
method write (line 27) | def write(self, s):
function save_log_dir (line 34) | def save_log_dir(args):
function calc_f1 (line 40) | def calc_f1(y_true, y_pred, multilabel):
function evaluate (line 51) | def evaluate(model, g, labels, mask, multilabel=False):
function load_data (line 64) | def load_data(args, multilabel):
FILE: examples/pytorch/graphsim/dataloader.py
function build_dense_graph (line 12) | def build_dense_graph(n_particles):
class MultiBodyDataset (line 17) | class MultiBodyDataset(Dataset):
method __init__ (line 18) | def __init__(self, path):
method __len__ (line 25) | def __len__(self):
method __getitem__ (line 28) | def __getitem__(self, idx):
class MultiBodyTrainDataset (line 37) | class MultiBodyTrainDataset(MultiBodyDataset):
method __init__ (line 38) | def __init__(self, data_path="./data/"):
class MultiBodyValidDataset (line 47) | class MultiBodyValidDataset(MultiBodyDataset):
method __init__ (line 48) | def __init__(self, data_path="./data/"):
class MultiBodyTestDataset (line 54) | class MultiBodyTestDataset(MultiBodyDataset):
method __init__ (line 55) | def __init__(self, data_path="./data/"):
class MultiBodyGraphCollator (line 66) | class MultiBodyGraphCollator:
method __init__ (line 67) | def __init__(self, n_particles):
method __call__ (line 71) | def __call__(self, batch):
FILE: examples/pytorch/graphsim/models.py
class MLP (line 13) | class MLP(nn.Module):
method __init__ (line 14) | def __init__(self, in_feats, out_feats, num_layers=2, hidden=128):
method forward (line 32) | def forward(self, x):
class PrepareLayer (line 40) | class PrepareLayer(nn.Module):
method __init__ (line 53) | def __init__(self, node_feats, stat):
method normalize_input (line 59) | def normalize_input(self, node_feature):
method forward (line 64) | def forward(self, g, node_feature):
class InteractionNet (line 73) | class InteractionNet(nn.Module):
method __init__ (line 87) | def __init__(self, node_feats, stat):
method denormalize_output (line 105) | def denormalize_output(self, out):
method forward (line 111) | def forward(self, g, n_feat, e_feat, global_feats, relation_feats):
class InteractionLayer (line 120) | class InteractionLayer(nn.Module):
method __init__ (line 155) | def __init__(
method update_edge_fn (line 189) | def update_edge_fn(self, edges):
method update_node_fn (line 197) | def update_node_fn(self, nodes):
method forward (line 202) | def forward(self, g, node_feats, edge_feats, global_feats, relation_fe...
FILE: examples/pytorch/graphsim/n_body_sim.py
function init (line 22) | def init(total_state, n_body, fea_num, orbit):
function norm (line 63) | def norm(x):
function get_f (line 67) | def get_f(reciever, sender):
function compute_stats (line 76) | def compute_stats(train_curr):
function calc (line 84) | def calc(cur_state, n_body):
function gen (line 104) | def gen(n_body, num_steps, orbit):
FILE: examples/pytorch/graphsim/train.py
function train (line 21) | def train(
function eval (line 59) | def eval(loss_fn, model, prep, dataloader, device):
function eval_rollout (line 85) | def eval_rollout(model, prep, initial_frame, n_object, device):
FILE: examples/pytorch/graphsim/utils.py
function make_video (line 14) | def make_video(xy, filename):
FILE: examples/pytorch/graphwriter/graphwriter.py
class GraphWriter (line 9) | class GraphWriter(nn.Module):
method __init__ (line 10) | def __init__(self, args):
method enc_forward (line 40) | def enc_forward(
method forward (line 59) | def forward(self, batch, beam_size=-1):
FILE: examples/pytorch/graphwriter/modules.py
class MSA (line 13) | class MSA(nn.Module):
method __init__ (line 19) | def __init__(self, args, mode="normal"):
method forward (line 41) | def forward(self, inp1, inp2, mask=None):
class BiLSTM (line 74) | class BiLSTM(nn.Module):
method __init__ (line 76) | def __init__(self, args, enc_type="title"):
method forward (line 88) | def forward(self, inp, mask, ent_len=None):
class GAT (line 107) | class GAT(nn.Module):
method __init__ (line 109) | def __init__(
method forward (line 138) | def forward(self, graph, feat):
class GraphTrans (line 164) | class GraphTrans(nn.Module):
method __init__ (line 165) | def __init__(self, args):
method forward (line 198) | def forward(self, ent, ent_mask, ent_len, rel, rel_mask, graphs):
FILE: examples/pytorch/graphwriter/opts.py
function fill_config (line 6) | def fill_config(args):
function vocab_config (line 14) | def vocab_config(
function get_args (line 26) | def get_args():
FILE: examples/pytorch/graphwriter/train.py
function train_one_epoch (line 20) | def train_one_epoch(model, dataloader, optimizer, args, epoch):
function eval_it (line 62) | def eval_it(model, dataloader, args, epoch):
function test (line 98) | def test(model, dataloader, args):
function main (line 126) | def main(args):
FILE: examples/pytorch/graphwriter/utlis.py
function write_txt (line 13) | def write_txt(batch, seqs, w_file, args):
function replace_ent (line 38) | def replace_ent(x, ent, V):
function len2mask (line 49) | def len2mask(lens, device):
function pad (line 60) | def pad(var_len_list, out_type="list", flatten=False):
class Vocab (line 110) | class Vocab(object):
method __init__ (line 111) | def __init__(
method __len__ (line 122) | def __len__(self):
method __str__ (line 125) | def __str__(self):
method update (line 128) | def update(self, token):
method build (line 135) | def build(self):
method __call__ (line 147) | def __call__(self, x):
method save (line 153) | def save(self, fname):
method load (line 156) | def load(self, fname):
function at_least (line 160) | def at_least(x):
class Example (line 168) | class Example(object):
method __init__ (line 169) | def __init__(self, title, ent_text, ent_type, rel, text):
method __str__ (line 199) | def __str__(self):
method __len__ (line 204) | def __len__(self):
method from_json (line 208) | def from_json(json_data):
method build_graph (line 217) | def build_graph(self):
method get_tensor (line 255) | def get_tensor(
method update_vocab (line 297) | def update_vocab(
class BucketSampler (line 312) | class BucketSampler(torch.utils.data.Sampler):
method __init__ (line 313) | def __init__(self, data_source, batch_size=32, bucket=3):
method __iter__ (line 318) | def __iter__(self):
method __len__ (line 353) | def __len__(self):
class GWdataset (line 357) | class GWdataset(torch.utils.data.Dataset):
method __init__ (line 358) | def __init__(
method __iter__ (line 386) | def __iter__(self):
method __getitem__ (line 389) | def __getitem__(self, index):
method __len__ (line 392) | def __len__(self):
method batch_fn (line 395) | def batch_fn(self, batch_ex):
function get_datasets (line 445) | def get_datasets(
FILE: examples/pytorch/gxn/data_preprocess.py
function _load_check_mark (line 12) | def _load_check_mark(path: str):
function _save_check_mark (line 20) | def _save_check_mark(path: str, marks: dict):
function node_label_as_feature (line 25) | def node_label_as_feature(dataset: LegacyTUDataset, mode="concat", save=...
function degree_as_feature (line 111) | def degree_as_feature(dataset: LegacyTUDataset, save=True):
FILE: examples/pytorch/gxn/layers.py
class GraphConvWithDropout (line 12) | class GraphConvWithDropout(GraphConv):
method __init__ (line 17) | def __init__(
method call (line 39) | def call(self, graph, feat, weight=None):
class Discriminator (line 44) | class Discriminator(torch.nn.Module):
method __init__ (line 58) | def __init__(self, feat_dim: int):
method reset_parameters (line 63) | def reset_parameters(self):
method forward (line 67) | def forward(
class DenseLayer (line 110) | class DenseLayer(torch.nn.Module):
method __init__ (line 117) | def __init__(
method reset_parameters (line 125) | def reset_parameters(self):
method forward (line 134) | def forward(self, x):
class IndexSelect (line 139) | class IndexSelect(torch.nn.Module):
method __init__ (line 159) | def __init__(
method forward (line 173) | def forward(
class GraphPool (line 227) | class GraphPool(torch.nn.Module):
method __init__ (line 242) | def __init__(self, hidden_dim: int, use_gcn=False):
method forward (line 249) | def forward(
class GraphUnpool (line 299) | class GraphUnpool(torch.nn.Module):
method __init__ (line 311) | def __init__(self, hidden_dim: int):
method forward (line 315) | def forward(self, graph: DGLGraph, feat: Tensor, select_idx: Tensor):
FILE: examples/pytorch/gxn/main.py
function compute_loss (line 19) | def compute_loss(
function train (line 47) | def train(
function test (line 78) | def test(model: torch.nn.Module, loader, device):
function main (line 96) | def main(args):
FILE: examples/pytorch/gxn/main_early_stop.py
function compute_loss (line 19) | def compute_loss(
function train (line 47) | def train(
function test (line 78) | def test(model: torch.nn.Module, loader, device):
function validate (line 97) | def validate(model: torch.nn.Module, loader, device, curr_epoch, total_e...
function main (line 120) | def main(args):
FILE: examples/pytorch/gxn/networks.py
class GraphCrossModule (line 11) | class GraphCrossModule(torch.nn.Module):
method __init__ (line 39) | def __init__(
method forward (line 96) | def forward(self, graph, feat):
class GraphCrossNet (line 240) | class GraphCrossNet(torch.nn.Module):
method __init__ (line 282) | def __init__(
method init_weights (line 339) | def init_weights(self):
method forward (line 347) | def forward(
class GraphClassifier (line 380) | class GraphClassifier(torch.nn.Module):
method __init__ (line 388) | def __init__(self, args):
method forward (line 406) | def forward(
FILE: examples/pytorch/gxn/utils.py
function get_stats (line 13) | def get_stats(
function parse_args (line 57) | def parse_args():
FILE: examples/pytorch/han/main.py
function score (line 6) | def score(logits, labels):
function evaluate (line 18) | def evaluate(model, g, features, labels, mask, loss_func):
function main (line 28) | def main(args):
FILE: examples/pytorch/han/model.py
class SemanticAttention (line 8) | class SemanticAttention(nn.Module):
method __init__ (line 9) | def __init__(self, in_size, hidden_size=128):
method forward (line 18) | def forward(self, z):
class HANLayer (line 26) | class HANLayer(nn.Module):
method __init__ (line 51) | def __init__(
method forward (line 74) | def forward(self, gs, h):
class HAN (line 86) | class HAN(nn.Module):
method __init__ (line 87) | def __init__(
method forward (line 110) | def forward(self, g, h):
FILE: examples/pytorch/han/model_hetero.py
class SemanticAttention (line 17) | class SemanticAttention(nn.Module):
method __init__ (line 18) | def __init__(self, in_size, hidden_size=128):
method forward (line 27) | def forward(self, z):
class HANLayer (line 35) | class HANLayer(nn.Module):
method __init__ (line 60) | def __init__(self, meta_paths, in_size, out_size, layer_num_heads, dro...
method forward (line 85) | def forward(self, g, h):
class HAN (line 106) | class HAN(nn.Module):
method __init__ (line 107) | def __init__(
method forward (line 128) | def forward(self, g, h):
FILE: examples/pytorch/han/train_sampling.py
class HANLayer (line 23) | class HANLayer(torch.nn.Module):
method __init__ (line 48) | def __init__(
method forward (line 72) | def forward(self, block_list, h_list):
class HAN (line 86) | class HAN(nn.Module):
method __init__ (line 87) | def __init__(
method forward (line 108) | def forward(self, g, h):
class HANSampler (line 115) | class HANSampler(object):
method __init__ (line 116) | def __init__(self, g, metapath_list, num_neighbors):
method sample_blocks (line 132) | def sample_blocks(self, seeds):
function score (line 145) | def score(logits, labels):
function evaluate (line 157) | def evaluate(
function load_subtensors (line 214) | def load_subtensors(blocks, features):
function main (line 222) | def main(args):
FILE: examples/pytorch/han/utils.py
function set_random_seed (line 16) | def set_random_seed(seed=0):
function mkdir_p (line 30) | def mkdir_p(path, log=True):
function get_date_postfix (line 50) | def get_date_postfix():
function setup_log_dir (line 64) | def setup_log_dir(args, sampling=False):
function setup (line 103) | def setup(args):
function setup_for_sampling (line 112) | def setup_for_sampling(args):
function get_binary_mask (line 121) | def get_binary_mask(total_size, indices):
function load_acm (line 127) | def load_acm(remove_self_loop):
function load_acm_raw (line 186) | def load_acm_raw(remove_self_loop):
function load_data (line 260) | def load_data(dataset, remove_self_loop=False):
class EarlyStopping (line 269) | class EarlyStopping(object):
method __init__ (line 270) | def __init__(self, patience=10):
method step (line 281) | def step(self, loss, acc, model):
method save_checkpoint (line 301) | def save_checkpoint(self, model):
method load_checkpoint (line 305) | def load_checkpoint(self, model):
FILE: examples/pytorch/hardgat/hgao.py
class HardGAO (line 22) | class HardGAO(nn.Module):
method __init__ (line 23) | def __init__(
method reset_parameters (line 68) | def reset_parameters(self):
method forward (line 77) | def forward(self, graph, feat, get_attention=False):
class HardGAT (line 133) | class HardGAT(nn.Module):
method __init__ (line 134) | def __init__(
method forward (line 198) | def forward(self, inputs):
FILE: examples/pytorch/hardgat/train.py
function accuracy (line 26) | def accuracy(logits, labels):
function evaluate (line 32) | def evaluate(model, features, labels, mask):
function main (line 41) | def main(args):
FILE: examples/pytorch/hardgat/utils.py
class EarlyStopping (line 13) | class EarlyStopping:
method __init__ (line 14) | def __init__(self, patience=10):
method step (line 20) | def step(self, acc, model):
method save_checkpoint (line 38) | def save_checkpoint(self, model):
FILE: examples/pytorch/hgp_sl/functions.py
function _neighbor_sort (line 20) | def _neighbor_sort(
function _threshold_and_support_graph (line 82) | def _threshold_and_support_graph(
class EdgeSparsemaxFunction (line 119) | class EdgeSparsemaxFunction(Function):
method forward (line 131) | def forward(
method backward (line 158) | def backward(ctx, grad_out):
function edge_sparsemax (line 178) | def edge_sparsemax(graph: dgl.DGLGraph, logits, eids=ALL, norm_by="dst"):
class EdgeSparsemax (line 225) | class EdgeSparsemax(torch.nn.Module):
method __init__ (line 259) | def __init__(self):
method forward (line 262) | def forward(self, graph, logits, eids=ALL, norm_by="dst"):
FILE: examples/pytorch/hgp_sl/layers.py
class WeightedGraphConv (line 17) | class WeightedGraphConv(GraphConv):
method forward (line 34) | def forward(self, graph: DGLGraph, n_feat, e_feat=None):
class NodeInfoScoreLayer (line 58) | class NodeInfoScoreLayer(nn.Module):
method __init__ (line 87) | def __init__(self, sym_norm: bool = True):
method forward (line 91) | def forward(self, graph: dgl.DGLGraph, feat: Tensor, e_feat: Tensor):
class HGPSLPool (line 127) | class HGPSLPool(nn.Module):
method __init__ (line 168) | def __init__(
method reset_parameters (line 195) | def reset_parameters(self):
method forward (line 198) | def forward(self, graph: DGLGraph, feat: Tensor, e_feat=None):
class ConvPoolReadout (line 357) | class ConvPoolReadout(torch.nn.Module):
method __init__ (line 360) | def __init__(
method forward (line 388) | def forward(self, graph, feature, e_feat=None):
FILE: examples/pytorch/hgp_sl/main.py
function parse_args (line 19) | def parse_args():
function train (line 112) | def train(model: torch.nn.Module, optimizer, trainloader, device):
function test (line 132) | def test(model: torch.nn.Module, loader, device):
function main (line 149) | def main(args):
FILE: examples/pytorch/hgp_sl/networks.py
class HGPSLModel (line 9) | class HGPSLModel(torch.nn.Module):
method __init__ (line 42) | def __init__(
method forward (line 86) | def forward(self, graph, n_feat):
FILE: examples/pytorch/hgp_sl/utils.py
function get_stats (line 8) | def get_stats(
function get_batch_id (line 52) | def get_batch_id(num_nodes: torch.Tensor):
function topk (line 70) | def topk(
FILE: examples/pytorch/hgt/model.py
class HGTLayer (line 12) | class HGTLayer(nn.Module):
method __init__ (line 13) | def __init__(
method forward (line 67) | def forward(self, G, h):
class HGT (line 133) | class HGT(nn.Module):
method __init__ (line 134) | def __init__(
method forward (line 170) | def forward(self, G, out_key):
class HeteroRGCNLayer (line 180) | class HeteroRGCNLayer(nn.Module):
method __init__ (line 181) | def __init__(self, in_size, out_size, etypes):
method forward (line 188) | def forward(self, G, feat_dict):
class HeteroRGCN (line 209) | class HeteroRGCN(nn.Module):
method __init__ (line 210) | def __init__(self, G, in_size, hidden_size, out_size):
method forward (line 216) | def forward(self, G, out_key):
FILE: examples/pytorch/hgt/train_acm.py
function get_n_params (line 39) | def get_n_params(model):
function train (line 49) | def train(model, G):
FILE: examples/pytorch/hilander/PSS/Smooth_AP/src/auxiliaries.py
function args2exp_name (line 26) | def args2exp_name(args):
function gimme_params (line 32) | def gimme_params(model):
function gimme_save_string (line 47) | def gimme_save_string(opt):
function f1_score (line 69) | def f1_score(
function eval_metrics_one_dataset (line 170) | def eval_metrics_one_dataset(model, test_dataloader, device, k_vals, opt):
function eval_metrics_query_and_gallery_dataset (line 262) | def eval_metrics_query_and_gallery_dataset(
function recover_closest_one_dataset (line 389) | def recover_closest_one_dataset(
function recover_closest_inshop (line 435) | def recover_closest_inshop(
function set_checkpoint (line 499) | def set_checkpoint(model, opt, progress_saver, savepath):
class CSV_Writer (line 526) | class CSV_Writer:
method __init__ (line 533) | def __init__(self, save_path, columns):
method log (line 548) | def log(self, inputs):
function set_logging (line 563) | def set_logging(opt):
class LOGGER (line 604) | class LOGGER:
method __init__ (line 611) | def __init__(self, opt, metrics_to_log, name="Basic", start_new=True):
method provide_progress_saver (line 642) | def provide_progress_saver(self, metrics_to_log):
method log (line 655) | def log(self, main_keys, metric_keys, values):
method update_info_plot (line 678) | def update_info_plot(self):
function metrics_to_examine (line 752) | def metrics_to_examine(dataset, k_vals):
function bool_flag (line 783) | def bool_flag(s):
function vis (line 797) | def vis(model, test_dataloader, device, split, opt):
FILE: examples/pytorch/hilander/PSS/Smooth_AP/src/datasets.py
function give_dataloaders (line 26) | def give_dataloaders(dataset, trainset, testset, opt, cluster_path=""):
function give_inaturalist_datasets (line 87) | def give_inaturalist_datasets(opt):
function give_inaturalist_datasets_for_features (line 160) | def give_inaturalist_datasets_for_features(opt):
function give_inat_datasets_finetune_1head (line 279) | def give_inat_datasets_finetune_1head(testset, cluster_label_path, opt):
class BaseTripletDataset (line 339) | class BaseTripletDataset(Dataset):
method __init__ (line 346) | def __init__(
method ensure_3dim (line 423) | def ensure_3dim(self, img):
method __getitem__ (line 436) | def __getitem__(self, idx):
method __len__ (line 537) | def __len__(self):
class TrainDatasetsmoothap (line 546) | class TrainDatasetsmoothap(Dataset):
method __init__ (line 552) | def __init__(self, image_dict, opt):
method ensure_3dim (line 590) | def ensure_3dim(self, img):
method reshuffle (line 595) | def reshuffle(self):
method __getitem__ (line 627) | def __getitem__(self, idx):
method __len__ (line 640) | def __len__(self):
class TrainDatasetsmoothap1Head (line 644) | class TrainDatasetsmoothap1Head(Dataset):
method __init__ (line 650) | def __init__(self, image_dict_L, image_dict_U, opt):
method sample_same_size (line 695) | def sample_same_size(self):
method ensure_3dim (line 716) | def ensure_3dim(self, img):
method reshuffle (line 721) | def reshuffle(self):
method __getitem__ (line 753) | def __getitem__(self, idx):
method __len__ (line 765) | def __len__(self):
FILE: examples/pytorch/hilander/PSS/Smooth_AP/src/evaluate.py
function evaluate (line 31) | def evaluate(dataset, LOG, **kwargs):
class DistanceMeasure (line 55) | class DistanceMeasure:
method __init__ (line 61) | def __init__(self, checkdata, opt, name="Train", update_epochs=1):
method measure (line 88) | def measure(self, model, epoch):
method update (line 156) | def update(self, mean_class_dist):
method update_csv (line 168) | def update_csv(self, mean_class_dist):
method update_plot (line 181) | def update_plot(self):
class GradientMeasure (line 201) | class GradientMeasure:
method __init__ (line 208) | def __init__(self, opt, name="class-it"):
method include (line 225) | def include(self, params):
method dump (line 243) | def dump(self, epoch):
function evaluate_one_dataset (line 267) | def evaluate_one_dataset(
function evaluate_query_and_gallery_dataset (line 346) | def evaluate_query_and_gallery_dataset(
function evaluate_multiple_datasets (line 442) | def evaluate_multiple_datasets(
FILE: examples/pytorch/hilander/PSS/Smooth_AP/src/finetune_1head.py
function same_model (line 370) | def same_model(model1, model2):
function train_one_epoch_finetune (line 381) | def train_one_epoch_finetune(
FILE: examples/pytorch/hilander/PSS/Smooth_AP/src/get_features.py
function same_model (line 364) | def same_model(model1, model2):
FILE: examples/pytorch/hilander/PSS/Smooth_AP/src/losses.py
function loss_select (line 17) | def loss_select(loss, opt, to_optim):
function sigmoid (line 45) | def sigmoid(tensor, temp=1.0):
function compute_aff (line 56) | def compute_aff(x):
class BinarizedF (line 61) | class BinarizedF(torch.autograd.Function):
method forward (line 62) | def forward(self, inp):
method backward (line 69) | def backward(self, output_grad):
class BinarizedModule (line 78) | class BinarizedModule(torch.nn.Module):
method __init__ (line 79) | def __init__(self):
method forward (line 83) | def forward(self, inp):
class SmoothAP (line 88) | class SmoothAP(torch.nn.Module):
method __init__ (line 119) | def __init__(self, anneal, batch_size, num_id, feat_dims):
method forward (line 141) | def forward(self, preds):
FILE: examples/pytorch/hilander/PSS/Smooth_AP/src/main.py
function same_model (line 382) | def same_model(model1, model2):
function train_one_epoch (line 393) | def train_one_epoch(train_dataloader, model, optimizer, criterion, opt, ...
FILE: examples/pytorch/hilander/PSS/Smooth_AP/src/netlib.py
function initialize_weights (line 15) | def initialize_weights(model):
function rename_attr (line 42) | def rename_attr(model, attr, name):
function networkselect (line 59) | def networkselect(opt):
class ResNet50 (line 101) | class ResNet50(nn.Module):
method __init__ (line 108) | def __init__(self, opt, list_style=False, no_norm=False):
method forward (line 146) | def forward(self, x, feature=False, is_init_cluster_generation=False):
FILE: examples/pytorch/hilander/PSS/train_subg_inat.py
function setup_seed (line 58) | def setup_seed(seed):
function set_train_sampler_loader (line 116) | def set_train_sampler_loader(g, k):
FILE: examples/pytorch/hilander/models/focal_loss.py
class FocalLoss (line 10) | class FocalLoss(nn.Module):
method __init__ (line 30) | def __init__(self, class_num, alpha=None, gamma=2, size_average=True):
method forward (line 43) | def forward(self, inputs, targets):
FILE: examples/pytorch/hilander/models/graphconv.py
class GraphConvLayer (line 12) | class GraphConvLayer(nn.Module):
method __init__ (line 13) | def __init__(self, in_feats, out_feats, bias=True):
method forward (line 17) | def forward(self, bipartite, feat):
class GraphConv (line 35) | class GraphConv(nn.Module):
method __init__ (line 36) | def __init__(self, in_dim, out_dim, dropout=0, use_GAT=False, K=1):
method forward (line 53) | def forward(self, bipartite, features):
FILE: examples/pytorch/hilander/models/lander.py
class LANDER (line 14) | class LANDER(nn.Module):
method __init__ (line 15) | def __init__(
method pred_conn (line 65) | def pred_conn(self, edges):
method pred_den_msg (line 71) | def pred_den_msg(self, edges):
method forward (line 76) | def forward(self, bipartites):
method compute_loss (line 138) | def compute_loss(self, bipartite):
FILE: examples/pytorch/hilander/train.py
function prepare_dataset_graphs (line 56) | def prepare_dataset_graphs(data_path, k_list, lvl_list):
FILE: examples/pytorch/hilander/train_subg.py
function set_train_sampler_loader (line 80) | def set_train_sampler_loader(g, k):
FILE: examples/pytorch/hilander/utils/adjacency.py
function row_normalize (line 12) | def row_normalize(mx):
function sparse_mx_to_indices_values (line 24) | def sparse_mx_to_indices_values(sparse_mx):
FILE: examples/pytorch/hilander/utils/deduce.py
function _find_parent (line 19) | def _find_parent(parent, u):
function edge_to_connected_graph (line 30) | def edge_to_connected_graph(edges, num):
function peaks_to_edges (line 47) | def peaks_to_edges(peaks, dist2peak, tau):
function peaks_to_labels (line 59) | def peaks_to_labels(peaks, dist2peak, tau, inst_num):
function get_dists (line 65) | def get_dists(g, nbrs, use_gt):
function get_edge_dist (line 93) | def get_edge_dist(g, threshold):
function tree_generation (line 99) | def tree_generation(ng):
function peak_propogation (line 119) | def peak_propogation(treeg):
function decode (line 136) | def decode(
function build_next_level (line 185) | def build_next_level(
FILE: examples/pytorch/hilander/utils/density.py
function density_estimation (line 20) | def density_estimation(dists, nbrs, labels, **kwargs):
function density_to_peaks_vectorize (line 32) | def density_to_peaks_vectorize(dists, nbrs, density, max_conn=1, name=""):
function density_to_peaks (line 72) | def density_to_peaks(dists, nbrs, density, max_conn=1, sort="dist"):
FILE: examples/pytorch/hilander/utils/evaluate.py
function _read_meta (line 12) | def _read_meta(fn):
function evaluate (line 23) | def evaluate(gt_labels, pred_labels, metric="pairwise"):
function evaluation (line 58) | def evaluation(pred_labels, labels, metrics):
FILE: examples/pytorch/hilander/utils/faiss_gpu.py
class faiss_index_wrapper (line 14) | class faiss_index_wrapper:
method __init__ (line 15) | def __init__(
method search (line 87) | def search(self, *args, **kargs):
method __del__ (line 90) | def __del__(self):
function batch_search (line 97) | def batch_search(index, query, k, bs, verbose=False):
function faiss_search_approx_knn (line 110) | def faiss_search_approx_knn(
FILE: examples/pytorch/hilander/utils/faiss_search.py
function precise_dist (line 13) | def precise_dist(feat, nbrs, num_process=4, sort=True, verbose=False):
function precise_dist_share_mem (line 34) | def precise_dist_share_mem(
function bmm (line 65) | def bmm(
function faiss_search_knn (line 95) | def faiss_search_knn(
FILE: examples/pytorch/hilander/utils/knn.py
function knns2ordered_nbrs (line 26) | def knns2ordered_nbrs(knns, sort=True):
function fast_knns2spmat (line 40) | def fast_knns2spmat(knns, k, th_sim=0, use_sim=True, fill_value=None):
function build_knns (line 83) | def build_knns(feats, k, knn_method, dump=True):
class knn (line 99) | class knn:
method __init__ (line 100) | def __init__(self, feats, k, index_path="", verbose=True):
method filter_by_th (line 103) | def filter_by_th(self, i):
method get_knns (line 116) | def get_knns(self, th=None):
class knn_faiss (line 139) | class knn_faiss(knn):
method __init__ (line 140) | def __init__(
class knn_faiss_gpu (line 171) | class knn_faiss_gpu(knn):
method __init__ (line 172) | def __init__(
FILE: examples/pytorch/hilander/utils/metrics.py
function _check (line 19) | def _check(gt_labels, pred_labels):
function _get_lb2idxs (line 36) | def _get_lb2idxs(labels):
function _compute_fscore (line 45) | def _compute_fscore(pre, rec):
function fowlkes_mallows_score (line 49) | def fowlkes_mallows_score(gt_labels, pred_labels, sparse=True):
function pairwise (line 68) | def pairwise(gt_labels, pred_labels, sparse=True):
function bcubed (line 73) | def bcubed(gt_labels, pred_labels):
function nmi (line 101) | def nmi(gt_labels, pred_labels):
function precision (line 105) | def precision(gt_labels, pred_labels):
function recall (line 109) | def recall(gt_labels, pred_labels):
function accuracy (line 113) | def accuracy(gt_labels, pred_labels):
FILE: examples/pytorch/hilander/utils/misc.py
class TextColors (line 16) | class TextColors:
class Timer (line 27) | class Timer:
method __init__ (line 28) | def __init__(self, name="task", verbose=True):
method __enter__ (line 32) | def __enter__(self):
method __exit__ (line 36) | def __exit__(self, exc_type, exc_val, exc_tb):
function set_random_seed (line 46) | def set_random_seed(seed, cuda=False):
function l2norm (line 56) | def l2norm(vec):
function is_l2norm (line 61) | def is_l2norm(features, size):
function is_spmat_eq (line 67) | def is_spmat_eq(a, b):
function aggregate (line 71) | def aggregate(features, adj, times):
function mkdir_if_no_exists (line 78) | def mkdir_if_no_exists(path, subdirs=[""], is_folder=False):
function stop_iterating (line 90) | def stop_iterating(
FILE: examples/pytorch/infograph/evaluate_embedding.py
class LogReg (line 13) | class LogReg(nn.Module):
method __init__ (line 14) | def __init__(self, ft_in, nb_classes):
method weights_init (line 18) | def weights_init(self, m):
method forward (line 24) | def forward(self, seq):
function logistic_classify (line 29) | def logistic_classify(x, y, device="cpu"):
function svc_classify (line 69) | def svc_classify(x, y, search):
function evaluate_embedding (line 88) | def evaluate_embedding(embeddings, labels, search=True, device="cpu"):
FILE: examples/pytorch/infograph/model.py
class FeedforwardNetwork (line 13) | class FeedforwardNetwork(nn.Module):
method __init__ (line 31) | def __init__(self, in_dim, hid_dim):
method forward (line 45) | def forward(self, feat):
class GINEncoder (line 57) | class GINEncoder(nn.Module):
method __init__ (line 77) | def __init__(self, in_dim, hid_dim, n_layer):
method forward (line 104) | def forward(self, graph, feat):
class InfoGraph (line 118) | class InfoGraph(nn.Module):
method __init__ (line 138) | def __init__(self, in_dim, hid_dim, n_layer):
method get_embedding (line 156) | def get_embedding(self, graph, feat):
method forward (line 164) | def forward(self, graph, feat, graph_id):
class NNConvEncoder (line 178) | class NNConvEncoder(nn.Module):
method __init__ (line 199) | def __init__(self, in_dim, hid_dim):
method forward (line 221) | def forward(self, graph, nfeat, efeat):
class InfoGraphS (line 240) | class InfoGraphS(nn.Module):
method __init__ (line 261) | def __init__(self, in_dim, hid_dim):
method forward (line 278) | def forward(self, graph, nfeat, efeat):
method unsup_forward (line 286) | def unsup_forward(self, graph, nfeat, efeat, graph_id):
FILE: examples/pytorch/infograph/semisupervised.py
function argument (line 14) | def argument():
class DenseQM9EdgeDataset (line 63) | class DenseQM9EdgeDataset(QM9EdgeDataset):
method __getitem__ (line 64) | def __getitem__(self, idx):
function collate (line 131) | def collate(samples):
function evaluate (line 148) | def evaluate(model, loader, num, device):
FILE: examples/pytorch/infograph/unsupervised.py
function argument (line 12) | def argument():
function collate (line 59) | def collate(samples):
FILE: examples/pytorch/infograph/utils.py
function get_positive_expectation (line 9) | def get_positive_expectation(p_samples, average=True):
function get_negative_expectation (line 26) | def get_negative_expectation(q_samples, average=True):
function local_global_loss_ (line 43) | def local_global_loss_(l_enc, g_enc, graph_id):
function global_global_loss_ (line 66) | def global_global_loss_(sup_enc, unsup_enc):
FILE: examples/pytorch/jknet/main.py
function main (line 17) | def main(args):
FILE: examples/pytorch/jknet/model.py
class JKNet (line 8) | class JKNet(nn.Module):
method __init__ (line 9) | def __init__(
method reset_params (line 32) | def reset_params(self):
method forward (line 38) | def forward(self, g, feats):
FILE: examples/pytorch/jtnn/jtnn/chemutils.py
function set_atommap (line 12) | def set_atommap(mol, num=0):
function get_mol (line 17) | def get_mol(smiles):
function get_smiles (line 25) | def get_smiles(mol):
function decode_stereo (line 29) | def decode_stereo(smiles2D):
function sanitize (line 57) | def sanitize(mol):
function copy_atom (line 66) | def copy_atom(atom):
function copy_edit_mol (line 73) | def copy_edit_mol(mol):
function get_clique_mol (line 86) | def get_clique_mol(mol, atoms):
function tree_decomp (line 94) | def tree_decomp(mol):
function atom_equal (line 177) | def atom_equal(a1, a2):
function ring_bond_equal (line 185) | def ring_bond_equal(b1, b2, reverse=False):
function attach_mols_nx (line 194) | def attach_mols_nx(ctr_mol, neighbors, prev_nodes, nei_amap):
function local_attach_nx (line 220) | def local_attach_nx(ctr_mol, neighbors, prev_nodes, amap_list):
function enum_attach_nx (line 232) | def enum_attach_nx(ctr_mol, nei_node, amap, singletons):
function enum_assemble_nx (line 317) | def enum_assemble_nx(node, neighbors, prev_nodes=[], prev_amap=[]):
function dfs_assemble_nx (line 372) | def dfs_assemble_nx(
FILE: examples/pytorch/jtnn/jtnn/datautils.py
function _unpack_field (line 21) | def _unpack_field(examples, field):
function _set_node_id (line 25) | def _set_node_id(mol_tree, vocab):
class JTNNDataset (line 34) | class JTNNDataset(Dataset):
method __init__ (line 35) | def __init__(self, data, vocab, training=True):
method __len__ (line 52) | def __len__(self):
method __getitem__ (line 55) | def __getitem__(self, idx):
class JTNNCollator (line 144) | class JTNNCollator(object):
method __init__ (line 145) | def __init__(self, vocab, training):
method _batch_and_set (line 150) | def _batch_and_set(graphs, atom_x, bond_x, flatten):
method __call__ (line 163) | def __call__(self, examples):
FILE: examples/pytorch/jtnn/jtnn/jtmpn.py
function onek_encoding_unk (line 45) | def onek_encoding_unk(x, allowable_set):
function atom_features (line 55) | def atom_features(atom):
function bond_features (line 64) | def bond_features(bond):
function mol2dgl_single (line 77) | def mol2dgl_single(cand_batch):
class LoopyBPUpdate (line 147) | class LoopyBPUpdate(nn.Module):
method __init__ (line 148) | def __init__(self, hidden_size):
method forward (line 154) | def forward(self, node):
class GatherUpdate (line 179) | class GatherUpdate(nn.Module):
method __init__ (line 180) | def __init__(self, hidden_size):
method forward (line 186) | def forward(self, node):
class DGLJTMPN (line 197) | class DGLJTMPN(nn.Module):
method __init__ (line 198) | def __init__(self, hidden_size, depth):
method forward (line 214) | def forward(self, cand_batch, mol_tree_batch):
method run (line 249) | def run(
FILE: examples/pytorch/jtnn/jtnn/jtnn_dec.py
function dfs_order (line 16) | def dfs_order(forest, roots):
function dec_tree_node_update (line 30) | def dec_tree_node_update(nodes):
function have_slots (line 34) | def have_slots(fa_slots, ch_slots):
function can_assemble (line 61) | def can_assemble(mol_tree, u, v_node_dict):
function create_node_dict (line 83) | def create_node_dict(smiles, clique=[]):
class DGLJTNNDecoder (line 91) | class DGLJTNNDecoder(nn.Module):
method __init__ (line 92) | def __init__(self, vocab, hidden_size, latent_size, embedding=None):
method forward (line 111) | def forward(self, mol_trees, tree_vec):
method run (line 124) | def run(self, mol_tree_batch, mol_tree_batch_lg, n_trees, tree_vec):
method decode (line 261) | def decode(self, mol_vec):
FILE: examples/pytorch/jtnn/jtnn/jtnn_enc.py
function level_order (line 12) | def level_order(forest, roots):
class EncoderGatherUpdate (line 24) | class EncoderGatherUpdate(nn.Module):
method __init__ (line 25) | def __init__(self, hidden_size):
method forward (line 31) | def forward(self, nodes):
class DGLJTNNEncoder (line 39) | class DGLJTNNEncoder(nn.Module):
method __init__ (line 40) | def __init__(self, vocab, hidden_size, embedding=None):
method forward (line 54) | def forward(self, mol_trees):
method run (line 64) | def run(self, mol_tree_batch, mol_tree_batch_lg):
FILE: examples/pytorch/jtnn/jtnn/jtnn_vae.py
class DGLJTNNVAE (line 24) | class DGLJTNNVAE(nn.Module):
method __init__ (line 25) | def __init__(self, vocab, hidden_size, latent_size, depth):
method move_to_cuda (line 51) | def move_to_cuda(mol_batch):
method encode (line 65) | def encode(self, mol_batch):
method sample (line 82) | def sample(self, tree_vec, mol_vec, e1=None, e2=None):
method forward (line 98) | def forward(self, mol_batch, beta=0, e1=None, e2=None):
method assm (line 129) | def assm(self, mol_batch, mol_tree_batch, mol_vec):
method stereo (line 176) | def stereo(self, mol_batch, mol_vec):
method decode (line 209) | def decode(self, tree_vec, mol_vec):
method dfs_assemble (line 269) | def dfs_assemble(
FILE: examples/pytorch/jtnn/jtnn/line_profiler_integration.py
function profile (line 22) | def profile(f):
FILE: examples/pytorch/jtnn/jtnn/mol_tree.py
function get_slots (line 6) | def get_slots(smiles):
class Vocab (line 14) | class Vocab(object):
method __init__ (line 15) | def __init__(self, smiles_list):
method get_index (line 20) | def get_index(self, smiles):
method get_smiles (line 23) | def get_smiles(self, idx):
method get_slots (line 26) | def get_slots(self, idx):
method size (line 29) | def size(self):
FILE: examples/pytorch/jtnn/jtnn/mol_tree_nx.py
class DGLMolTree (line 16) | class DGLMolTree(object):
method __init__ (line 17) | def __init__(self, smiles):
method treesize (line 74) | def treesize(self):
method _recover_node (line 77) | def _recover_node(self, i, original_mol):
method _assemble_node (line 109) | def _assemble_node(self, i):
method recover (line 141) | def recover(self):
method assemble (line 145) | def assemble(self):
FILE: examples/pytorch/jtnn/jtnn/mpn.py
function onek_encoding_unk (line 42) | def onek_encoding_unk(x, allowable_set):
function atom_features (line 48) | def atom_features(atom):
function bond_features (line 58) | def bond_features(bond):
function mol2dgl_single (line 72) | def mol2dgl_single(smiles):
class LoopyBPUpdate (line 107) | class LoopyBPUpdate(nn.Module):
method __init__ (line 108) | def __init__(self, hidden_size):
method forward (line 114) | def forward(self, nodes):
class GatherUpdate (line 121) | class GatherUpdate(nn.Module):
method __init__ (line 122) | def __init__(self, hidden_size):
method forward (line 128) | def forward(self, nodes):
class DGLMPN (line 135) | class DGLMPN(nn.Module):
method __init__ (line 136) | def __init__(self, hidden_size, depth):
method forward (line 152) | def forward(self, mol_graph):
method run (line 172) | def run(self, mol_graph, mol_line_graph):
FILE: examples/pytorch/jtnn/jtnn/nnutils.py
function cuda (line 9) | def cuda(x):
class GRUUpdate (line 16) | class GRUUpdate(nn.Module):
method __init__ (line 17) | def __init__(self, hidden_size):
method update_zm (line 26) | def update_zm(self, node):
method update_r (line 35) | def update_r(self, node, zm=None):
method forward (line 43) | def forward(self, node):
function tocpu (line 49) | def tocpu(g):
FILE: examples/pytorch/jtnn/vaetrain_dgl.py
function worker_init_fn (line 19) | def worker_init_fn(id_):
function train (line 79) | def train():
function test (line 144) | def test():
FILE: examples/pytorch/label_propagation/main.py
function main (line 10) | def main():
FILE: examples/pytorch/labor/ladies_sampler.py
function find_indices_in (line 8) | def find_indices_in(a, b):
function union (line 15) | def union(*arrays):
function normalized_edata (line 19) | def normalized_edata(g, weight=None):
class LadiesSampler (line 29) | class LadiesSampler(dgl.dataloading.BlockSampler):
method __init__ (line 30) | def __init__(
method compute_prob (line 45) | def compute_prob(self, g, seed_nodes, weight, num):
method select_neighbors (line 65) | def select_neighbors(self, prob, num):
method generate_block (line 84) | def generate_block(self, insg, nei
Copy disabled (too large)
Download .json
Condensed preview — 2167 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (16,513K chars).
[
{
"path": ".clang-format",
"chars": 6277,
"preview": "---\nLanguage: Cpp\n# BasedOnStyle: Google\nAccessModifierOffset: -1\nAlignAfterOpenBracket: AlwaysBreak\nAlignArrayO"
},
{
"path": ".github/ISSUE_TEMPLATE/--work-item--dev-only-.md",
"chars": 671,
"preview": "---\nname: \"\\U0001F528Work Item (DEV ONLY)\"\nabout: Work item issue for tracking progress. Dev team only.\ntitle: ''\nlabels"
},
{
"path": ".github/ISSUE_TEMPLATE/bug-report.md",
"chars": 908,
"preview": "---\nname: \"\\U0001F41B Bug Report\"\nabout: Submit a bug report to help us improve DGL\ntitle: ''\nlabels: ''\nassignees: ''\n\n"
},
{
"path": ".github/ISSUE_TEMPLATE/documentation.md",
"chars": 244,
"preview": "---\nname: \"\\U0001F4DA Documentation\"\nabout: Report an issue related to docs.dgl.ai\ntitle: ''\nlabels: ''\nassignees: ''\n\n-"
},
{
"path": ".github/ISSUE_TEMPLATE/feature-request.md",
"chars": 733,
"preview": "---\nname: \"\\U0001F680Feature Request\"\nabout: Submit a proposal/request for a new DGL feature\ntitle: ''\nlabels: ''\nassign"
},
{
"path": ".github/ISSUE_TEMPLATE/questions-help-support.md",
"chars": 328,
"preview": "---\nname: \"❓Questions/Help/Support\"\nabout: Do you need support? We have resources.\ntitle: ''\nlabels: ''\nassignees: ''\n\n-"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 1315,
"preview": "## Description\r\n<!-- Brief description. Refer to the related issues if existed.\r\nIt'll be great if relevant reviewers ca"
},
{
"path": ".github/workflows/lint.yml",
"chars": 1857,
"preview": "name: Lint\n\non: [pull_request]\n\njobs:\n lintrunner:\n runs-on: ubuntu-latest\n steps:\n - name: Pull DGL\n "
},
{
"path": ".github/workflows/stale.yml",
"chars": 1197,
"preview": "# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.\n#\n# You c"
},
{
"path": ".gitignore",
"chars": 2506,
"preview": "# IDE\n.idea\n\n# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribut"
},
{
"path": ".gitmodules",
"chars": 1401,
"preview": "[submodule \"third_party/dmlc-core\"]\n\tpath = third_party/dmlc-core\n\turl = https://github.com/dmlc/dmlc-core.git\n[submodul"
},
{
"path": ".lintrunner.toml",
"chars": 927,
"preview": "# Black + usort\n[[linter]]\ncode = 'UFMT'\ninclude_patterns = [\n '**/*.py',\n]\ncommand = [\n 'python3',\n 'tests/lin"
},
{
"path": "CMakeLists.txt",
"chars": 19311,
"preview": "cmake_minimum_required(VERSION 3.18)\n########################################\n# Borrowed and adapted from TVM project\n##"
},
{
"path": "CONTRIBUTORS.md",
"chars": 3743,
"preview": "## Contributing to DGL\r\n\r\nContribution is always welcomed. A good starting place is the roadmap issue, where\r\nyou can fi"
},
{
"path": "Jenkinsfile",
"chars": 22989,
"preview": "#!/usr/bin/env groovy\n\n// CI tests are executed within Docker containers as the 'root' user. However,\n// communications "
},
{
"path": "LICENSE",
"chars": 11357,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "NEWS.md",
"chars": 2186,
"preview": "DGL release and change logs\n==========\n\nRefer to the roadmap issue for the on-going versions and features.\n\n0.2\n---\nMajo"
},
{
"path": "README.md",
"chars": 32127,
"preview": "<p align=\"center\">\n <img src=\"http://data.dgl.ai/asset/logo.jpg\" height=\"200\">\n</p>\n\n[.\n"
},
{
"path": "benchmarks/.gitignore",
"chars": 13,
"preview": "html\nresults\n"
},
{
"path": "benchmarks/Jenkinsfile",
"chars": 3568,
"preview": "pipeline {\n triggers {\n issueCommentTrigger('@dgl-bot .*')\n }\n agent {\n docker {\n labe"
},
{
"path": "benchmarks/README.md",
"chars": 4624,
"preview": "DGL Benchmarks\n====\n\nBenchmarking DGL with Airspeed Velocity.\n\nUsage\n---\n\nBefore beginning, ensure that airspeed velocit"
},
{
"path": "benchmarks/asv.conf.json",
"chars": 6684,
"preview": "{\n // The version of the config file format. Do not change, unless\n // you know what you are doing.\n \"version\""
},
{
"path": "benchmarks/benchmarks/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "benchmarks/benchmarks/api/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "benchmarks/benchmarks/api/bench_add_self_loop.py",
"chars": 595,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_batch.py",
"chars": 575,
"preview": "import time\n\nimport dgl\n\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchmark(\"time\")\n@utils.parametrize(\"batch_size\", "
},
{
"path": "benchmarks/benchmarks/api/bench_builtin_apply_edges.py",
"chars": 996,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_builtin_apply_edges_hetero.py",
"chars": 1482,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_builtin_multi_update_all.py",
"chars": 1437,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchma"
},
{
"path": "benchmarks/benchmarks/api/bench_builtin_update_all_coo.py",
"chars": 1345,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_builtin_update_all_csc.py",
"chars": 1410,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_edge_ids.py",
"chars": 1225,
"preview": "import time\n\nimport dgl\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n# edge_ids is not supported on cuda\n# @"
},
{
"path": "benchmarks/benchmarks/api/bench_edge_subgraph.py",
"chars": 853,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_find_edges.py",
"chars": 1048,
"preview": "import time\n\nimport dgl\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchmark(\"time\", timeout=600)\n@"
},
{
"path": "benchmarks/benchmarks/api/bench_format_conversion.py",
"chars": 1170,
"preview": "import time\n\nimport dgl\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchmark(\"time\", timeout=600)\n@"
},
{
"path": "benchmarks/benchmarks/api/bench_fused_sample_neighbors.py",
"chars": 1118,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_heterograph_construction.py",
"chars": 776,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_homograph_edge_construction.py",
"chars": 562,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.skip_i"
},
{
"path": "benchmarks/benchmarks/api/bench_homograph_scipy_construction.py",
"chars": 717,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.skip_i"
},
{
"path": "benchmarks/benchmarks/api/bench_in_degrees.py",
"chars": 1014,
"preview": "import time\n\nimport dgl\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchmark(\"time\", timeout=1200)\n"
},
{
"path": "benchmarks/benchmarks/api/bench_in_edges.py",
"chars": 1009,
"preview": "import time\n\nimport dgl\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchmark(\"time\", timeout=1200)\n"
},
{
"path": "benchmarks/benchmarks/api/bench_in_subgraph.py",
"chars": 873,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_khop.py",
"chars": 619,
"preview": "import time\n\nimport dgl\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchmark(\"time\", timeout=60)\n@u"
},
{
"path": "benchmarks/benchmarks/api/bench_knn_graph.py",
"chars": 904,
"preview": "import time\n\nimport dgl\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchmark(\"time\", timeout=60)\n@u"
},
{
"path": "benchmarks/benchmarks/api/bench_metis_partition.py",
"chars": 575,
"preview": "import time\n\nimport dgl\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.skip_if_gpu()\n@utils.benchmark(\""
},
{
"path": "benchmarks/benchmarks/api/bench_nn_graphconv.py",
"chars": 897,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn"
},
{
"path": "benchmarks/benchmarks/api/bench_nn_heterographconv.py",
"chars": 1421,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn"
},
{
"path": "benchmarks/benchmarks/api/bench_node_subgraph.py",
"chars": 860,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_random_walk.py",
"chars": 1051,
"preview": "import time\n\nimport dgl\n\nimport torch\n\nfrom .. import utils\n\n\ndef _random_walk(g, seeds, length):\n return dgl.samplin"
},
{
"path": "benchmarks/benchmarks/api/bench_readout.py",
"chars": 1227,
"preview": "import time\n\nimport dgl\n\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchmark(\"time\")\n@utils.parametrize(\"batch_size\", "
},
{
"path": "benchmarks/benchmarks/api/bench_reverse.py",
"chars": 675,
"preview": "import time\n\nimport dgl\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchmark(\"time\", timeout=1200)\n"
},
{
"path": "benchmarks/benchmarks/api/bench_sample_neighbors.py",
"chars": 1076,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_to_block.py",
"chars": 930,
"preview": "import time\n\nimport dgl\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.skip_if_gpu()\n@utils.benchmark(\""
},
{
"path": "benchmarks/benchmarks/api/bench_udf_apply_edges.py",
"chars": 1022,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_udf_multi_update_all.py",
"chars": 1533,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_udf_update_all.py",
"chars": 1511,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchm"
},
{
"path": "benchmarks/benchmarks/api/bench_unbatch.py",
"chars": 541,
"preview": "import time\n\nimport dgl\n\nimport torch\n\nfrom .. import utils\n\n\n@utils.benchmark(\"time\")\n@utils.parametrize(\"batch_size\", "
},
{
"path": "benchmarks/benchmarks/kernel/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "benchmarks/benchmarks/kernel/bench_edgesoftmax.py",
"chars": 757,
"preview": "import time\n\nimport dgl\n\nimport torch\n\nfrom .. import utils\n\n\n# The benchmarks for ops edge_softmax\n@utils.benchmark(\"ti"
},
{
"path": "benchmarks/benchmarks/kernel/bench_gsddmm_u_dot_v.py",
"chars": 1489,
"preview": "import time\n\nimport dgl\n\nimport torch\n\nfrom .. import utils\n\n\ndef calc_gflops(graph, feat_size, num_heads, time):\n re"
},
{
"path": "benchmarks/benchmarks/kernel/bench_gspmm_copy_u.py",
"chars": 997,
"preview": "import time\n\nimport dgl\n\nimport torch\n\nfrom .. import utils\n\n\ndef calc_gflops(graph, feat_size, time):\n return round("
},
{
"path": "benchmarks/benchmarks/kernel/bench_gspmm_u_mul_e_sum.py",
"chars": 1638,
"preview": "import time\n\nimport dgl\n\nimport torch\n\nfrom .. import utils\n\n\ndef calc_gflops(graph, feat_size, num_heads, time):\n re"
},
{
"path": "benchmarks/benchmarks/model_acc/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "benchmarks/benchmarks/model_acc/bench_gat.py",
"chars": 3369,
"preview": "import dgl\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dgl.nn.pytorch import GATConv\n\nfrom ."
},
{
"path": "benchmarks/benchmarks/model_acc/bench_gcn.py",
"chars": 2506,
"preview": "import dgl\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dgl.nn.pytorch import GraphConv\n\nfrom"
},
{
"path": "benchmarks/benchmarks/model_acc/bench_gcn_udf.py",
"chars": 3773,
"preview": "import dgl\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .. import utils\n\n\nclass GraphConv(nn"
},
{
"path": "benchmarks/benchmarks/model_acc/bench_rgcn_base.py",
"chars": 1681,
"preview": "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchmetrics.functional import accuracy\n\nfrom .."
},
{
"path": "benchmarks/benchmarks/model_acc/bench_rgcn_ns.py",
"chars": 11824,
"preview": "import itertools\nimport time\n\nimport dgl\nimport dgl.nn.pytorch as dglnn\nimport torch as th\nimport torch.multiprocessing "
},
{
"path": "benchmarks/benchmarks/model_acc/bench_sage.py",
"chars": 2559,
"preview": "import dgl\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dgl.nn.pytorch import SAGEConv\n\nfrom "
},
{
"path": "benchmarks/benchmarks/model_acc/bench_sage_ns.py",
"chars": 7163,
"preview": "import time\n\nimport dgl\nimport dgl.nn.pytorch as dglnn\nimport torch as th\nimport torch.multiprocessing as mp\nimport torc"
},
{
"path": "benchmarks/benchmarks/model_speed/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "benchmarks/benchmarks/model_speed/bench_gat.py",
"chars": 3314,
"preview": "import time\n\nimport dgl\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dgl.nn.pytorch import G"
},
{
"path": "benchmarks/benchmarks/model_speed/bench_gat_ns.py",
"chars": 4989,
"preview": "import time\nimport traceback\n\nimport dgl\nimport dgl.nn.pytorch as dglnn\nimport torch as th\nimport torch.multiprocessing "
},
{
"path": "benchmarks/benchmarks/model_speed/bench_gcn_udf.py",
"chars": 3690,
"preview": "import time\n\nimport dgl\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .. import utils\n\n\nclas"
},
{
"path": "benchmarks/benchmarks/model_speed/bench_pinsage.py",
"chars": 16559,
"preview": "import argparse\nimport pickle\nimport time\n\nimport dgl\nimport dgl.function as fn\n\nimport numpy as np\nimport torch\nimport "
},
{
"path": "benchmarks/benchmarks/model_speed/bench_rgcn_base.py",
"chars": 1276,
"preview": "import time\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .. import rgcn, utils\n\n\n@utils.ben"
},
{
"path": "benchmarks/benchmarks/model_speed/bench_rgcn_hetero_ns.py",
"chars": 11407,
"preview": "import itertools\nimport time\nimport traceback\n\nimport dgl\nimport dgl.nn.pytorch as dglnn\nimport torch as th\nimport torch"
},
{
"path": "benchmarks/benchmarks/model_speed/bench_rgcn_homogeneous_ns.py",
"chars": 10773,
"preview": "import itertools\nimport time\n\nimport dgl\nimport dgl.nn.pytorch as dglnn\nimport torch as th\nimport torch.multiprocessing "
},
{
"path": "benchmarks/benchmarks/model_speed/bench_sage.py",
"chars": 2500,
"preview": "import time\n\nimport dgl\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dgl.nn.pytorch import S"
},
{
"path": "benchmarks/benchmarks/model_speed/bench_sage_ns.py",
"chars": 4076,
"preview": "import time\n\nimport dgl\nimport dgl.nn.pytorch as dglnn\nimport torch as th\nimport torch.multiprocessing as mp\nimport torc"
},
{
"path": "benchmarks/benchmarks/model_speed/bench_sage_unsupervised_ns.py",
"chars": 5755,
"preview": "import time\n\nimport dgl\nimport dgl.function as fn\nimport dgl.nn.pytorch as dglnn\n\nimport numpy as np\nimport torch as th\n"
},
{
"path": "benchmarks/benchmarks/multigpu/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "benchmarks/benchmarks/multigpu/bench_multigpu_rgcn.py",
"chars": 17062,
"preview": "\"\"\"\nModeling Relational Data with Graph Convolutional Networks\nPaper: https://arxiv.org/abs/1703.06103\nCode: https://git"
},
{
"path": "benchmarks/benchmarks/multigpu/bench_multigpu_sage.py",
"chars": 5603,
"preview": "import argparse\nimport math\nimport time\nfrom types import SimpleNamespace\nfrom typing import NamedTuple\n\nimport dgl\nimpo"
},
{
"path": "benchmarks/benchmarks/multigpu/rgcn_model.py",
"chars": 5509,
"preview": "import dgl\nimport torch as th\nimport torch.nn as nn\n\n\nclass BaseRGCN(nn.Module):\n def __init__(\n self,\n "
},
{
"path": "benchmarks/benchmarks/rgcn.py",
"chars": 3577,
"preview": "import dgl\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dgl.nn.pytorch import RelGraphConv\n\nf"
},
{
"path": "benchmarks/benchmarks/utils.py",
"chars": 17359,
"preview": "import inspect\nimport json\nimport os\nimport pickle\nimport shutil\nimport time\nimport zipfile\nfrom functools import partia"
},
{
"path": "benchmarks/run.sh",
"chars": 590,
"preview": "#!/bin/bash\n\nset -e\n\nDEVICE=$1\nROOT=/asv/dgl\n\n. /opt/conda/etc/profile.d/conda.sh\n\nconda activate base\npip install --upg"
},
{
"path": "benchmarks/scripts/README.md",
"chars": 1244,
"preview": "Regression Test Suite\n========================\n\n### Spec of task.json\n```json\n# Note the test will be run if the name sp"
},
{
"path": "benchmarks/scripts/build_dgl_asv.sh",
"chars": 457,
"preview": "#!/bin/bash\n\nset -e\n\n# Default building only with cpu\nDEVICE=${DGL_BENCH_DEVICE:-cpu}\n\npip install -r /asv/torch_gpu_pip"
},
{
"path": "benchmarks/scripts/fix_ram_info.py",
"chars": 974,
"preview": "import json\nfrom pathlib import Path\n\n\ndef main():\n result_dir = Path(__file__).parent / \"..\" / Path(\"results/\")\n "
},
{
"path": "benchmarks/scripts/generate_excel.py",
"chars": 3946,
"preview": "import json\nfrom itertools import product\nfrom pathlib import Path\n\nimport pandas as pd\n\n\ndef get_branch_name_from_hash("
},
{
"path": "benchmarks/scripts/install_dgl_asv.sh",
"chars": 124,
"preview": "#!/bin/bash\n\nset -e\n\n# install\npushd python\nrm -rf build *.egg-info dist\npip uninstall -y dgl\npython3 setup.py install\np"
},
{
"path": "benchmarks/scripts/publish.sh",
"chars": 2690,
"preview": "#!/bin/bash\n\n# The script launches a docker container to run ASV benchmarks. We use the same docker\n# image as our CI (i"
},
{
"path": "benchmarks/scripts/replace_branch.py",
"chars": 2490,
"preview": "import argparse\nimport json\nimport os\nimport re\n\n\ndef json_minify(string, strip_space=True):\n \"\"\"\n Based on JSON.m"
},
{
"path": "benchmarks/scripts/torch_gpu_pip.txt",
"chars": 238,
"preview": "--find-links https://download.pytorch.org/whl/torch_stable.html\ntorch==1.13.1+cu116\ntorchvision==0.14.1+cu116\ntorchmetri"
},
{
"path": "benchmarks/task.json",
"chars": 488,
"preview": "{\n \"r5.16xlarge\": {\n \"tests\": [\n \"api.\", \"kernel.\", \"model_acc.\", \"model_speed.\"\n ],\n "
},
{
"path": "cmake/modules/CUDA.cmake",
"chars": 10212,
"preview": "# CUDA Module\nif(USE_CUDA)\n find_cuda(${USE_CUDA} REQUIRED)\nelse(USE_CUDA)\n return()\nendif()\n\n###### Borrowed from MSH"
},
{
"path": "cmake/modules/FindMETIS.cmake",
"chars": 631,
"preview": "# Find the METIS includes and library\n#\n# This module defines\n# METIS_INCLUDE_DIR - where to find metis.h\n# "
},
{
"path": "cmake/util/FindCUDA.cmake",
"chars": 2260,
"preview": "#######################################################\n# Enhanced version of find CUDA.\n#\n# Usage:\n# find_cuda(${USE_"
},
{
"path": "cmake/util/MshadowUtil.cmake",
"chars": 14045,
"preview": "################################################################################################\n# Command alias for deb"
},
{
"path": "cmake/util/Util.cmake",
"chars": 2155,
"preview": "# NOTE: __dgl_option will not reset existing variables.\nmacro(__dgl_option variable description value)\n if(NOT DEFINED "
},
{
"path": "conda/dgl/README.md",
"chars": 57,
"preview": "conda recipe\n===\n\nBuild the package with `conda build .`\n"
},
{
"path": "conda/dgl/bld.bat",
"chars": 246,
"preview": "REM Needs vcvars64.bat to be called\ngit submodule init\ngit submodule update --recursive\nmd build\ncd build\nCOPY %TEMP%\\dg"
},
{
"path": "conda/dgl/build.sh",
"chars": 239,
"preview": "git submodule init\ngit submodule update --recursive\nmkdir build\ncd build\ncmake -DUSE_CUDA=$USE_CUDA -DUSE_OPENMP=ON -DCU"
},
{
"path": "conda/dgl/conda_build_config.yaml",
"chars": 51,
"preview": "python:\n - 3.8\n - 3.9\n - 3.10\n - 3.11\n - 3.12\n"
},
{
"path": "conda/dgl/meta.yaml",
"chars": 646,
"preview": "package:\n name: dgl{{ environ.get('DGL_PACKAGE_SUFFIX', '') }}\n version: 2.5{{ environ.get('DGL_VERSION_SUFFIX', '') }"
},
{
"path": "conda/dgl/run_test.bat",
"chars": 46,
"preview": "set DGLBACKEND=numpy\n%PYTHON% -c \"import dgl\"\n"
},
{
"path": "conda/dgl/run_test.sh",
"chars": 41,
"preview": "DGLBACKEND=numpy $PYTHON -c 'import dgl'\n"
},
{
"path": "dgl_sparse/CMakeLists.txt",
"chars": 3782,
"preview": "cmake_minimum_required(VERSION 3.8)\nproject(dgl_sparse C CXX)\n\n# Find PyTorch cmake files and PyTorch versions with the "
},
{
"path": "dgl_sparse/build.bat",
"chars": 1170,
"preview": "REM Helper script to build DGL sparse libraries for PyTorch\n@ECHO OFF\nSETLOCAL EnableDelayedExpansion\n\nMD \"%BINDIR%\\dgl_"
},
{
"path": "dgl_sparse/build.sh",
"chars": 982,
"preview": "#!/bin/bash\n# Helper script to build dgl sparse libraries for PyTorch\nset -e\n\nmkdir -p build\nmkdir -p $BINDIR/dgl_sparse"
},
{
"path": "dgl_sparse/find_cmake.py",
"chars": 255,
"preview": "import os\n\nimport torch\n\ncmake_prefix_path = getattr(\n torch.utils,\n \"cmake_prefix_path\",\n os.path.join(os.path"
},
{
"path": "dgl_sparse/include/sparse/dgl_headers.h",
"chars": 1144,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sparse/dgl_headers.h\n * @brief DGL headers used in the sparse librar"
},
{
"path": "dgl_sparse/include/sparse/elementwise_op.h",
"chars": 1306,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sparse/elementwise_op.h\n * @brief DGL C++ sparse elementwise operato"
},
{
"path": "dgl_sparse/include/sparse/matrix_ops.h",
"chars": 1941,
"preview": "/**\n * Copyright (c) 2023 by Contributors\n * @file sparse/matrix_ops.h\n * @brief DGL C++ sparse matrix operators.\n */\n#"
},
{
"path": "dgl_sparse/include/sparse/reduction.h",
"chars": 1715,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sparse/reduction.h\n * @brief DGL C++ sparse matrix reduction operato"
},
{
"path": "dgl_sparse/include/sparse/sddmm.h",
"chars": 1241,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sparse/sddmm.h\n * @brief DGL C++ SDDMM operator.\n */\n#ifndef SPARSE_"
},
{
"path": "dgl_sparse/include/sparse/softmax.h",
"chars": 818,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sparse/softmax.h\n * @brief DGL C++ Softmax operator\n */\n#ifndef SPAR"
},
{
"path": "dgl_sparse/include/sparse/sparse_format.h",
"chars": 4031,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sparse/sparse_format.h\n * @brief DGL C++ sparse format header.\n */\n#"
},
{
"path": "dgl_sparse/include/sparse/sparse_matrix.h",
"chars": 11554,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sparse/sparse_matrix.h\n * @brief DGL C++ sparse matrix header.\n */\n#"
},
{
"path": "dgl_sparse/include/sparse/spmm.h",
"chars": 1048,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sparse/spmm.h\n * @brief DGL C++ SpMM operator.\n */\n#ifndef SPARSE_SP"
},
{
"path": "dgl_sparse/include/sparse/spspmm.h",
"chars": 1066,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sparse/spspmm.h\n * @brief DGL C++ SpSpMM operator.\n */\n#ifndef SPARS"
},
{
"path": "dgl_sparse/src/cpu/matrix_ops_impl.cc",
"chars": 224,
"preview": "/**\n * Copyright (c) 2023 by Contributors\n * @file cpu/matrix_ops_impl.cc\n * @brief DGL C++ matrix operators.\n */\n#incl"
},
{
"path": "dgl_sparse/src/elemenwise_op.cc",
"chars": 6191,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file elementwise_op.cc\n * @brief DGL C++ sparse elementwise operator impl"
},
{
"path": "dgl_sparse/src/matmul.cc",
"chars": 7436,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file matmul.cc\n * @brief DGL sparse matrix multiplication functions.\n */\n"
},
{
"path": "dgl_sparse/src/matmul.h",
"chars": 5806,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file matmul.h\n * @brief DGL sparse matrix multiplication functions.\n */\n#"
},
{
"path": "dgl_sparse/src/matrix_ops.cc",
"chars": 6690,
"preview": "/**\n * Copyright (c) 2023 by Contributors\n * @file matrix_ops.cc\n * @brief DGL C++ matrix operators.\n */\n#include <spar"
},
{
"path": "dgl_sparse/src/matrix_ops_impl.h",
"chars": 455,
"preview": "/**\n * Copyright (c) 2023 by Contributors\n * @file matrix_ops_impl.h\n * @brief DGL C++ sparse matrix operator implement"
},
{
"path": "dgl_sparse/src/python_binding.cc",
"chars": 2011,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file python_binding.cc\n * @brief DGL sparse library Python binding.\n */\n/"
},
{
"path": "dgl_sparse/src/reduction.cc",
"chars": 2598,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file reduction.cc\n * @brief DGL C++ sparse matrix reduction operator impl"
},
{
"path": "dgl_sparse/src/sddmm.cc",
"chars": 4375,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sddmm.cc\n * @brief DGL C++ sparse SDDMM operator implementation.\n */"
},
{
"path": "dgl_sparse/src/softmax.cc",
"chars": 3057,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file softmax.cc\n * @brief DGL C++ Softmax operator implementation\n */\n\n#i"
},
{
"path": "dgl_sparse/src/sparse_format.cc",
"chars": 5548,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sparse_format.cc\n * @brief DGL C++ sparse format implementations.\n *"
},
{
"path": "dgl_sparse/src/sparse_matrix.cc",
"chars": 11715,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sparse_matrix.cc\n * @brief DGL C++ sparse matrix implementations.\n *"
},
{
"path": "dgl_sparse/src/sparse_matrix_coalesce.cc",
"chars": 1040,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file sparse_matrix_coalesce.cc\n * @brief Operators related to sparse matr"
},
{
"path": "dgl_sparse/src/spmm.cc",
"chars": 4384,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file spmm.cc\n * @brief DGL C++ sparse SpMM operator implementation.\n */\n\n"
},
{
"path": "dgl_sparse/src/spspmm.cc",
"chars": 6374,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file spspmm.cc\n * @brief DGL C++ sparse SpSpMM operator implementation.\n "
},
{
"path": "dgl_sparse/src/utils.h",
"chars": 2654,
"preview": "/**\n * Copyright (c) 2022 by Contributors\n * @file utils.h\n * @brief DGL C++ sparse API utilities\n */\n#ifndef DGL_SPARS"
},
{
"path": "dglgo/README.md",
"chars": 16273,
"preview": "# DGL-Go\n\n\nDGL-Go is a command line tool for users to get started with training, using and\nstudying Graph Neural Network"
},
{
"path": "dglgo/dglgo/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "dglgo/dglgo/apply_pipeline/__init__.py",
"chars": 143,
"preview": "from .graphpred import ApplyGraphpredPipeline\nfrom .nodepred import ApplyNodepredPipeline\nfrom .nodepred_sample import A"
},
{
"path": "dglgo/dglgo/apply_pipeline/graphpred/__init__.py",
"chars": 19,
"preview": "from .gen import *\n"
},
{
"path": "dglgo/dglgo/apply_pipeline/graphpred/gen.py",
"chars": 5275,
"preview": "from copy import deepcopy\nfrom pathlib import Path\nfrom typing import Optional\n\nimport ruamel.yaml\nimport torch\nimport t"
},
{
"path": "dglgo/dglgo/apply_pipeline/graphpred/graphpred.jinja-py",
"chars": 3073,
"preview": "import torch\nimport os\nimport csv\n\nfrom tqdm import tqdm\nfrom dgl.data import AsGraphPredDataset\nfrom dgl.dataloading im"
},
{
"path": "dglgo/dglgo/apply_pipeline/nodepred/__init__.py",
"chars": 19,
"preview": "from .gen import *\n"
},
{
"path": "dglgo/dglgo/apply_pipeline/nodepred/gen.py",
"chars": 4719,
"preview": "from copy import deepcopy\nfrom pathlib import Path\nfrom typing import Optional\n\nimport ruamel.yaml\nimport torch\nimport t"
},
{
"path": "dglgo/dglgo/apply_pipeline/nodepred/nodepred.jinja-py",
"chars": 2108,
"preview": "import torch\nimport dgl\nimport os\nimport csv\n\nfrom dgl.data import AsNodePredDataset\n{{ data_import_code }}\n\n{{ model_co"
},
{
"path": "dglgo/dglgo/apply_pipeline/nodepred_sample/__init__.py",
"chars": 19,
"preview": "from .gen import *\n"
},
{
"path": "dglgo/dglgo/apply_pipeline/nodepred_sample/gen.py",
"chars": 4757,
"preview": "from copy import deepcopy\nfrom pathlib import Path\nfrom typing import Optional\n\nimport ruamel.yaml\nimport torch\nimport t"
},
{
"path": "dglgo/dglgo/apply_pipeline/nodepred_sample/nodepred-ns.jinja-py",
"chars": 2108,
"preview": "import torch\nimport dgl\nimport os\nimport csv\n\nfrom dgl.data import AsNodePredDataset\n{{ data_import_code }}\n\n{{ model_co"
},
{
"path": "dglgo/dglgo/cli/__init__.py",
"chars": 59,
"preview": "from .cli import app\n\nif __name__ == \"__main__\":\n app()\n"
},
{
"path": "dglgo/dglgo/cli/apply_cli.py",
"chars": 610,
"preview": "from pathlib import Path\n\nimport autopep8\nimport isort\nimport typer\nimport yaml\n\nfrom ..utils.factory import ApplyPipeli"
},
{
"path": "dglgo/dglgo/cli/cli.py",
"chars": 903,
"preview": "import typer\nfrom ..pipeline import *\nfrom ..model import *\nfrom .apply_cli import apply\nfrom .config_apply_cli import c"
},
{
"path": "dglgo/dglgo/cli/config_apply_cli.py",
"chars": 350,
"preview": "from ..apply_pipeline import *\nimport typer\n\nfrom ..utils.factory import ApplyPipelineFactory\n\nconfig_apply_app = typer."
},
{
"path": "dglgo/dglgo/cli/config_cli.py",
"chars": 435,
"preview": "from ..pipeline import *\nimport typing\nfrom enum import Enum\nfrom pathlib import Path\n\nimport typer\nimport yaml\n\nfrom .."
},
{
"path": "dglgo/dglgo/cli/export_cli.py",
"chars": 1224,
"preview": "import typing\nfrom enum import Enum\nfrom pathlib import Path\n\nimport autopep8\n\nimport isort\nimport typer\nimport yaml\n\nfr"
},
{
"path": "dglgo/dglgo/cli/recipe_cli.py",
"chars": 2455,
"preview": "import os\nimport shutil\nfrom pathlib import Path\nfrom typing import Optional\n\nimport typer\nimport yaml\n\n\ndef list_recipe"
},
{
"path": "dglgo/dglgo/cli/train_cli.py",
"chars": 770,
"preview": "import typing\nfrom enum import Enum\nfrom pathlib import Path\n\nimport autopep8\nimport isort\nimport typer\nimport yaml\n\nfro"
},
{
"path": "dglgo/dglgo/model/__init__.py",
"chars": 85,
"preview": "from .node_encoder import *\nfrom .edge_encoder import *\nfrom .graph_encoder import *\n"
},
{
"path": "dglgo/dglgo/model/edge_encoder/__init__.py",
"chars": 251,
"preview": "from ...utils.factory import EdgeModelFactory\nfrom .bilinear import BilinearPredictor\nfrom .ele import ElementWiseProduc"
},
{
"path": "dglgo/dglgo/model/edge_encoder/bilinear.py",
"chars": 1270,
"preview": "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass BilinearPredictor(nn.Module):\n def __init_"
},
{
"path": "dglgo/dglgo/model/edge_encoder/dot.py",
"chars": 758,
"preview": "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass DotPredictor(nn.Module):\n def __init__(\n "
},
{
"path": "dglgo/dglgo/model/edge_encoder/ele.py",
"chars": 1297,
"preview": "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass ElementWiseProductPredictor(nn.Module):\n d"
},
{
"path": "dglgo/dglgo/model/graph_encoder/__init__.py",
"chars": 181,
"preview": "from ...utils.factory import GraphModelFactory\nfrom .gin_ogbg import OGBGGIN\nfrom .pna import PNA\n\nGraphModelFactory.reg"
},
{
"path": "dglgo/dglgo/model/graph_encoder/gin_ogbg.py",
"chars": 3846,
"preview": "import dgl\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dgl.nn import AvgPooling, GINEConv, S"
},
{
"path": "dglgo/dglgo/model/graph_encoder/pna.py",
"chars": 8348,
"preview": "from typing import List\n\nimport dgl.function as fn\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn"
},
{
"path": "dglgo/dglgo/model/node_encoder/__init__.py",
"chars": 356,
"preview": "from ...utils.factory import NodeModelFactory\nfrom .gat import GAT\nfrom .gcn import GCN\nfrom .gin import GIN\nfrom .sage "
},
{
"path": "dglgo/dglgo/model/node_encoder/gat.py",
"chars": 3274,
"preview": "from typing import List\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dgl.base import dgl_war"
},
{
"path": "dglgo/dglgo/model/node_encoder/gcn.py",
"chars": 2953,
"preview": "import dgl\nimport torch\nimport torch.nn as nn\nfrom dgl.base import dgl_warning\n\n\nclass GCN(nn.Module):\n def __init__("
},
{
"path": "dglgo/dglgo/model/node_encoder/gin.py",
"chars": 2143,
"preview": "import torch.nn as nn\nfrom dgl.base import dgl_warning\nfrom dgl.nn import GINConv\n\n\nclass GIN(nn.Module):\n def __init"
},
{
"path": "dglgo/dglgo/model/node_encoder/sage.py",
"chars": 2673,
"preview": "import dgl\nimport torch.nn as nn\nfrom dgl.base import dgl_warning\n\n\nclass GraphSAGE(nn.Module):\n def __init__(\n "
},
{
"path": "dglgo/dglgo/model/node_encoder/sgc.py",
"chars": 1718,
"preview": "import dgl.function as fn\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dgl.base import dgl_warning\nfrom dg"
},
{
"path": "dglgo/dglgo/pipeline/__init__.py",
"chars": 167,
"preview": "from .graphpred import GraphpredPipeline\nfrom .linkpred import LinkpredPipeline\nfrom .nodepred import NodepredPipeline\nf"
},
{
"path": "dglgo/dglgo/pipeline/graphpred/__init__.py",
"chars": 19,
"preview": "from .gen import *\n"
},
{
"path": "dglgo/dglgo/pipeline/graphpred/gen.py",
"chars": 5976,
"preview": "import copy\nfrom pathlib import Path\nfrom typing import Optional\n\nimport ruamel.yaml\nimport typer\nfrom jinja2 import Tem"
},
{
"path": "dglgo/dglgo/pipeline/graphpred/graphpred.jinja-py",
"chars": 5415,
"preview": "import numpy as np\nimport sklearn\nimport torch\nimport torch.nn as nn\nimport os\n\nfrom torch.optim.lr_scheduler import Red"
},
{
"path": "dglgo/dglgo/pipeline/linkpred/__init__.py",
"chars": 19,
"preview": "from .gen import *\n"
},
{
"path": "dglgo/dglgo/pipeline/linkpred/gen.py",
"chars": 8466,
"preview": "import copy\nfrom pathlib import Path\nfrom typing import Optional\n\nimport ruamel.yaml\nimport typer\nimport yaml\nfrom jinja"
},
{
"path": "dglgo/dglgo/pipeline/linkpred/linkpred.jinja-py",
"chars": 5662,
"preview": "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport dgl\nimport os\n\nfrom torch.u"
},
{
"path": "dglgo/dglgo/pipeline/nodepred/__init__.py",
"chars": 19,
"preview": "from .gen import *\n"
},
{
"path": "dglgo/dglgo/pipeline/nodepred/gen.py",
"chars": 5887,
"preview": "import copy\nfrom pathlib import Path\nfrom typing import Optional\n\nimport ruamel.yaml\nimport typer\nimport yaml\nfrom jinja"
},
{
"path": "dglgo/dglgo/pipeline/nodepred/nodepred.jinja-py",
"chars": 4857,
"preview": "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport dgl\nimport os\n\nfrom dgl.dat"
},
{
"path": "dglgo/dglgo/pipeline/nodepred_sample/__init__.py",
"chars": 19,
"preview": "from .gen import *\n"
},
{
"path": "dglgo/dglgo/pipeline/nodepred_sample/gen.py",
"chars": 7842,
"preview": "import copy\nfrom enum import Enum\nfrom pathlib import Path\nfrom typing import List, Optional, Union\n\nimport ruamel.yaml\n"
},
{
"path": "dglgo/dglgo/pipeline/nodepred_sample/nodepred-ns.jinja-py",
"chars": 6734,
"preview": "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport dgl\nimport os\n\nfrom dgl.dat"
},
{
"path": "dglgo/dglgo/utils/__init__.py",
"chars": 23,
"preview": "from .factory import *\n"
},
{
"path": "dglgo/dglgo/utils/base_model.py",
"chars": 1088,
"preview": "import copy\nimport enum\nfrom enum import Enum, IntEnum\nfrom typing import Optional\n\nfrom jinja2 import Template\nfrom pyd"
},
{
"path": "dglgo/dglgo/utils/early_stop.py",
"chars": 1186,
"preview": "import torch\n\n\nclass EarlyStopping:\n def __init__(\n self, patience: int = -1, checkpoint_path: str = \"checkpoi"
},
{
"path": "dglgo/dglgo/utils/enter_config.py",
"chars": 773,
"preview": "import copy\nfrom enum import Enum, IntEnum\nfrom typing import Optional\n\nimport jinja2\nimport yaml\nfrom jinja2 import Tem"
},
{
"path": "dglgo/dglgo/utils/factory.py",
"chars": 16046,
"preview": "import enum\nimport inspect\nimport logging\nfrom abc import ABC, abstractmethod, abstractstaticmethod\nfrom pathlib import "
},
{
"path": "dglgo/dglgo/utils/yaml_dump.py",
"chars": 639,
"preview": "from ruamel.yaml.comments import CommentedMap\n\n\ndef deep_convert_dict(layer):\n to_ret = layer\n if isinstance(layer"
},
{
"path": "dglgo/recipes/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "dglgo/recipes/graphpred_hiv_gin.yaml",
"chars": 1153,
"preview": "version: 0.0.2\npipeline_name: graphpred\npipeline_mode: train\ndevice: cuda:0 # Torch device name, e.q. cpu"
},
{
"path": "dglgo/recipes/graphpred_hiv_pna.yaml",
"chars": 1755,
"preview": "version: 0.0.2\npipeline_name: graphpred\npipeline_mode: train\ndevice: cuda:0 # Torch device name, e.q. cpu"
},
{
"path": "dglgo/recipes/graphpred_pcba_gin.yaml",
"chars": 1164,
"preview": "version: 0.0.2\npipeline_name: graphpred\npipeline_mode: train\ndevice: cuda:0 # Torch device name, e.q. cpu"
},
{
"path": "dglgo/recipes/linkpred_citation2_sage.yaml",
"chars": 1723,
"preview": "version: 0.0.2\npipeline_name: linkpred\npipeline_mode: train\ndevice: cpu\ndata:\n name: ogbl-citation2\n split_ratio: "
},
{
"path": "dglgo/recipes/linkpred_collab_sage.yaml",
"chars": 1720,
"preview": "version: 0.0.2\npipeline_name: linkpred\npipeline_mode: train\ndevice: cpu\ndata:\n name: ogbl-collab\n split_ratio: "
},
{
"path": "dglgo/recipes/linkpred_cora_sage.yaml",
"chars": 1730,
"preview": "version: 0.0.2\npipeline_name: linkpred\npipeline_mode: train\ndevice: cuda\ndata:\n name: cora\n split_ratio: [0.8, 0.1, 0."
}
]
// ... and 1967 more files (download for full content)
About this extraction
This page contains the full source code of the dmlc/dgl GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 2167 files (15.1 MB), approximately 4.0M tokens, and a symbol index with 12494 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.