Skip to content

Commit a531d17

Browse files
tqchenSiyuan Feng
andauthored
[REFACTOR] Phase out relay c++ components (#17660)
* cleanup relay c++ * [REFACTOR] Phase out relay c++ components This PR phases out the relay C++ components and simplifies the overall codegen runtime logic. --------- Co-authored-by: Siyuan Feng <[email protected]>
1 parent fb43fc8 commit a531d17

File tree

698 files changed

+454
-159162
lines changed

Some content is hidden

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

698 files changed

+454
-159162
lines changed

CMakeLists.txt

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,13 @@ tvm_option(USE_THREADS "Build with thread support" ON)
5757
tvm_option(USE_LLVM "Build with LLVM, can be set to specific llvm-config path" OFF)
5858
tvm_option(USE_MLIR "Build with MLIR support" OFF)
5959
tvm_option(USE_STACKVM_RUNTIME "Include stackvm into the runtime" OFF)
60-
tvm_option(USE_GRAPH_EXECUTOR "Build with tiny graph executor" ON)
61-
tvm_option(USE_GRAPH_EXECUTOR_CUDA_GRAPH "Build with tiny graph executor with CUDA Graph for GPUs" OFF)
62-
tvm_option(USE_AOT_EXECUTOR "Build with AOT executor" ON)
63-
tvm_option(USE_PROFILER "Build profiler for the VM and graph executor" ON)
6460
tvm_option(USE_OPENMP "Build with OpenMP thread pool implementation" OFF)
65-
tvm_option(USE_RELAY_DEBUG "Building Relay in debug mode..." OFF)
6661
tvm_option(TVM_DEBUG_WITH_ABI_CHANGE "Enable debug code that may cause ABI changes" OFF)
6762
tvm_option(TVM_LOG_BEFORE_THROW "Whether log before throw, for debugging purposes" OFF)
6863
tvm_option(USE_RTTI "Build with RTTI" ON)
6964
tvm_option(USE_MSVC_MT "Build with MT" OFF)
7065
tvm_option(INSTALL_DEV "Install compiler infrastructure" OFF)
7166
tvm_option(HIDE_PRIVATE_SYMBOLS "Compile with -fvisibility=hidden." OFF)
72-
tvm_option(USE_TF_TVMDSOOP "Build with TensorFlow TVMDSOOp" OFF)
73-
tvm_option(USE_PT_TVMDSOOP "Build with PyTorch TVMDSOOp" OFF)
7467
tvm_option(USE_FALLBACK_STL_MAP "Use TVM's POD compatible Map" OFF)
7568
tvm_option(INDEX_DEFAULT_I64 "Defaults the index datatype to int64" ON)
7669
tvm_option(USE_LIBBACKTRACE "Use libbacktrace to supply linenumbers on stack traces" AUTO)
@@ -335,34 +328,6 @@ tvm_file_glob(GLOB CODEGEN_SRCS
335328

336329
list(APPEND COMPILER_SRCS ${CODEGEN_SRCS})
337330

338-
tvm_file_glob(GLOB_RECURSE RELAY_OP_SRCS
339-
src/relay/op/*.cc
340-
)
341-
tvm_file_glob(GLOB_RECURSE RELAY_PASS_SRCS
342-
src/relay/analysis/*.cc
343-
src/relay/collage/*.cc
344-
src/relay/transforms/*.cc
345-
src/relay/quantize/*.cc
346-
)
347-
tvm_file_glob(GLOB RELAY_BACKEND_SRCS
348-
src/relay/backend/*.cc
349-
src/relay/backend/vm/*.cc
350-
src/relay/backend/aot/*.cc
351-
)
352-
tvm_file_glob(GLOB_RECURSE RELAY_IR_SRCS
353-
src/relay/ir/*.cc
354-
src/relay/printer/*.cc
355-
src/relay/parser/*.cc
356-
)
357-
tvm_file_glob(GLOB_RECURSE RELAY_QNN_SRCS
358-
src/relay/qnn/*.cc
359-
)
360-
list(APPEND COMPILER_SRCS ${RELAY_OP_SRCS})
361-
list(APPEND COMPILER_SRCS ${RELAY_PASS_SRCS})
362-
list(APPEND COMPILER_SRCS ${RELAY_BACKEND_SRCS})
363-
list(APPEND COMPILER_SRCS ${RELAY_IR_SRCS})
364-
list(APPEND COMPILER_SRCS ${RELAY_QNN_SRCS})
365-
366331
tvm_file_glob(GLOB DATATYPE_SRCS src/target/datatype/*.cc)
367332
list(APPEND COMPILER_SRCS ${DATATYPE_SRCS})
368333
list(APPEND COMPILER_SRCS "src/target/datatype/myfloat/myfloat.cc")
@@ -418,51 +383,6 @@ else()
418383
list(APPEND COMPILER_SRCS ${STACKVM_RUNTIME_SRCS})
419384
endif(USE_STACKVM_RUNTIME)
420385

421-
# NOTE(areusch): USE_GRAPH_RUNTIME will be deleted in a future release
422-
if(USE_GRAPH_RUNTIME AND NOT DEFINED USE_GRAPH_EXECUTOR)
423-
message(WARNING "USE_GRAPH_RUNTIME renamed to USE_GRAPH_EXECUTOR. Please update your config.cmake")
424-
set(USE_GRAPH_EXECUTOR ${USE_GRAPH_RUNTIME})
425-
unset(USE_GRAPH_RUNTIME CACHE)
426-
endif(USE_GRAPH_RUNTIME AND NOT DEFINED USE_GRAPH_EXECUTOR)
427-
428-
# NOTE(areusch): USE_GRAPH_RUNTIME_DEBUG will be deleted in a future release
429-
if(USE_GRAPH_RUNTIME_DEBUG AND NOT DEFINED USE_PROFILER)
430-
message(WARNING "USE_GRAPH_RUNTIME_DEBUG renamed to USE_PROFILER. Please update your config.cmake")
431-
set(USE_PROFILER ${USE_GRAPH_RUNTIME_DEBUG})
432-
unset(USE_GRAPH_RUNTIME_DEBUG CACHE)
433-
endif(USE_GRAPH_RUNTIME_DEBUG AND NOT DEFINED USE_PROFILER)
434-
435-
if(USE_GRAPH_EXECUTOR)
436-
message(STATUS "Build with Graph Executor support...")
437-
tvm_file_glob(GLOB RUNTIME_GRAPH_EXECUTOR_SRCS src/runtime/graph_executor/*.cc)
438-
list(APPEND RUNTIME_SRCS ${RUNTIME_GRAPH_EXECUTOR_SRCS})
439-
440-
endif(USE_GRAPH_EXECUTOR)
441-
442-
# convert old options for profiler
443-
if(USE_GRAPH_EXECUTOR_DEBUG)
444-
message(WARNING "USE_GRAPH_EXECUTOR_DEBUG renamed to USE_PROFILER. Please update your config.cmake")
445-
unset(USE_GRAPH_EXECUTOR_DEBUG CACHE)
446-
set(USE_PROFILER ON)
447-
endif()
448-
if(USE_VM_PROFILER)
449-
message(WARNING "USE_VM_PROFILER renamed to USE_PROFILER. Please update your config.cmake")
450-
unset(USE_VM_PROFILER CACHE)
451-
set(USE_PROFILER ON)
452-
endif()
453-
454-
if(USE_PROFILER)
455-
message(STATUS "Build with profiler...")
456-
457-
tvm_file_glob(GLOB RUNTIME_GRAPH_EXECUTOR_DEBUG_SRCS src/runtime/graph_executor/debug/*.cc)
458-
list(APPEND RUNTIME_SRCS ${RUNTIME_GRAPH_EXECUTOR_DEBUG_SRCS})
459-
set_source_files_properties(${RUNTIME_GRAPH_EXECUTOR_SRCS}
460-
PROPERTIES COMPILE_DEFINITIONS "TVM_GRAPH_EXECUTOR_DEBUG")
461-
462-
tvm_file_glob(GLOB RUNTIME_VM_PROFILER_SRCS src/runtime/vm/profiler/*.cc)
463-
list(APPEND RUNTIME_SRCS ${RUNTIME_VM_PROFILER_SRCS})
464-
endif(USE_PROFILER)
465-
466386
if(USE_CUDA AND USE_NCCL)
467387
message(STATUS "Build with NCCL...")
468388
find_nccl(${USE_NCCL})
@@ -493,13 +413,6 @@ if(USE_ROCM AND USE_RCCL)
493413
list(APPEND RUNTIME_SRCS ${RUNTIME_RCCL_SRC})
494414
endif()
495415

496-
if(USE_AOT_EXECUTOR)
497-
message(STATUS "Build with AOT Executor support...")
498-
file(GLOB RUNTIME_AOT_EXECUTOR_SRCS src/runtime/aot_executor/*.cc)
499-
list(APPEND RUNTIME_SRCS ${RUNTIME_AOT_EXECUTOR_SRCS})
500-
501-
endif(USE_AOT_EXECUTOR)
502-
503416
# Enable ctest if gtest is available
504417
if(USE_GTEST)
505418
# Check env var for backward compatibility. A better way to specify package
@@ -538,12 +451,6 @@ if(USE_GTEST)
538451
endif()
539452
endif()
540453

541-
if(USE_PIPELINE_EXECUTOR)
542-
message(STATUS "Build with Pipeline Executor support...")
543-
tvm_file_glob(GLOB RUNTIME_PIPELINE_SRCS src/runtime/pipeline/*.cc)
544-
list(APPEND RUNTIME_SRCS ${RUNTIME_PIPELINE_SRCS})
545-
endif(USE_PIPELINE_EXECUTOR)
546-
547454
if(USE_KALLOC_ALIGNMENT)
548455
message(STATUS "Build Alloc alignment set to ${USE_KALLOC_ALIGNMENT}")
549456
add_definitions(-DTVM_KALLOC_ALIGNMENT=${USE_KALLOC_ALIGNMENT})
@@ -576,7 +483,6 @@ include(cmake/modules/Metal.cmake)
576483
include(cmake/modules/ROCM.cmake)
577484
include(cmake/modules/LLVM.cmake)
578485
include(cmake/modules/contrib/BLAS.cmake)
579-
include(cmake/modules/contrib/CODEGENC.cmake)
580486
include(cmake/modules/contrib/DNNL.cmake)
581487
include(cmake/modules/contrib/AMX.cmake)
582488
include(cmake/modules/contrib/CUTLASS.cmake)
@@ -587,10 +493,7 @@ include(cmake/modules/contrib/MSCCLPP.cmake)
587493
include(cmake/modules/contrib/Sort.cmake)
588494
include(cmake/modules/contrib/NNPack.cmake)
589495
include(cmake/modules/contrib/LibTorch.cmake)
590-
include(cmake/modules/contrib/HybridDump.cmake)
591496
include(cmake/modules/contrib/TFLite.cmake)
592-
include(cmake/modules/contrib/TF_TVMDSOOP.cmake)
593-
include(cmake/modules/contrib/PT_TVMDSOOP.cmake)
594497
include(cmake/modules/contrib/CoreML.cmake)
595498
include(cmake/modules/contrib/BNNS.cmake)
596499
include(cmake/modules/contrib/ONNX.cmake)
@@ -604,7 +507,6 @@ include(cmake/modules/contrib/MSC.cmake)
604507
include(cmake/modules/contrib/vllm.cmake)
605508
include(cmake/modules/Git.cmake)
606509
include(cmake/modules/LibInfo.cmake)
607-
include(cmake/modules/RustExt.cmake)
608510
include(cmake/modules/contrib/Mrvl.cmake)
609511

610512
set(LIBINFO_FILE ${CMAKE_CURRENT_LIST_DIR}/src/support/libinfo.cc)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ webclean:
127127

128128
# JVM build rules
129129
INCLUDE_FLAGS = -Iinclude -I$(DLPACK_PATH)/include -I$(DMLC_CORE_PATH)/include
130-
PKG_CFLAGS = -std=c++11 -Wall -O2 $(INCLUDE_FLAGS) -fPIC
130+
PKG_CFLAGS = -Wall -O3 $(INCLUDE_FLAGS) -fPIC
131131
PKG_LDFLAGS =
132132

133133
ifeq ($(OS),Windows_NT)

apps/android_rpc/app/src/main/jni/tvm_runtime.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
#include "../src/runtime/cpu_device_api.cc"
3939
#include "../src/runtime/dso_library.cc"
4040
#include "../src/runtime/file_utils.cc"
41-
#include "../src/runtime/graph_executor/graph_executor.cc"
42-
#include "../src/runtime/graph_executor/graph_executor_factory.cc"
4341
#include "../src/runtime/library_module.cc"
4442
#include "../src/runtime/logging.cc"
4543
#include "../src/runtime/memory/memory_manager.cc"

apps/cpp_rpc/main.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#if defined(__linux__) || defined(__ANDROID__)
2828
#include <unistd.h>
2929
#endif
30-
#include <dmlc/logging.h>
30+
#include <tvm/runtime/logging.h>
3131

3232
#include <cstring>
3333
#include <iostream>

apps/cpp_rpc/win32_process.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "win32_process.h"
2424

2525
#include <conio.h>
26-
#include <dmlc/logging.h>
26+
#include <tvm/runtime/logging.h>
2727
#include <winsock2.h>
2828
#include <ws2tcpip.h>
2929

apps/cpp_rtvm/CMakeLists.txt

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

0 commit comments

Comments
 (0)