Skip to content

Adding neural network layers into the vertex centric program #13

Open
@JoelMathewC

Description

@JoelMathewC

This issue will explore the need for neural network layers to be used within the vertex-centric program. If a need is seen, this issue can further discuss how this feature can be added and its feasibility,

Currently seastar does not support neural network layers in the vertex centric program. Given below is an example of a program and the error flagged by the compiler when attempting to compile the program.

@self.cm.zoomIn(nspace=[self, torch])
        def nb_compute(v):
            h = sum([torch.mm(nb.h, self.weight)*nb.norm for nb in v.innbs])
            h = h * v.norm
            return h
Exception: <built-in method mm of type object at 0x7f8e33365420> e self must be a matrix args: (Vhinb(ValType.S,[1433],grad:None), Vweight(ValType.P,[1433, 16],grad:None)) kargs {}
Traceback (most recent call last):
  File "./train.py", line 189, in <module>
    main(args)
  File "./train.py", line 135, in main
    logits = model(features)
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/content/gdrive/MyDrive/Seastar/exp/gcn/test/gcn_spmv.py", line 87, in forward
    h = layer(h)
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/content/gdrive/MyDrive/Seastar/exp/gcn/test/gcn_spmv.py", line 56, in forward
    h = nb_compute(g=self.g, n_feats={'norm': self.norm, 'h' : h})
  File "/usr/local/lib/python3.8/dist-packages/seastar-0.1-py3.8.egg/seastar/zoom_v2.py", line 43, in __call__
    executor = self._setup_executor(**kwargs)
  File "/usr/local/lib/python3.8/dist-packages/seastar-0.1-py3.8.egg/seastar/zoom_v2.py", line 58, in _setup_executor
    ret = self._trace(node_feats, edge_feats, self._input_cache, fprog)
  File "/usr/local/lib/python3.8/dist-packages/seastar-0.1-py3.8.egg/seastar/zoom_v2.py", line 100, in _trace
    ret = self._f(central_node)
  File "/content/gdrive/MyDrive/Seastar/exp/gcn/test/gcn_spmv.py", line 53, in nb_compute
    h = sum([torch.mm(nb.h, self.weight)*nb.norm for nb in v.innbs])
  File "/content/gdrive/MyDrive/Seastar/exp/gcn/test/gcn_spmv.py", line 53, in <listcomp>
    h = sum([torch.mm(nb.h, self.weight)*nb.norm for nb in v.innbs])
  File "/usr/local/lib/python3.8/dist-packages/seastar-0.1-py3.8.egg/seastar/op.py", line 30, in __call__
    raise e
  File "/usr/local/lib/python3.8/dist-packages/seastar-0.1-py3.8.egg/seastar/op.py", line 27, in __call__
    ret = self._op(*tuple(arg.v for arg in args), **kargs)
RuntimeError: self must be a matrix

Metadata

Metadata

Assignees

No one assigned

    Labels

    frontendRelating to frontend module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions