* [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.
* [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>
* [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
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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