Skip to content

Commit

Permalink
DLR 1.4 (#244)
Browse files Browse the repository at this point in the history
* DLR 1.4 initial changes. Missing VM allocator changes, GPU is broken

Add allocator type to VM init

Sync tvm again

* Use TVM 1.4 compiled Relay VM test model

* Formatting
  • Loading branch information
Trevor Morris authored Oct 9, 2020
1 parent 16d786c commit 7c5658d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/tvm
Submodule tvm updated 2129 files
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ if(USE_CUDA)
cmake_minimum_required(VERSION 3.13) # to compile CUDA code
set(CMAKE_CUDA_COMPILER ${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc)
if(NOT DEFINED CMAKE_CUDA_STANDARD)
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
endif()
enable_language(CUDA)
Expand Down Expand Up @@ -221,19 +221,22 @@ if(USE_TENSORRT)
include_directories("${TVM_SRC}/3rdparty/compiler-rt")
include_directories("${TVM_SRC}/topi/include")
file(GLOB_RECURSE COMPILER_SRCS
${TVM_SRC}/src/auto_scheduler/*.cc
${TVM_SRC}/src/node/*.cc
${TVM_SRC}/src/ir/*.cc
${TVM_SRC}/src/arith/*.cc
${TVM_SRC}/src/te/*.cc
${TVM_SRC}/src/autotvm/*.cc
${TVM_SRC}/src/tir/*.cc
${TVM_SRC}/src/topi/*.cc
${TVM_SRC}/src/driver/*.cc
${TVM_SRC}/src/parser/*.cc
${TVM_SRC}/src/printer/*.cc
${TVM_SRC}/src/support/*.cc
)
file(GLOB CODEGEN_SRCS
${TVM_SRC}/src/target/*.cc
${TVM_SRC}/src/target/source/*.cc
${TVM_SRC}/src/target/*.cc
${TVM_SRC}/src/target/source/*.cc
)
list(APPEND COMPILER_SRCS ${CODEGEN_SRCS})
file(GLOB_RECURSE RELAY_OP_SRCS
Expand Down Expand Up @@ -480,10 +483,10 @@ if(NOT(AAR_BUILD))
if(NOT IS_DIRECTORY ${RELAYVM_MODEL_DIR})
file(MAKE_DIRECTORY ${RELAYVM_MODEL_DIR})
download_file(
https://neo-ai-dlr-test-artifacts.s3-us-west-2.amazonaws.com/compiled-models/${RELAYVM_MODEL}
https://neo-ai-dlr-test-artifacts.s3-us-west-2.amazonaws.com/compiled-models/release-1.4.0/${RELAYVM_MODEL}
/tmp/${RELAYVM_MODEL}
SHA1
ed7105a16198adb02946687e068137502c5b53e0
dae8551b9e099059aa59d6974e63c20026632342
)
# this is OS-agnostic
execute_process(COMMAND ${CMAKE_COMMAND} -E tar -xf /tmp/${RELAYVM_MODEL}
Expand Down
2 changes: 1 addition & 1 deletion include/dlr.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern "C" { // Open extern "C" block
/*! \brief major version */
#define DLR_MAJOR 1
/*! \brief minor version */
#define DLR_MINOR 3
#define DLR_MINOR 4
/*! \brief patch version */
#define DLR_PATCH 0
/*! \brief DLR version */
Expand Down
2 changes: 1 addition & 1 deletion include/dlr_relayvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <tvm/runtime/object.h>
#include <tvm/runtime/packed_func.h>
#include <tvm/runtime/registry.h>
#include <tvm/runtime/vm.h>
#include <tvm/runtime/vm/vm.h>
#include "dlr_common.h"


Expand Down
2 changes: 1 addition & 1 deletion python/dlr/metadata.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME = ['DLRModel']

VERSION = "1.3.0"
VERSION = "1.4.0"
3 changes: 2 additions & 1 deletion src/dlr_relayvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ void RelayVMModel::SetupVMModule() {
vm_module_ = std::make_shared<tvm::runtime::Module>(tvm::runtime::Module(vm));

tvm::runtime::PackedFunc init = vm_module_->GetFunction("init");
init(static_cast<int>(ctx_.device_type), ctx_.device_id);
init(static_cast<int>(ctx_.device_type), ctx_.device_id,
static_cast<int>(tvm::runtime::vm::AllocatorType::kPooled));
}

void RelayVMModel::LoadMetadata() {
Expand Down
4 changes: 2 additions & 2 deletions version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dlc_version": "1.3.0",
"dlc_version": "1.4.0",
"commit_ids": {
"neo-ai/tvm": "14200c39ee7a61640739a83cb268e6dce3ca4143",
"neo-ai/tvm": "cab407ae6b686afbc602b254c5371f71b92f3bef",
"neo-ai/treelite": "38964865d624048d1a432af2763ee1dcdbe3ce5d"
}
}

0 comments on commit 7c5658d

Please sign in to comment.