Skip to content

Commit

Permalink
[RUNTIME] Remove runtime, rely on tvm only (apache#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed May 29, 2018
1 parent 3a5b9fc commit 4090144
Show file tree
Hide file tree
Showing 19 changed files with 66 additions and 1,248 deletions.
8 changes: 2 additions & 6 deletions nnvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ else
NO_WHOLE_ARCH= --no-whole-archive
endif

all: lib/libnnvm.a lib/libnnvm_top.$(SHARED_LIBRARY_SUFFIX) lib/libnnvm_top_runtime.$(SHARED_LIBRARY_SUFFIX)
all: lib/libnnvm.a lib/libnnvm_top.$(SHARED_LIBRARY_SUFFIX)

SRC = $(wildcard src/*.cc src/c_api/*.cc src/core/*.cc src/pass/*.cc)
SRC_TOP = $(wildcard src/top/*/*.cc src/runtime/*.cc src/compiler/*.cc src/compiler/*/*.cc)
SRC_TOP = $(wildcard src/top/*/*.cc src/compiler/*.cc src/compiler/*/*.cc)
ALL_OBJ = $(patsubst %.cc, build/%.o, $(SRC))
TOP_OBJ = $(patsubst %.cc, build/%.o, $(SRC_TOP))
ALL_DEP = $(ALL_OBJ)
Expand All @@ -78,10 +78,6 @@ lib/libnnvm_top.$(SHARED_LIBRARY_SUFFIX): lib/libnnvm.a ${TOP_OBJ}
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -shared -o $@ $(filter %.o, $^) $(LDFLAGS) -Wl,${WHOLE_ARCH} lib/libnnvm.a -Wl,${NO_WHOLE_ARCH}

lib/libnnvm_top_runtime.$(SHARED_LIBRARY_SUFFIX): deploy/nnvm_runtime.cc
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -shared -o $@ $(filter %.cc, $^) $(LDFLAGS)

cython:
cd python; python setup.py build_ext --inplace

Expand Down
4 changes: 0 additions & 4 deletions nnvm/deploy/REAMD.md

This file was deleted.

13 changes: 0 additions & 13 deletions nnvm/deploy/nnvm_runtime.cc

This file was deleted.

4 changes: 4 additions & 0 deletions nnvm/python/nnvm/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ def symbol(self):
check_call(_LIB.NNGraphGetSymbol(self.handle, ctypes.byref(shandle)))
return Symbol(shandle)

def _tvm_graph_json(self):
"""Get TVM graph json"""
return self.apply("SaveJSON").json_attr("json")

@property
def index(self):
if not self._index:
Expand Down
111 changes: 0 additions & 111 deletions nnvm/python/nnvm/runtime.py

This file was deleted.

22 changes: 21 additions & 1 deletion nnvm/src/compiler/graph_fuse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,31 @@
#include <tvm/runtime/packed_func.h>
#include <tvm/lowered_func.h>
#include "./compile_engine.h"
#include "../runtime/graph_executor.h"
#include "../../tvm/src/runtime/graph/graph_runtime.h"

namespace nnvm {
namespace compiler {

using tvm::runtime::TVMOpParam;

// parser
inline void TVMOpParamParser(nnvm::NodeAttrs* attrs) {
TVMOpParam param;
param.Init(attrs->dict);
attrs->parsed = std::move(param);
}

NNVM_REGISTER_OP(tvm_op)
.set_attr_parser(TVMOpParamParser)
.set_num_inputs([](const NodeAttrs& attrs) {
const TVMOpParam& param = nnvm::get<TVMOpParam>(attrs.parsed);
return param.num_inputs;
})
.set_num_outputs([](const NodeAttrs& attrs) {
const TVMOpParam& param = nnvm::get<TVMOpParam>(attrs.parsed);
return param.num_outputs;
});

using namespace tvm;

// The single fuse rule.
Expand Down
Loading

0 comments on commit 4090144

Please sign in to comment.