forked from dmlc/dgl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Runtime] Scheduler and Executor (dmlc#140)
* executor api * draft executor interface * WIP * revert changes to avoid conflict with api change * core scheduling logic * WIP: build graph adj * incidence matrix for in edges * support incidence matrix for partial recv nodes * improve * build adjmat in scheduler * graph store * get degree bucketing schedule * connect to c++ degree bucketing * conceptual executor creation code * executor comments * fix * more executor comments * WIP: full send_and_recv schedule * most schedulers * simplify scheduler * executors * runtime * builtin function base class * adj indices and shape * completely refactor scheduler * rename and move bundled out to function.py * use_edge_feature in msg func * rewrite scheduler * node edge executor * connect with graph api * handle zero degree * misc * fix test cases * fix a good many bugs... * remove old scheduler * push and pull * fix send recv * c++ lint * fix batched send recv * hot fix for mxnet * typo * write back executor * apply node edge * clean up, doc string * fix as requested * refactor * fix * WIP * WIP * ir draft * more on ir * WIP: spmv schedule * WIP * recv schedule * refactor * WIP * snr degree bucketing * snr scheduler * move prog to graph.py; rename * unittest for send/recv * remove some legacy codes * WIP: update_all * pass test_basics * passed all current utests * more utests; fix mx utest * WIP: fixing zero deg initial value * some tests * fix 0deg problem * fix mx * fix mx * some notes * fix as requested
- Loading branch information
1 parent
3e8b63e
commit deb653f
Showing
31 changed files
with
2,395 additions
and
1,010 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
|
||
from .message import * | ||
from .reducer import * | ||
from .base import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,31 @@ | ||
"""Built-in functions.""" | ||
"""Built-in function base class""" | ||
from __future__ import absolute_import | ||
|
||
from functools import update_wrapper | ||
class BuiltinFunction(object): | ||
"""Base builtin function class.""" | ||
|
||
__all__ = ['create_bundled_function_class'] | ||
def __call__(self): | ||
"""Regular computation of this builtin function | ||
def create_bundled_function_class(name, cls): | ||
class Bundled(cls): | ||
def __init__(self, fn_list): | ||
if not isinstance(fn_list, (list, tuple)): | ||
fn_list = [fn_list] | ||
self.fn_list = fn_list | ||
This will be used when optimization is not available. | ||
""" | ||
raise NotImplementedError | ||
|
||
def is_spmv_supported(self, *args, **kwargs): | ||
return all(isinstance(fn, cls) and | ||
fn.is_spmv_supported(*args, **kwargs) | ||
for fn in self.fn_list) | ||
@property | ||
def name(self): | ||
"""Return the name of this builtin function.""" | ||
raise NotImplementedError | ||
|
||
def __call__(self, *args, **kwargs): | ||
ret = {} | ||
for fn in self.fn_list: | ||
result = fn(*args, **kwargs) | ||
ret.update(result) | ||
return ret | ||
class BundledFunction(object): | ||
def __init__(self, fn_list): | ||
self.fn_list = fn_list | ||
|
||
def name(self): | ||
return "bundled" | ||
def __call__(self, *args, **kwargs): | ||
ret = {} | ||
for fn in self.fn_list: | ||
ret.update(fn(*args, **kwargs)) | ||
return ret | ||
|
||
# Fake the names for introspection | ||
Bundled.__module__ = cls.__module__ | ||
Bundled.__name__ = name | ||
Bundled.__qualname__ = name | ||
|
||
for method_name in ('__init__', '__call__', 'is_spmv_supported', 'name'): | ||
method = getattr(Bundled, method_name) | ||
method.__qualname__ = '{}.{}'.format(Bundled.__qualname__, method_name) | ||
|
||
for method_name in ('__call__', 'is_spmv_supported', 'name'): | ||
method = getattr(Bundled, method_name) | ||
method = update_wrapper(method, | ||
cls.__dict__[method.__name__], | ||
('__module__', '__doc__', '__annotations__')) | ||
|
||
return Bundled | ||
@property | ||
def name(self): | ||
return "bundled" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.