Skip to content

Commit 7cbcd0c

Browse files
committed
Makefile hacking (#8)
* Makefile hacking Modify CI to execute Relay Fix header guards Fix linting for Relay Fix linting for Relay Add Python 3.6 to install script * Tweak CMake and Makefiles for Relay. * Fix linting errors * Fixing namespaces, and trying to restore build * Remove Jenkinsfile * Restore to test execution * Restore all tests * Tests are green * Fix C++ lint * Fix PyLint
1 parent 0def9c9 commit 7cbcd0c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+526
-1139
lines changed

CMakeLists.txt

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ tvm_option(USE_RANDOM "Build with random support" OFF)
4949

5050
# include directories
5151
include_directories("include")
52+
include_directories("nnvm/include")
53+
include_directories("dmlc-core/include")
54+
include_directories(BEFORE "relay/include")
55+
include_directories("HalideIR/src")
5256
include_directories("dlpack/include")
5357
include_directories("dmlc-core/include")
5458

@@ -86,9 +90,9 @@ else(MSVC)
8690
endif(MSVC)
8791

8892
# add source group
89-
FILE(GLOB_RECURSE GROUP_SOURCE "src/*.cc" "HalideIR/src/*.cpp" "nnvm/src/*.cc")
93+
FILE(GLOB_RECURSE GROUP_SOURCE "src/*.cc" "HalideIR/src/*.cpp" "nnvm/src/*.cc" "relay/src/tvm/*.cc")
9094
FILE(GLOB_RECURSE GROUP_INCLUDE "src/*.h" "include/*.h" "HalideIR/src/*.h"
91-
"nnvm/src/*.h" "nnvm/include/*.h")
95+
"nnvm/src/*.h" "nnvm/include/*.h" "relay/src/*.h" "relay/include/*.h")
9296
assign_source_group("Source" ${GROUP_SOURCE})
9397
assign_source_group("Include" ${GROUP_INCLUDE})
9498

@@ -117,6 +121,12 @@ file(GLOB_RECURSE NNVM_COMPILER_SRCS
117121
nnvm/src/top/*.cc
118122
)
119123

124+
file(GLOB_RECURSE RELAY_SRCS
125+
relay/src/tvm/relay/*.cc
126+
relay/src/tvm/relay/ir/*.cc
127+
relay/src/tvm/relay/tyck/*.cc
128+
)
129+
120130
file(GLOB TOPI_SRCS
121131
topi/src/*.cc
122132
)
@@ -174,11 +184,13 @@ add_library(tvm SHARED ${COMPILER_SRCS} ${RUNTIME_SRCS})
174184
add_library(tvm_topi SHARED ${TOPI_SRCS})
175185
add_library(tvm_runtime SHARED ${RUNTIME_SRCS})
176186
add_library(nnvm_compiler SHARED ${NNVM_COMPILER_SRCS})
187+
add_library(relay SHARED ${RELAY_SRCS})
177188

178189
target_link_libraries(tvm ${TVM_LINKER_LIBS} ${TVM_RUNTIME_LINKER_LIBS})
179190
target_link_libraries(tvm_topi tvm ${TVM_LINKER_LIBS} ${TVM_RUNTIME_LINKER_LIBS})
180191
target_link_libraries(tvm_runtime ${TVM_RUNTIME_LINKER_LIBS})
181192
target_link_libraries(nnvm_compiler tvm)
193+
target_link_libraries(relay tvm)
182194

183195
# Related headers
184196
target_include_directories(
@@ -247,6 +259,11 @@ if (INSTALL_DEV)
247259
FILES_MATCHING
248260
PATTERN "*.h"
249261
)
262+
install(
263+
DIRECTORY "relay/include/." DESTINATION "include"
264+
FILES_MATCHING
265+
PATTERN "*.h"
266+
)
250267
else(INSTALL_DEV)
251268
install(
252269
DIRECTORY "include/tvm/runtime/." DESTINATION "include/tvm/runtime"
@@ -262,4 +279,5 @@ if(MSVC)
262279
target_compile_definitions(tvm PRIVATE -DTVM_EXPORTS)
263280
target_compile_definitions(tvm_runtime PRIVATE -DTVM_EXPORTS)
264281
target_compile_definitions(nnvm_compiler PRIVATE -DNNVM_EXPORTS)
282+
target_compile_definitions(relay PRIVATE -DRELAY_EXPORTS)
265283
endif()

Jenkinsfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ stage('Integration Test') {
220220
unpack_lib('gpu', tvm_multilib)
221221
timeout(time: max_time, unit: 'MINUTES') {
222222
sh "${docker_run} tvmai/ci-gpu ./tests/scripts/task_python_nnvm.sh"
223+
sh "${docker_run} gpu ./tests/scripts/task_python_relay.sh"
223224
}
224225
}
225226
}

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ cpplint:
5353
python3 dmlc-core/scripts/lint.py vta cpp vta/include vta/src
5454
python3 dmlc-core/scripts/lint.py topi cpp topi/include;
5555
python3 dmlc-core/scripts/lint.py nnvm cpp nnvm/include nnvm/src;
56+
python3 dmlc-core/scripts/lint.py relay cpp relay/include relay/src;
5657
python3 dmlc-core/scripts/lint.py tvm cpp include src verilog\
5758
examples/extension/src examples/graph_executor/src
5859

@@ -61,6 +62,7 @@ pylint:
6162
python3 -m pylint topi/python/topi --rcfile=$(ROOTDIR)/tests/lint/pylintrc
6263
python3 -m pylint nnvm/python/nnvm --rcfile=$(ROOTDIR)/tests/lint/pylintrc
6364
python3 -m pylint vta/python/vta --rcfile=$(ROOTDIR)/tests/lint/pylintrc
65+
python3 -m pylint relay/python/relay --rcfile=$(ROOTDIR)/tests/lint/pylintrc
6466

6567
jnilint:
6668
python3 dmlc-core/scripts/lint.py tvm4j-jni cpp jvm/native/src

relay/CMakeLists.txt

Lines changed: 0 additions & 138 deletions
This file was deleted.

relay/Jenkinsfile

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)