文件历史

339 次代码提交

作者 SHA1 备注 提交日期
Quan (Andy) Gan 582f71a173 Fix openmp header (#3325) 2021-11-05 05:13:11 +00:00
nv-dlasalle 46557ee8a8 Update cub for cuda 11.5 compatibility (#3468) 2021-11-05 03:11:37 +00:00
nv-dlasalle e3dd242072 [Fix] Split nccl sparse push into two groups (#3404) 2021-11-04 08:19:37 +00:00
zexi yuan 71220a12db [Bugfix] three bugs related to using DGL as a subdirectory(third_party) of another project. (#3379)
* [Bugfix] fix a compile error for Debug-BuildType on Windows Platform

When using CMakeLists.txt to build the "Debug" BuildType on the Windows Platform, it has three compile errors (C4716) in the file "dgl\src\runtime\shared_mem.cc":

'dgl::runtime::SharedMemory::CreateNew': must return a value
'dgl::runtime::SharedMemory::Open': must return a value
'dgl::runtime::SharedMemory::Exist': must return a value

* [Bugfix] cmake error "cannot find load file" when DGL as a sub_directory on Linux

When using DGL as a subdirectory in a CMake Project, the "CMAKE_SOURCE_DIR" here will return the parent cmake scope dir, which is not a expected dir.
Maybe it is better to use "CMAKE_CURRENT_SOURCE_DIR" to set "GKLIB_PATH".

* [Bugfix] cmd cmake error when DGL as a subdirectory

When DGL as a subdirectory of another project, the WORKING_DIRECTORY of "add_custom_command" will be incorrect at the line 255 of "CMakeLists.txt", such that making a cmake "setlocal" error.
2021-11-04 08:15:25 +00:00
Rhett Ying cc83b49e01 [Bug] check dtype before convert to gk (#3414) 2021-11-04 06:13:19 +00:00
Quan (Andy) Gan 84169b1954 [Feature] Graceful handling of exceptions thrown within OpenMP blocks (#3353)
* graceful c++ exception in OpenMP

* credits

* add test

Co-authored-by: Jinjing Zhou <VoVAllen@users.noreply.github.com>
2021-11-04 06:10:35 +00:00
Rhett Ying 1c9274f168 [BugFix] initialize data if null when converting from row sorted coo to csr (#3360) 2021-11-04 06:08:45 +00:00
Rhett Ying 2b45b8c72d [Performance] improve coo2csr space complexity when row is not sorted (#3326)
* [Performance] improve coo2csr space complexity when row is not sorted

* [Perf] replace std::vector<> by NDArray

* keep both impl of unsorted coo to csr and choose according to graph density dynamically

* refine criteria to choose btw Unsorted algos

Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-27.us-west-2.compute.internal>
2021-11-04 06:08:04 +00:00
Tomasz Patejko 50082a571f [Performance, CPU] Rewriting OpenMP pragmas into parallel_for (#3171)
* [CPU, Parallel] Rewriting omp pragmas with parallel_for

* [CPU, Parallel] Decrease number of calls to task function

* c[CPU, Parallel] Modify calls to new interface of parallel_for
2021-11-04 06:06:53 +00:00
xiang song(charlie.song) f9d51fdf0b [Feature] Add a HINT for the per edge type sampler of heterogeneous DistGraph that highlighting the etypes are sorted already. (#3260)
* pass cpp test

* distgraph use sorted edge flag.

* lint

* triger

* update test

Co-authored-by: Ubuntu <ubuntu@ip-172-31-2-66.ec2.internal>
2021-11-04 06:02:42 +00:00
nv-dlasalle b0346bbd4f [CPU][Sampling][Performance] Improve sampling on the CPU. (#3274)
* Optimize sampling

* Stop initialization of array

* Fix includes for linting

* Move comment

* Fix replace

Co-authored-by: Da Zheng <zhengda1936@gmail.com>
2021-11-04 06:02:06 +00:00
sanchit-misra a171f41270 Fixes bug #3312 (#3345)
* Fixes bug #3312

* Fixing lint errors

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
2021-11-04 05:49:02 +00:00
esang f77bee328a [Bugfix] Fix bugs of farthest_point_sampler (#3327)
* fix start_idx

* fix the bug when cuda > 0

Co-authored-by: Tong He <hetong007@gmail.com>
2021-11-04 05:48:21 +00:00
xiang song(charlie.song) 508197e807 [New Feature] Per edge type sampler for to_homogeneous graphs. (#3131)
* fix.

* fix.

* fix.

* fix.

* Fix test

* Deprecate old DistEmbedding impl, use synchronized embedding impl

* Basic imple of heterogeneous on homogenenous sampling

* make pass

* Pass C++ test

* Add python test code

* lint

* lint

* Add MultiLayerEtypeNeighborSampler

* Add unitest for single machine dataloader

* Add dist dataloader test for edge type sampler

* Fix lint

* fix

* support for per etype sample

* Fix some bug and enable distributed training with per edge sample

* fix

* Now distributed training works

* turn off some mxnet

* turn off mxnet for some dist test

* fix

* upd

* upd according to the comments

* Fix

* Fix test and now distributed works.

* upd

* upd

* Fix

* Fix bug

* remove dead code.

* upd

* Fix

* upd

* Fix

Co-authored-by: Ubuntu <ubuntu@ip-172-31-71-112.ec2.internal>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-2-66.ec2.internal>
Co-authored-by: Da Zheng <zhengda1936@gmail.com>
2021-11-02 09:21:20 +00:00
Quan (Andy) Gan ce52a5378e fix (#3286) 2021-08-27 01:32:20 +00:00
nv-dlasalle d9a2d74167 [Performance][Feature] Implement edge excluding in EdgeDataLoader on GPU (#3226)
* Update filter code

* Add unit tests

* Fixes

* Switch to indices

* Rename functions

* Fix linting

* Fix whitespace

* Add doc

* Fix heterograph

* Change workspace allocation

* Fix linting

* Fix docs in filter.py

* Add todo

Co-authored-by: Jinjing Zhou <VoVAllen@users.noreply.github.com>
Co-authored-by: Quan (Andy) Gan <coin2028@hotmail.com>
2021-08-20 02:47:48 +00:00
Quan (Andy) Gan 3ccd4a29e8 fix cuda 11.1 crashing bug (#3265) 2021-08-20 02:44:56 +00:00
nv-dlasalle 563de608fe [bugfix] Only link the pytorch tensordispatcher against libtorch (#3225)
* Only link tensordispatcher against pytorch

* Only modify libraries when not using MSVC
2021-08-20 02:38:52 +00:00
nv-dlasalle e80c409f57 [bugfix] Fix curand_init() calls in rowwise sampling (#3196)
* Split out separate generators for each thread

* Amortize cost of curand_init

* Improve readability

Co-authored-by: Jinjing Zhou <VoVAllen@users.noreply.github.com>
Co-authored-by: Quan (Andy) Gan <coin2028@hotmail.com>
2021-08-20 02:29:49 +00:00
Jingcheng Yu ffa5826724 [Bugfix] fix potential starving in socket receiver (#3176)
Co-authored-by: JingchengYu94 <jingchengyu94@gmail.com>
Co-authored-by: xiang song(charlie.song) <classicxsong@gmail.com>
2021-08-20 02:12:49 +00:00
Jinjing Zhou d15582b147 Remove redundant fill in SPMM kernel (#3166)
* remove redundant fill

* trigger ci
2021-07-21 11:07:51 +00:00
Quan (Andy) Gan 0e75b64cb0 speed up random walks (#3158)
Co-authored-by: Jinjing Zhou <VoVAllen@users.noreply.github.com>
2021-07-21 11:07:51 +00:00
sanchit-misra fac75e166b [CPU][Kernel] Single socket spmm (#3024)
* optimizations of spmm for CPU

* Added names of contributors

* Minor code cleanup

* Moved the spmm optimization code to a new header file

* Moved to DGL's logging method

* removed duplicate code between SpMMSumCsr and SpMMCmpCsr

* Changes made to follow Google coding style

* Fixed lint errors in spmm.h

* Fixed some lint errors from spmm_blocking_libxsmm.h

* Fixed lint errors from spmm_blocking_libxsmm.h

* Added comments to SpMMCreateLibxsmmKernel

* to enable building of tests, and other cosmetic changes

* disabling libxsmm on windows

* Put a condition to avoid opt impl for FP64 as libxsmm does not have FP64 support yet

* cosmetic changes and documentation

* cosmetic changes

* to pass lint tests

* replaced multiple allocations for buffers of indices and edges with a single allocation

Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2021-07-13 11:18:29 +08:00
Jinjing Zhou 183d29de56 fix cub problem (#3121) 2021-07-08 17:57:10 +08:00
Quan (Andy) Gan 2f41fcd986 [Build] fix various build problems (#3117) 2021-07-08 11:39:33 +08:00
Israt Nisa 188152b853 [Feature] Add Heterograph support on Python for builtin unary msg functions (copy_u, copy_e) (#2989)
* heterograph for binary func

* Added SDDMM support

* Added unittest

* added binary test cases

* unary mfuncs works

* Fixed lint err

* lint check and others

* link check

* fixed import *_hetero issue

* lint check

* replace torch with dgl backend

* lint cehck

* removed torch from test

* skip mxnet unittest

* skip gpu test

* Remove unused/duplicated code

* minor

* changed data structure of ndata and edata

* link check

* reorganized

* minor lint

* minor lint

* raise error for udf func

* lint check

* fix for CUDA 10.1

* add a note for future cross-type max/min reducing

* Add support CUDA < 11

* lint check

* tidied C code

* remove dummy GSDDMM_hetero backward implementation

Co-authored-by: Israt Nisa <nisisrat@amazon.com>
Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
Co-authored-by: Quan Gan <coin2028@hotmail.com>
2021-07-06 20:41:58 +08:00
Quan (Andy) Gan 4e74dc86af fix curand (#3077)
Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2021-07-02 13:37:06 +08:00
nv-dlasalle a0390dde93 [Feature] Add dgl.utils.is_sorted_srcdst() (#2685)
* Add dgl.utils.is_sorted_srcdst

* Fix linting issues

* delete blank line

* Specify datatype to index tensor in test

* Force integer conversion

Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
Co-authored-by: Quan (Andy) Gan <coin2028@hotmail.com>
2021-07-02 11:29:24 +08:00
Jinjing Zhou 9664cdffd3 [Build] Make nccl optional (#3056)
* fix

* remove nvidiasmi

* fix

* fix docs

* fix

* fix

* 1

* fix

* remove

* skip deprecated kernel

* fix

* Revert "skip deprecated kernel"

This reverts commit c5ceb7f60dbbaf065b81cc3680757fd611d90ad3.

* fix
2021-06-27 22:36:01 +08:00
Quan (Andy) Gan acd21a6d60 [Feature] Support direct creation from CSR and CSC (#3045)
* csr and csc creation

* fix

* fix

* fixes to adj transpose

* fine

* raise error if indptr did not match number of nodes

* fix

* huh?

* oh

Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2021-06-25 10:05:47 +08:00
Qidong Su e56bbafd25 [Feature] Biased Neighbor Sampling (#2987)
* update

* update

* update

* update

* lint

* lint

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* lint

* update

* clone

* update

* update

* update

* update

* replace idarray with ndarray

* refactor cpp part

* refactor python part

* debug

* refactor interface

* test and doc

* lint and test

* lint

* fix

* fix

* fix

* const

* doc

* fix

* fix

* fix

* fix

* fix & doc

* fix

* fix

* update

* update

* update

* merge

* doc

* doc

* lint

* fix

* more tests

* doc

* fix

* fix

* update

* update

* update

* fix

* fix

Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2021-06-23 17:44:51 +08:00
nv-dlasalle 7415eaa5fa [Bugfix] Handle case where process has no elements to update, in NCCL communicator (#3035)
Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2021-06-23 16:31:29 +08:00
Quan (Andy) Gan e667545da5 [Feature] Node2vec (#2992)
* add seal example

* 1. add paper infomation in examples/README
2. adjust codes
3. option test

* use latest `to_simple` to replace coalesce graph function

* remove outdated codes

* remove useless comment

* Node2vec
1.implement node2vec random walk c++ op
2.implement node2vec model
3.implement node2vec example

* add CMakeLists file modify

* refine c++ codes

* refine c++ codes

* add missing whitespace

* refine python codes

* add codes

* add node2vec_impl.h

* fix codes

* fix code style problem

* fixes

* remove

* lots of changes

* add benchmark

* fixes

Co-authored-by: smilexuhc <smile.xuhc@gmail.com>
Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2021-06-23 14:47:56 +08:00
Israt Nisa 1113f67422 [Kernel] Add heterograph support in CUDA kernels (SpMM, SDDMM) (#2925)
* Added heterograph support SpMM, SDDMM

* bug fix cuda stream

* add cudaStrm destroy and fix whitespace

* Added heterograph support SpMM, SDDMM

* bug fix cuda stream

* add cudaStrm destroy and fix whitespace

* changed max stream = 1

* Fixed ctx

* using default stream

* Added heterograph support SpMM, SDDMM

* bug fix cuda stream

* add cudaStrm destroy and fix whitespace

* changed max stream = 1

* Fixed ctx

* using default stream

* fix bug in copy_rhs

* changed by mistake

* minor datatype change

* added datatype check

Co-authored-by: Israt Nisa <nisisrat@amazon.com>
2021-06-22 09:34:37 +08:00
Mufei Li ff519f98c3 [API] Standardize Subgraph APIs (#2929)
* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Fix

* Update

* Fix subgraph tests

* Capture stdout for distributed test

* Capture stdout for distributed test

* Update

* Update

* Update

* Update subgraph.cc

Co-authored-by: Ubuntu <ubuntu@ip-172-31-28-17.us-west-2.compute.internal>
Co-authored-by: Jinjing Zhou <VoVAllen@users.noreply.github.com>
2021-06-21 19:53:37 +08:00
Da Zheng aaec3d8a0b [Distributed] Support hierarchical partitioning (#3000)
* add.

* fix.

* fix.

* fix.

* fix.

* add tests.

* support node split and edge split.

* support 1 partition.

* add tests.

* fix.

* fix test.

* use hierarchical partition.

* add check.

Co-authored-by: Zheng <dzzhen@3c22fba32af5.ant.amazon.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-22-57.us-west-2.compute.internal>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-71-112.ec2.internal>
2021-06-16 16:58:23 +08:00
Tianqi Zhang (张天启) 64d0f3f355 [Feature] Add NN-descent support for the KNN graph function in dgl (#2941)
* add bruteforce impl

* add nn descent implementation

* change doc-string

* remove redundant func

* use local rng for cuda

* fix lint

* fix lint

* fix bug

* fix bug

* wrap nndescent_knn_graph into knn

* fix lint

* change function names

* add comment for dist funcs

* let the compiler do the unrolling

* use better blocksize setting

* remove redundant line

* check the return of the cub calls

Co-authored-by: Tong He <hetong007@gmail.com>
2021-06-15 14:25:02 +08:00
nv-dlasalle 8b64ae59b8 [Performance] Perform to_block on the GPU when the dataloader is created with a GPU device. (#3016)
* add output device for dataloading

* Update dataloader

* Get sampler device from dataloader

* Fix line length

* Update examples

* Fix to_block GPU for empty relation types

* Handle the case where the DistGraph has None for the underlying graph

Co-authored-by: Da Zheng <zhengda1936@gmail.com>
2021-06-13 18:51:00 +08:00
Tomasz Patejko 411bef5498 [CPU, Parallel] parallel_for with default grain size (#3004) 2021-06-11 17:09:30 +08:00
nv-dlasalle 17d604b5c7 [Feature] Allow using NCCL for communication in dgl.NodeEmbedding and dgl.SparseOptimizer (#2824)
* Split from NCCL PR

* Fix type in comment

* Expand documentation for sparse_all_to_all_push

* Restore previous behavior in example

* Re-work optimizer to use NCCL based on gradient location

* Allow for running with embedding on CPU but using NCCL for gradient exchange

* Optimize single partition case

* Fix pylint errors

* Add missing include

* fix gradient indexing

* Fix line continuation

* Migrate 'first_step'

* Skip tests without enough GPUs to run NCCL

* Improve empty tensor handling for pytorch 1.5

* Fix indentation

* Allow multiple NCCL communicator to coexist

* Improve handling of empty message

* Update python/dgl/nn/pytorch/sparse_emb.py

Co-authored-by: xiang song(charlie.song) <classicxsong@gmail.com>

* Update python/dgl/nn/pytorch/sparse_emb.py

Co-authored-by: xiang song(charlie.song) <classicxsong@gmail.com>

* Keepy empty tensor dimensionaless

* th.empty -> th.tensor

* Preserve shape for empty non-zero dimension tensors

* Use shared state, when embedding is shared

* Add support for gathering an embedding

* Fix typo

* Fix more typos

* Fix backend call

* Use NodeDataLoader to take advantage of ddp

* Update training script to share memory

* Only squeeze last dimension

* Better handle empty message

* Keep embedding on the target device GPU if dgl_sparse if false in RGCN example

* Fix typo in comment

* Add asserts

* Improve documentation in example

Co-authored-by: xiang song(charlie.song) <classicxsong@gmail.com>
2021-06-10 21:19:00 -07:00
Mufei Li 5be937a7fb [Kernel] Slicing Batched Graphs (#2965)
* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Update

* Update

* Add files via upload

* Add files via upload

* Update

* Lint

* Add files via upload

* Lint

* Update

* Update

* Update

* Update

* Update

* Lint Fix

* Lint

Co-authored-by: Ubuntu <ubuntu@ip-172-31-12-161.us-west-2.compute.internal>
Co-authored-by: Jinjing Zhou <VoVAllen@users.noreply.github.com>
Co-authored-by: xiang song(charlie.song) <classicxsong@gmail.com>
2021-06-10 12:07:44 +08:00
Ajay Brahmakshatriya ba1549244c [Performance][Kernel] Eliminating ctor&dtor zand IsNullArray overhead in random walks (#2990)
* Added a special implementation for MetapathBasedRandomWalkStep for the Uniform randomwalk case

* Fixed all linting issues

* add comment

Co-authored-by: Quan (Andy) Gan <coin2028@hotmail.com>
Co-authored-by: Da Zheng <zhengda1936@gmail.com>
2021-06-10 10:10:15 +08:00
Israt Nisa 75ec58260a Add heterograph support in C kernels (#2882)
* SpMM for heterograph

* C APIs SDDMM heterograph

* passes initial result

* renamed eid with nid

* aggregation on same ntype for multiple etypes

* fix link check failure

* lint check part 2

* lint check part 3

* Fixed SpMMCmpCsr Min op

* added mem references

* fixed fill(Max/Min), added const

* removed newline

* brought back docstring

Co-authored-by: Israt Nisa <nisisrat@amazon.com>
Co-authored-by: Da Zheng <zhengda1936@gmail.com>
2021-06-03 12:14:25 +08:00
Qidong Su b8fe2b4837 [Feature][Sampler] Sort CSR by tag (#1664)
* update

* update

* update

* update

* lint

* lint

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* lint

* update

* clone

* update

* update

* update

* update

* replace idarray with ndarray

* refactor cpp part

* refactor python part

* debug

* refactor interface

* test and doc

* lint and test

* lint

* fix

* fix

* fix

* const

* doc

* fix

* fix

* fix

* fix

* fix & doc

* fix

* fix

* fix

* fix

* fix

* fix

* update

Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2021-06-01 23:33:56 +08:00
Da Zheng 9a0e13ac61 Speed up random number generation. (#2953)
* speed up random number generation.

* fix lint.

* Fix

* fix.

Co-authored-by: Zheng <dzzhen@3c22fba32af5.ant.amazon.com>
2021-05-28 19:17:53 +08:00
nv-dlasalle 1db4ad4fcc Move pointer dereferencing in CDFSampler::draw() and AliasSampler::draw() to inside of conditional (#2943)
Co-authored-by: Quan (Andy) Gan <coin2028@hotmail.com>
2021-05-25 13:53:53 +08:00
nv-dlasalle ae8dbe6d3c [Feature][Performance] Implement NCCL wrapper for communicating NodeEmbeddings and sparse gradients. (#2825)
* Split NCCL wrapper from sparse optimizer and sparse embedding

* Add more unit tests for single node nccl

* Fix unit test for tf

* Switch to device histogram

* Fix histgram issues

* Finish migration to histogram

* Handle cases with zero send/recieve data

* Start on partition object

* Get compiling

* Updates

* Add unit tests

* Switch to partition object

* Fix linting issues

* Rename partition file

* Add python doc

* Fix python assert and finish doxygen comments

* Remove stubs for range based partition to satisfy pylint

* Wrap unit test in GPU only

* Wrap explicit cuda call in ifdef

* Merge with partition.py

* update docstrings

* Cleanup partition_op

* Add Workspace object

* Switch to using workspace object

* Move last remainder based function out of nccl_api

* Add error messages

* Update docs with examples

* Fix linting erros

Co-authored-by: xiang song(charlie.song) <classicxsong@gmail.com>
2021-05-20 10:58:17 -07:00
Tianqi Zhang (张天启) 5d7e80f413 [Feature] Add bruteforce implementation for KNN with O(Nk) space complexity (#2892)
* add bruteforce impl

* add support for bruteforce-sharemem

* modify python API

* add tests

* change file path

* change python API

* fix lint

* fix test

* also check worst_dist in the last few dim

* use heap and early-stop on CPU

* fix lint

* fix lint

* add device check

* use cuda function to determine max shared mem

* use cuda to determine block info

* add memory free for tmp var

* update doc-string and add dist option

* fix lint

* add more tests

Co-authored-by: Quan (Andy) Gan <coin2028@hotmail.com>
Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
2021-05-19 18:27:43 +08:00
Da Zheng 6e7f19f27b [Distributed] add distributed in-degree and out-degree. (#2918)
* add distributed in-degree and out-degree.

* update comments.

* fix a bug.

* add tests.

* add tests.

* fix a bug.

* fix docstring.

* update doc.

* fix

* fix.

Co-authored-by: Zheng <dzzhen@3c22fba32af5.ant.amazon.com>
Co-authored-by: xiang song(charlie.song) <classicxsong@gmail.com>
2021-05-18 19:46:09 +08:00
Quan (Andy) Gan 657c220de7 [Feature] Python interface for adjacency matrix summation and multiplication (#2893)
* test commit

* fixes

* oops

* add docs

* lint

* why does it say I have a trailing whitespace

* oh ok

* fixes

* why there's an invalid argument error

* address comments

* fix

* address comments
2021-05-17 19:47:02 +08:00