36 Commits

Author SHA1 Message Date
Hongzhi (Steve), Chen 8f9f2e2a4d [Misc] Rename number_of_edges and number_of_nodes to num_edges and num_nodes. (#5472)
* core

* revert

---------

Co-authored-by: Ubuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
2023-03-29 08:57:47 +08:00
Hongzhi (Steve), Chen 3e5137feaf [Misc] Autoformat python dgl (Part 2). (#5332)
Co-authored-by: Ubuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
2023-02-20 20:56:25 +08:00
peizhou001 3132da2826 Deprecate (#4864)
rename DGLHeteroGraph to DGLGraph
2022-11-15 10:01:01 +08:00
Minjie Wang 49a4436ac9 [MPOps] Add edge-wise message passing operators u_op_v (#4801)
* edgewise mpops

* formatting

* black formatting

* isort

* fix lint

* remove typing module; address comments

* fix gpu ut; rename test file
2022-11-04 09:23:09 +08:00
Hongzhi (Steve), Chen 76bb54044e [Misc] Black auto fix. (#4682)
Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2022-10-08 14:16:12 +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
Minjie Wang 0227ddfb66 [NN] Rework RelGraphConv and HGTConv (#3742)
* WIP: TypedLinear and new RelGraphConv

* wip

* further simplify RGCN

* a bunch of tweak for performance; add basic cpu support

* update on segmm

* wip: segment.cu

* new backward kernel works

* fix a bunch of bugs in kernel; leave idx_a for future

* add nn test for typed_linear

* rgcn nn test

* bugfix in corner case; update RGCN README

* doc

* fix cpp lint

* fix lint

* fix ut

* wip: hgtconv; presorted flag for rgcn

* hgt code and ut; WIP: some fix on reorder graph

* better typed linear init

* fix ut

* fix lint; add docstring
2022-02-23 12:10:20 +08:00
Israt Nisa b3d3a2c4b0 [Feature] Gather mm (#3641)
* init

* init

* working cublasGemm

* benchmark high-mem/low-mem, err gather_mm output

* cuda kernel for bmm like kernel

* removed cpu copy for E_per_Rel

* benchmark code from Minjie

* fixed cublas results in gathermm sorted

* use GPU shared mem in unsorted gather mm

* minor

* Added an optimal version of gather_mm_unsorted

* lint

* init gather_mm_scatter

* cublas transpose added

* fixed h_offset for multiple rel

* backward unittest

* cublas support to transpose W

* adding missed file

* forgot to add header file

* lint

* lint

* cleanup

* lint

* docstring

* lint

* added unittest

* lint

* lint

* unittest

* changed err type

* skip cpu test

* skip CPU code

* move in-len loop inside

* lint

* added check different dim length for B

* w_per_len is optional now

* moved gather_mm to pytorch/backend with backward support

* removed a_/b_trans support

* transpose op inside GEMM call

* removed out alloc from API, changed W 2D to 3D

* Added se_gather_mm, Separate API for sortedE

* Fixed gather_mm (unsorted) user interface

* unsorted gmm backward + separate CAPI for un/sorted A

* typecast to float to support atomicAdd

* lint typecast

* lint

* added gather_mm_scatter

* minor

* const

* design changes

* Added idx_a, idx_b support gmm_scatter

* dgl doc

* lint

* adding gather_mm in ops

* lint

* lint

* minor

* removed benchmark files

* minor

* empty commit

Co-authored-by: Israt Nisa <nisisrat@amazon.com>
2022-02-14 22:27:23 -05:00
Israt Nisa 88f5a8bec8 [Feature] Add heterogeneous graph API for edge_softmax (#3571)
* edge_softmax_hetero forwar+cpu+norm=dst

* convert eids to list

* addedunittest

* added unittest

* added backward. Not tested correctness

* minor

* changed reducer to max from sum

* bugfix

* docstring

* add GPU unittest

* output converted to dict from tuple

* lint check

Co-authored-by: Israt Nisa <nisisrat@amazon.com>
Co-authored-by: Quan (Andy) Gan <coin2028@hotmail.com>
2021-12-19 13:51:51 -05:00
Israt Nisa 6c81634b29 [Bugfix] Fixes wrong output in multi_update_all for reduce op max/min (Issue#3564)) (#3581)
* fixed bug

* added  in test cases

* unittest resolved

* bugfix

Co-authored-by: Israt Nisa <nisisrat@amazon.com>
Co-authored-by: Quan (Andy) Gan <coin2028@hotmail.com>
2021-12-17 08:54:15 +08:00
Israt Nisa cb0e1103ed [Feature] Add Min/max reducer in heterogeneous API for unary message functions (#3514)
* min/max support for forward CPU heterograph

* Added etype with each argU values

* scatter_add needs fix

* added scatter_add_hetero. Grads dont match for max reducer

* storing ntype in argX

* fixing scatter_add_hetero

* hetero matches with torch's scatter add

* works copy_e forward+cpu

* added backward for copy_rhs

* Computes gradient for all node types in one kernel

* bug fix

* unnitest for max/min on CPU

* renamed scatter_add_hetero to update_grad_minmax_hetero

* lint check and comment out cuda call for max. Code is for CPU only

* lint check

* replace inf with zero

* minor

* lint check

* removed LIBXSMM code from hetro code

* fixing backward operator of UpdateGradMinMaxHetero

* removed backward from update_grad_minmax_hetero

* docstring

* improved docstring and coding style

* Added pass by pointer for output

* typos and pass by references

* Support for copy_rhs

* Added header <string>

* fix bug in copy_u_max

* Added comments and dimension check of all etypes

* skip mxnet check

* pass by pointer output arrays

* updated docstring

Co-authored-by: Israt Nisa <nisisrat@amazon.com>
Co-authored-by: Quan (Andy) Gan <coin2028@hotmail.com>
2021-12-04 00:39:30 +08:00
Israt Nisa 532eaa879b backward now stores DGLGraph index,not DGLGraph object witattached data (#3410)
Co-authored-by: Israt Nisa <nisisrat@amazon.com>
2021-10-11 14:08:01 +08:00
Israt Nisa d17b299a13 [Feature] Update edge features (apply_edge) for heterogeneous graph (#3250)
* rgcn with new heterograph API

* apply_edge() forward for multi relation

* undoing changes from rgcn-hetero

* backward apply_edge(copy_u) added

* unittest for apply_edge(copy_e)

* Compatible with new PRs

* resolving conflict with master

* Bringing back change after resolving conflict

* minor

* minor

Co-authored-by: Israt Nisa <nisisrat@amazon.com>
2021-09-09 22:39:08 +08:00
Israt Nisa 298e4fa627 [Feature] Support builtin binary message function for heterogenenous graph (#3273)
* Added binary builtinMsgFunc forward() for heterograph

* Added backward for u_op_v

* Supports all binary builtin forward

* Supports binary message funcs with reduce func sum

* lint check

* removed import torch from unittest

* enabled GPU test

* lint check

* Fixed docstrings

* rename func get_hs_id

* edited comment

Co-authored-by: Israt Nisa <nisisrat@amazon.com>
2021-09-07 10:01:33 -07: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
Konstantin Sofeikov e22087aa36 [BUG] fix for zero degree nodes (#2786)
* fix for zero degree nodes

* Update python/dgl/ops/spmm.py

linting fix

Co-authored-by: Zihao Ye <zihaoye.cs@gmail.com>

Co-authored-by: Konstantin Sofeikov <konstantin.sofeikov@complyadvantage.com>
Co-authored-by: Zihao Ye <expye@outlook.com>
Co-authored-by: Zihao Ye <zihaoye.cs@gmail.com>
2021-03-25 22:09:53 +08:00
Minjie Wang 8a07ab7737 [Doc] Tutorials re-organization (#2683)
* reorg

* change titles

* rm some stale API doc; minor fix

* fix docs

* add warning

* rm new-tutorial run in ci

* lint
2021-02-20 17:42:45 +08:00
Mufei Li 3ca52b1e59 [Fix] Various Fix after Bug Bash (#2620)
* update

* Misc fix

* Update
2021-02-05 17:34:16 +08:00
Quan (Andy) Gan 3a19bbc508 fix doc (#2604) 2021-02-02 11:04:43 +08:00
Zihao Ye 6b02babbad [doc] Add docstring for segment reduce. (#2375) 2020-11-27 18:04:13 +08:00
Zihao Ye 3adbfa1812 [Performance] Use segment operators for graph readout. (#2361)
* upd

* upd

* update

* upd

* upd

* upd

* fix

* lint

* lint

* pylint

* doc
2020-11-23 01:45:33 +08:00
Mingjian Wen 25a8e3f181 Fix segment_reduce() ignoring tailing 0 segments (#2228)
Co-authored-by: Quan (Andy) Gan <coin2028@hotmail.com>
2020-09-24 15:07:45 +08:00
Zihao Ye 45b610c49a fix edge_softmax (#2160)
Co-authored-by: Jinjing Zhou <VoVAllen@users.noreply.github.com>
2020-09-09 14:19:43 +08:00
Mufei Li be444e52d9 [Doc/Feature] Refactor, doc update and behavior fix for graphs (#1983)
* Update graph

* Fix for dgl.graph

* from_scipy

* Replace canonical_etypes with relations

* from_networkx

* Update for hetero_from_relations

* Roll back the change of canonical_etypes to relations

* heterograph

* bipartite

* Update doc

* Fix lint

* Fix lint

* Fix test cases

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Update

* Fix test

* Fix

* Update

* Use DGLError

* Update

* Update

* Update

* Update

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Update

* Fix

* Update

* Fix

* Fix

* Fix

* Update

* Fix

* Update

* Fix

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Fix

* Fix

* Update

* Update

* Update

* Update

* Update

* Update

* rewrite sanity checks

* delete unnecessary checks

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Fix

* Update

* Update

* Update

* Fix

* Fix

* Fix

* Update

* Fix

* Update

* Fix

* Fix

* Update

* Fix

* Update

* Fix

Co-authored-by: xiang song(charlie.song) <classicxsong@gmail.com>
Co-authored-by: Minjie Wang <wmjlyjemaine@gmail.com>
Co-authored-by: Quan Gan <coin2028@hotmail.com>
2020-08-18 04:26:29 +08:00
Zihao Ye 2fc280ba65 only filling zeros for min/max reducer (#2026) 2020-08-15 12:43:36 +08:00
Quan (Andy) Gan 63e2ba23c6 [WIP][Kernel] Set the built-in reduce result of zero-degree nodes to 0 in C (#2017)
* test idea

* cuda kernels

* lint and fixes

* lint

* change to another strategy

* use infinity

* fix

Co-authored-by: Zihao Ye <expye@outlook.com>
2020-08-14 22:59:24 +08:00
zhjwy9343 2fa7f71ad5 [Doc] new nn api doc (#2019)
* Add dotproduct attention

* [Feature] Add dotproduct attention

* [Feature] Add dotproduct attention

* [Feature] Add dotproduct attention

* [New] Update landing page

* [New] Update landing page

* [New] Update landing page

* [Doc] Update landing page

* [Doc] Update landing page

* [Doc] Update landing page

* [Doc] Update landing page

* [Doc] Update landing page

* [Doc] Update landing page

* [Doc] Update landing page

* [Doc] Update landing page

* [Improvement] use dgl build-in in dotgatconv

* [Doc] review API doc string bottom up

* [Doc] Add doc of input and output features

* [Doc] Update doc string for pooling and transformer.

* [Doc] Reformat doc string and change some wordings.

* [Doc] Doc string refactoring.

* [Doc] Doc string refactoring.

* [Doc] Doc string refactoring.

* [Doc] Doc string refactoring.

* [Doc] Doc string refactoring.

Co-authored-by: Jinjing Zhou <VoVAllen@users.noreply.github.com>
2020-08-14 18:00:38 +08:00
Zihao Ye 6294677f8a [hotfix] Set reduce results to all zero for nodes with zero in-degrees. (#2011) 2020-08-13 01:20:56 +08:00
Zihao Ye 0f56575938 [feature] Allow copy_e + udf reduce function (#1996)
* up

* pylint
2020-08-11 18:47:40 +08:00
Zihao Ye 18bfec24cf [hotfix] Refactor edge softmax module (#1967)
* upd

* upd

* upd

* upd

* upd

* upd

* upd

* upd
2020-08-07 23:50:12 +08:00
Minjie Wang 22167f7203 [Refactor] Enable new kernel in all message passing APIs (#1953)
* WIP: frame refactor

* new frame

* simple update_all builtin

* move all subgraph routines into the same file

* sddmm & spmm schedule; node & edge udf

* degree bucketing

* some tricky 0deg corner cases

* bug in frame append

* merge test_hetero_basics and test_basics

* some code rearange

* fix test_heterograph

* add mean spmm

* enable all builtin combinations

* pass gpu test

* pass pytorch tests

* wip

* fix some pt debugging codes

* fix bug in mxnet backward

* pass all mxnet utests

* passed tf tests

* docstring

* lint

* lint

* fix broadcasting bugs

* add warning and clamp for mean reducer

* add test for zero-degree mean

* address comments

* lint

* small fix
2020-08-07 15:40:25 +08:00
Zihao Ye a28bfa9f5f [hotfix] Activate kernel unittest for tensorflow (#1895)
* upd

* upd

* upd

* upd

* upd

* trigger

* simplify unittest

Co-authored-by: Jinjing Zhou <VoVAllen@users.noreply.github.com>
2020-07-31 19:57:53 +08:00
Minjie Wang 444becf00a [Misc] Move many deprecated codes to the deprecate folder (#1893)
* some file movements

* move some codes to deprecated

* more deprecation

* lint

* remove useless test
2020-07-30 18:17:33 +08:00
Zihao Ye 05a4337901 [Doc] Introduce the relation of message passing APIs and operators in docstring. (#1878)
* upd

* fix typo

* upd
2020-07-29 00:41:47 +08:00
Zihao Ye 2fa2b4534e [Feature] Support higher order derivative for message passing. (#1877)
* upd

* fix typo
2020-07-28 23:11:06 +08:00
Zihao Ye 2b8eb5be6f [refactor] Move spmm and sddmm operators to operator module (#1873)
* upd

* upd

* upd

* upd
2020-07-28 18:39:12 +08:00