文件历史

770 次代码提交

作者 SHA1 备注 提交日期
Xin Yao 960092be02 [Feature] Import PyTorch's CUDA stream management (#4503)
* add set_stream

* add .record_stream for NDArray and HeteroGraph

* refactor dgl stream Python APIs

* test record_stream

* add unit test for record stream

* use pytorch's stream

* fix lint

* fix cpu build

* address comments

* address comments

* add record stream tests for dgl.graph

* record frames and update dataloder

* add docstring

* update frame

* add backend check for record_stream

* remove CUDAThreadEntry::stream

* record stream for newly created formats

* fix bug

* fix cpp test

* fix None c_void_p to c_handle
2022-09-16 02:50:27 +00:00
ndickson-nvidia 684f66b7aa [Feature] Added exclude_self and output_batch to knn graph construction (Issues #4323 #4316) (#4389)
* * Added "exclude_self" and "output_batch" options to knn_graph and segmented_knn_graph
* Updated out-of-date comments on remove_edges and remove_self_loop, since they now preserve batch information

* * Changed defaults on new knn_graph and segmented_knn_graph function parameters, for compatibility; pytorch/test_geometry.py was failing

* * Added test to ensure dgl.remove_self_loop function correctly updates batch information

* * Added new knn_graph and segmented_knn_graph parameters to dgl.nn.KNNGraph and dgl.nn.SegmentedKNNGraph

* * Formatting

* * Oops, I missed the one in segmented_knn_graph when I fixed the similar thing in knn_graph

* * Fixed edge case handling when invalid k specified, since it still needs to be handled consistently for tests to pass
* Fixed context of batch info, since it must match the context of the input position data for remove_self_loop to succeed

* * Fixed batch info resulting from knn_graph when output_batch is true, for case of 3D input tensor, representing multiple segments

* * Added testing of new exclude_self and output_batch parameters on knn_graph and segmented_knn_graph, and their wrappers, KNNGraph and SegmentedKNNGraph, into the test_knn_cuda test

* * Added doc comments for new parameters

* * Added correct handling for uncommon case of k or more coincident points when excluding self edges in knn_graph and segmented_knn_graph
* Added test cases for more than k coincident points

* * Updated doc comments for output_batch parameters for clarity

* * Linter formatting fixes

* * Extracted out common function for test_knn_cpu and test_knn_cuda, to add the new test cases to test_knn_cpu

* * Rewording in doc comments

* * Removed output_batch parameter from knn_graph and segmented_knn_graph, in favour of always setting the batch information, except in knn_graph if x is a 2D tensor

Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2022-09-07 08:35:26 +08:00
Chang Liu 1c9d2a0302 [Feature] Unify the cuda stream used in core library (#4480)
* Use an internal cuda stream for CopyDataFromTo

* small fix white space

* Fix to compile

* Make stream optional in copydata for compile

* fix lint issue

* Update cub functions to use internal stream

* Lint check

* Update CopyTo/CopyFrom/CopyFromTo to use internal stream

* Address comments

* Fix backward CUDA stream

* Avoid overloading CopyFromTo()

* Minor comment update

* Overload copydatafromto in cuda device api

Co-authored-by: xiny <xiny@nvidia.com>
2022-09-06 10:14:55 +08:00
peizhou001 62af41c245 [Bug] Enable turn on/off libxsmm at runtime (#4455)
* enable turn on/off libxsmm at runtime by adding a global config and related API


Co-authored-by: Ubuntu <ubuntu@ip-172-31-19-194.ap-northeast-1.compute.internal>
2022-09-05 17:38:34 +08:00
nv-dlasalle 806def67a1 [Cleanup] Remove async_transferer (#4505)
* Remove async_transferer

* remove test

* Remove AsyncTransferer

Co-authored-by: Xin Yao <xiny@nvidia.com>
Co-authored-by: Xin Yao <yaox12@outlook.com>
2022-09-05 11:46:06 +08:00
Rhett Ying 468c0ca4b4 [BugFix] fix crash due to incorrect dtype in dgl.to_block() (#4487)
* [BugFix] fix crash due to incorrect dtype in dgl.to_block()

* fix test failure in TF
2022-08-31 16:09:46 +08:00
Rhett Ying 86656a6b34 [CI] use https instead of http (#4488) 2022-08-31 14:59:40 +08:00
Mufei Li 7a41c126f6 [Doc] Change random.py to random_partition.py in guide on distributed partition pipeline (#4438)
* Update distributed-preprocessing.rst

* Update

Co-authored-by: Ubuntu <ubuntu@ip-172-31-9-26.ap-northeast-1.compute.internal>
2022-08-22 18:12:55 +08:00
Minjie Wang 2cf4bd0acf Merge branch 'master' into dist_part 2022-08-20 13:42:07 +08:00
Mufei Li 2e8ae9f980 [Dist][CI] Unit test for the new distributed partitioning pipeline (#4394)
* chunked graph data format

* Update

* Update

* Update task_distributed_test.sh

* Update

* Update

* Revert "Update"

This reverts commit 03c461870f19375fb03125b061fc853ab555577f.

* Update

* Update

* ssh-keygen

* CI

* install openssh

* openssh

* Update

* CI

* Update

* Update

Co-authored-by: Ubuntu <ubuntu@ip-172-31-53-142.us-west-2.compute.internal>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-16-87.us-west-2.compute.internal>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-20-21.us-west-2.compute.internal>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-9-26.ap-northeast-1.compute.internal>
2022-08-19 14:20:56 +08:00
Rhett Ying 8d3c58202a [CI] upgrade python version to 3.7.0 (#4406)
* [CI] upgrade python version to 3.7.0

* do not upgrade for mxnet cpu due to seg fault

* fix test failure for mxnet
2022-08-17 08:02:44 +00:00
Rhett Ying cf4727a9d9 [CI] upgrade python version to 3.7.0 (#4406)
* [CI] upgrade python version to 3.7.0

* do not upgrade for mxnet cpu due to seg fault

* fix test failure for mxnet
2022-08-17 15:28:34 +08:00
Rhett Ying 39987bc599 [Feature] enable graph partition book support canonical etypes (#4343)
* [Feature] enable graph partition book support canonical etypes

* fix lint

* fix lint

* add todo

* refine according to review comments

* fix lint

* refine naming

* revert PartitionPolicy __init__

* refine docstring

* fix doc string
2022-08-16 11:52:02 +08:00
Xin Yao 3685000aa4 [Bugfix] Fix pinning empty tensors and graphs (#4393) 2022-08-15 16:18:04 +08:00
YJ-Zhao a88e7f7e28 [Example]rgcn-ogbn-mag (#4331)
* rgcn-ogbn-mag

* Add link in README.md

* correct code-format,add the reset_parameters function to the HeteroEmbedding module

* add the annotation in hetero.py

* add a unit test

* modify format

* Update

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-50-143.us-west-2.compute.internal>
2022-08-10 20:12:31 +08:00
Quan (Andy) Gan 62c827c81c [Bug] A bunch of fixes in edge_softmax_hetero (#4336)
* bunch of fixes

* Update test_edge_softmax_hetero.py

* Update test_edge_softmax_hetero.py

Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2022-08-09 15:16:48 +08:00
Chang Liu 5ba5106aca [Bugfix] Fix the default value of num_bases in RelGraphConv module (#4321)
* Fix doc and default settings for RelGraphConv

* Add unit test

* Split msg in two lines to pass CI-lint
2022-08-07 16:33:16 +08:00
Rhett Ying 43ba94ee49 [BugFix] fix etype check in DistGraph.edge_subgraph (#4322) 2022-08-03 11:56:00 +08:00
Xin Yao 463650a772 [Unittest] Improve test_dataloader (#4301)
* test ddp dataloader

* add pure_gpu for edgedataloader

* resolve ddp issue
2022-08-02 10:31:09 +08:00
Rhett Ying 4dd16f5dd8 [BugFix] enable DistGraph.find_edge() works with str or tuple of str (#4319) 2022-08-01 20:47:15 +08:00
Xin Yao 44b6864114 [Feature] Enable UVA for Weighted Samplers (#4314)
* enable use for weighted neighbor sampler and biased random walk

* add unit tests

* fix for mxnet/tf

* fix typo
2022-08-01 17:56:51 +08:00
Rhett Ying d6957c28ff [BugFix] fix incorrect _bias and bias usage (#4310) 2022-07-30 17:40:54 +08:00
Rhett Ying b3242e90b8 [CI] separate distributed tests from torch cpu tests (#4313)
* [CI] separate distributed tests from torch cpu tests

* remove TF related env
2022-07-30 16:32:35 +08:00
Xin Yao 86c81b4e92 [Feature] Add CUDA Weighted Neighborhood Sampling (#4064)
* add weighted sampling without replacement (A-Chao)

* improve Algorithm A-Chao with block-wise prefix sum

* correctly fill out_idxs

* implement weighted sampling with replacement

* small fix

* merge host-side code of weighted/uniform sampling

* enable unit tests for cuda weighted sampling

* move thrust/cub wrapper to the cmake file

* update docs accordingly

* fix linting

* fix linting

* fix unit test

* Bump external CUB/Thrust versions

* Fix code style and update description of algorithm design

* [Feature] GPU support weighted graph neighbor sampling
commit by pengqirong(OPPO)

* merge pengqirong's implementation

* revert the change to cub and thrust

* fix linting

* use DeviceSegmentedSort for better performance

* add more comments

* add necessary notes

* add necessary notes

* resolve some comments

* define THRUST_CUB_WRAPPED_NAMESPACE

* fix doc

Co-authored-by: 彭齐荣 <657017034@qq.com>
2022-07-29 11:08:48 +08:00
Rhett Ying 17f1432ab2 [DistTest] fix incorrect shell if statement (#4304)
* [DistTest] fix incorrect shell if statement

* fix incorrect use of dist.initialize()
2022-07-28 20:14:47 +08:00
Pengfei Xia 2cf05c5342 [Transform] Allow add data to self loop created by AddSelfLoop or add_self_loop (#4261)
* Update

* Update functional.py

* Update

* Update test_transform.py

* Update

* Update functional.py

* Update functional.py

* Update functional.py

* Update functional.py

* Update

* Update

* Update functional.py

* Update functional.py

* Update functional.py

* Update functional.py

* Update module.py

* Update test_transform.py

* Update test_transform.py

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
2022-07-27 15:14:03 +08:00
Rhett Ying 069068aa7d [Log] fix confusing error log in TCPSocket::Bind() (#4299)
* [Log] fix confusing error log in TCPSocket::Bind()

* fix lint
2022-07-27 08:25:42 +08:00
Dewvin 7e6a6b4ac0 [Feature] Add CUDA Weighted Randomwalk Sampling (#4243)
* [Feature] Add CUDA Weighted Randomwalk Sampling

* [Feature] Add CUDA Weighted Randomwalk Sampling

* [Feature] Add CUDA Weighted Randomwalk Sampling

* [Feature] Add CUDA Weighted Randomwalk Sampling

* fix empty prob array && enable non-uniform for restart && enable unit tests

* update doc and guide for randomwalk and pinsage

* update comments

Co-authored-by: zhenliangqiu <ubuntu@ip-172-31-24-245.ap-southeast-1.compute.internal>
Co-authored-by: xiny <xiny@nvidia.com>
2022-07-26 13:42:39 +08:00
Serge Panev 5fc1d0c83a [Dist][Test] Add tests for multi-node DistEmbedding (#4256)
Signed-off-by: Serge Panev <spanev@nvidia.com>

Co-authored-by: Rhett Ying <85214957+Rhett-Ying@users.noreply.github.com>
2022-07-20 20:04:26 +08:00
Serge Panev 4dc5728af3 [Dist][Test] Improves DistTensor test for num_part id > 2 (#4265)
Signed-off-by: Serge Panev <spanev@nvidia.com>

Co-authored-by: Rhett Ying <85214957+Rhett-Ying@users.noreply.github.com>
2022-07-19 17:53:41 +08:00
Xin Yao 79b0a50afc [Unittest][Fix] Several unit tests fixes for Ampere+ and PyTorch 1.12+ (#4213)
* Fix test_csrmm for tensor core

* unset allow tf32 flag

* update test unified tensor

* skip fp16 for CPU
2022-07-14 19:59:57 +08:00
Rhett Ying 14e4e1b0f7 [Dist] enable to specify sort_etype for sample_etype_neighbours (#4212)
* [Dist] enable to specify sort_etype for sample_etype_neighbours

* fix lint

* pass argument instead of env

* fix lint and doc string

* refine args

* remove unnecessary lines

* debug only

* debug add sort time log

* change interface

* fix typo

Co-authored-by: Xin Yao <xiny@nvidia.com>
2022-07-11 18:37:25 +08:00
Rhett Ying c65d6fa55f [Dist] format dtypes when loading graph in server (#4228)
* [Dist] format dtypes when loading graph in server

* add test

* refine

* add comments
2022-07-11 14:08:17 +08:00
Serge Panev e3b6ac8e6c [Dist][Test] Add tests for multi-node DistTensor (#4122)
Signed-off-by: Serge Panev <spanev@nvidia.com>

Co-authored-by: Rhett Ying <85214957+Rhett-Ying@users.noreply.github.com>
2022-07-08 10:47:41 +08:00
Vibhu Jawa 9ae117d3cd [Feature] Add to_cugraph and from_cugraph to DGL (#4166)
* Added to_cugraph and from_cugraph functionality

* fix from_cugraph example

* Addressed Reviews

* Fix linting

* Apply suggestions to docstrings from code review

Co-authored-by: Minjie Wang <minjie.wang@nyu.edu>

* Add API docs and remove `from_cugraph` alias

* move cugraph tests to  tests/cugraph/test_basics.py

* remove ununsed imports from test_basics.py

* remove pytest.importorskip as no longer needed

Co-authored-by: Minjie Wang <minjie.wang@nyu.edu>
Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2022-07-07 11:52:17 +08:00
Chang Liu 885be1784b [Example][Refactor] Refactor GCN example (#4160)
* Refactor GCN example

* Refactor GCN based on graphsage

* Readme update

* Minor update

* update

* Remove user-defined GCN implementation

* README update

* Update

* Update CONTRIBUTORS.md

* update task_example_test

Co-authored-by: Xin Yao <xiny@nvidia.com>
2022-07-05 15:58:31 +08:00
Rhett Ying 85f281170f [CI] Add new CI stage for testing cugraph (#4171)
* [CI] add new stage specific forcuda related features based on nvidia+pytorch

* build and test for gpu_nv

* fix build failure

* fix unit tests

* make -j

* install cython beforehand

* copy cython lib

* test cugraph tests only

* fix typo

* separate test script for cugraph

* refactor build dgl shell
2022-07-05 10:57:07 +08:00
Rhett Ying dcf1699280 [BugFix] check whether etype sorted when sampling (#4198) 2022-07-01 15:52:14 +08:00
Rhett Ying 6a6597a02a [Feature] extend sort_csr/csc_by_tag to edge (#4164)
* [Feature] extend sort_csr/csc_by_tag to edge

* fix test ffailure in tensorflow

* refine sorting by edges

* fix docstring

* remove unnecessary mem

Co-authored-by: Xin Yao <xiny@nvidia.com>
2022-07-01 13:16:11 +08:00
Minjie Wang f7dae4533a [CI] Reduce CI workload (#4196)
* try optimize CI

* fix go test; adjust timing report

* disable certain tests for mx/tf backends

* fix ut

* add pydantic
2022-06-30 20:01:16 +08:00
nv-dlasalle d2a22984c1 [bugfix] Implement __setstate__ for Column (fixes #4107) (#4174)
* * Workaround for graph data saving/loading compatibility problem in Column class.  There may be more places in DGL with the same issue, due to using Python serialization, instead of a more cohesive, comprehensive strategy.  This is just a local fix.

* Add checking for non-empty states

* Add unit test

* Handle the case of columns without storage

Co-authored-by: ndickson <ndickson@nvidia.com>
Co-authored-by: Xin Yao <xiny@nvidia.com>
2022-06-30 10:10:44 +08:00
Mufei Li 8b19c28788 Update test_transform.py (#4190) 2022-06-29 21:03:23 +08:00
nv-dlasalle 1dddaad4f0 [bugfix] Allow communicators of size one when NCCL is missing (#3713)
* Update nccl communicator for when NCCL is missing

* Use static_cast

* Add doc string

* Fix whitespace

* Resrtict unit test to GPU runs

Co-authored-by: Xin Yao <xiny@nvidia.com>
2022-06-29 11:48:16 +08:00
Mufei Li a25a14f2fa [Bug Fix] Fix A Bug Related to GroupRevRes (#4181)
Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
Co-authored-by: Xin Yao <xiny@nvidia.com>
2022-06-28 21:17:20 +08:00
Mufei Li cb39dbfa13 Update (#4178) 2022-06-28 15:44:03 +08:00
nv-dlasalle 020f02498c [Performance][Optimizer] Enable using UVA and FP16 with SparseAdam Optimizer (#3885)
* Add uva by default to embedding

* More updates

* Update optimizer

* Add new uva functions

* Expose new pinned memory function

* Add unit tests

* Update formatting

* Fix unit test

* Handle auto UVA case when training is on CPU

* Allow per-embedding decisions for whether to use UVA

* Address spares_optim.py comments

* Remove unused templates

* Update unit test

* Use dgl allocate memory for pinning

* allow automatically unpin

* workaround for d2h copy with a different dtype

* fix linting

* update error message

* update copyright

Co-authored-by: Xin Yao <xiny@nvidia.com>
Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2022-06-24 09:20:08 +08:00
Xin Yao 077e002fe5 [Bugfix][Rework] Automatically unpin tensors pinned by DGL (rework #3997) (#4135)
* Explicitly unpin tensoradapter allocated arrays

* Undo unrelated change

* Add unit test

* update unit test

* add pinned_by_dgl flag to NDArray::Container

* use dgl.ndarray for holding the pinning status

* update multi-gpu uva inference

* reinterpret cast NDArray::Container* to DLTensor* in MoveAsDLTensor

* update unpin column and examples

* add unit test for unpin column

Co-authored-by: Dominique LaSalle <dlasalle@nvidia.com>
Co-authored-by: nv-dlasalle <63612878+nv-dlasalle@users.noreply.github.com>
2022-06-23 13:56:54 +08:00
Quan (Andy) Gan 71157b05a8 [Bug] Fix problem with ShaDowKHopSampler working with reverse edge type exclusion (#4145)
* fix

* fix

* Update utils.py
2022-06-22 21:37:13 +08:00
Mufei Li 31e4a89b23 [DGL-Go] Inference for Node Prediction Pipeline (full & ns) (#4095)
* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update
2022-06-21 17:45:44 +08:00
Rhett Ying 69226588a5 [Dist] defer to load node/edge feats (#4143)
* [Dist] defer to load node/edge feats

* fix lint

* Update python/dgl/distributed/partition.py

Co-authored-by: Minjie Wang <minjie.wang@nyu.edu>

* Update python/dgl/distributed/partition.py

Co-authored-by: Minjie Wang <minjie.wang@nyu.edu>

* fix lint

Co-authored-by: Minjie Wang <minjie.wang@nyu.edu>
2022-06-20 19:44:37 +08:00