Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ tvm_file_glob(GLOB RUNTIME_SRCS
src/runtime/memory/*.cc
src/runtime/disco/*.cc
src/runtime/minrpc/*.cc
src/runtime/relax_vm/*.cc
src/runtime/vm/*.cc
)
set(TVM_RUNTIME_EXT_OBJS "")

Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/CUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ if(USE_CUDA)
endif(USE_NVTX)

# Add CUDA builtins to RelaxVM
tvm_file_glob(GLOB RELAX_VM_CUDA_BUILTIN_SRC_CC src/runtime/relax_vm/cuda/*.cc)
list(APPEND RUNTIME_SRCS ${RELAX_VM_CUDA_BUILTIN_SRC_CC})
tvm_file_glob(GLOB VM_CUDA_BUILTIN_SRC_CC src/runtime/vm/cuda/*.cc)
list(APPEND RUNTIME_SRCS ${VM_CUDA_BUILTIN_SRC_CC})
else(USE_CUDA)
list(APPEND COMPILER_SRCS src/target/opt/build_cuda_off.cc)
endif(USE_CUDA)
4 changes: 2 additions & 2 deletions cmake/modules/Hexagon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ if(BUILD_FOR_HEXAGON)
"${TVMRT_SOURCE_DIR}/hexagon/*.cc"
)
# Add builtins to RelaxVM
tvm_file_glob(GLOB RELAX_VM_BUILTIN_SRC_CC src/runtime/relax_vm/hexagon/*.cc)
list(APPEND RUNTIME_SRCS ${RELAX_VM_BUILTIN_SRC_CC})
tvm_file_glob(GLOB VM_BUILTIN_SRC_CC src/runtime/vm/hexagon/*.cc)
list(APPEND RUNTIME_SRCS ${VM_BUILTIN_SRC_CC})
else()
file_glob_append(RUNTIME_HEXAGON_SRCS
"${TVMRT_SOURCE_DIR}/hexagon/hexagon_module.cc"
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/api/python/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Python API

runtime/runtime
runtime/ndarray
runtime/relax_vm
runtime/vm
runtime/disco
runtime/profiling

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
specific language governing permissions and limitations
under the License.

tvm.runtime.relax_vm
tvm.runtime.vm
--------------------
.. automodule:: tvm.runtime.relax_vm
.. automodule:: tvm.runtime.vm
:members:
6 changes: 3 additions & 3 deletions include/tvm/relax/exec_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include <tvm/node/reflection.h>
#include <tvm/node/repr_printer.h>
#include <tvm/runtime/object.h>
#include <tvm/runtime/relax_vm/bytecode.h>
#include <tvm/runtime/relax_vm/executable.h>
#include <tvm/runtime/vm/bytecode.h>
#include <tvm/runtime/vm/executable.h>

#include <string>
#include <unordered_map>
Expand All @@ -38,7 +38,7 @@
namespace tvm {
namespace relax {

namespace vm = tvm::runtime::relax_vm;
namespace vm = tvm::runtime::vm;

class ExecBuilder;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
*/

/*!
* \file tvm/runtime/relax_vm/builtin.h
* \file tvm/runtime/vm/builtin.h
* \brief Builtin runtime APIs.
*/
#ifndef TVM_RUNTIME_RELAX_VM_BUILTIN_H_
#define TVM_RUNTIME_RELAX_VM_BUILTIN_H_
#ifndef TVM_RUNTIME_VM_BUILTIN_H_
#define TVM_RUNTIME_VM_BUILTIN_H_

namespace tvm {
namespace runtime {
namespace relax_vm {
namespace vm {

/*!
* \brief Op code used in built-in match-shape function.
Expand Down Expand Up @@ -83,7 +83,7 @@ enum class MakeShapeCode : int {
kLoadShape = 1,
};

} // namespace relax_vm
} // namespace vm
} // namespace runtime
} // namespace tvm
#endif // TVM_RUNTIME_RELAX_VM_BUILTIN_H_
#endif // TVM_RUNTIME_VM_BUILTIN_H_
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
*/

/*!
* \file tvm/runtime/relax_vm/bytecode.h
* \file tvm/runtime/vm/bytecode.h
* \brief The bytecode for the virtual machine.
*/
#ifndef TVM_RUNTIME_RELAX_VM_BYTECODE_H_
#define TVM_RUNTIME_RELAX_VM_BYTECODE_H_
#ifndef TVM_RUNTIME_VM_BYTECODE_H_
#define TVM_RUNTIME_VM_BYTECODE_H_

#include <tvm/runtime/data_type.h>
#include <tvm/runtime/logging.h>
Expand All @@ -32,7 +32,7 @@

namespace tvm {
namespace runtime {
namespace relax_vm {
namespace vm {

/*!
* \brief The storage type for the bytecode in the VM.
Expand Down Expand Up @@ -238,8 +238,8 @@ struct Instruction {
static Instruction If(RegName cond, Index false_offset);
};

} // namespace relax_vm
} // namespace vm
} // namespace runtime
} // namespace tvm

#endif // TVM_RUNTIME_RELAX_VM_BYTECODE_H_
#endif // TVM_RUNTIME_VM_BYTECODE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/

/*!
* \file tvm/runtime/relax_vm/executable.h
* \file tvm/runtime/vm/executable.h
*/
#ifndef TVM_RUNTIME_RELAX_VM_EXECUTABLE_H_
#define TVM_RUNTIME_RELAX_VM_EXECUTABLE_H_
#ifndef TVM_RUNTIME_VM_EXECUTABLE_H_
#define TVM_RUNTIME_VM_EXECUTABLE_H_

#include <tvm/ffi/function.h>
#include <tvm/runtime/module.h>
Expand All @@ -37,11 +37,11 @@
// NOTE: this file only changes if we change relax vm format
// for example if relax vm format do not change in 0.15, this should remain as 0.14
// if it changes in 0.16, we will change it to 0.16
#define RELAX_VM_VERSION "0.14"
#define VM_VERSION "0.14"

namespace tvm {
namespace runtime {
namespace relax_vm {
namespace vm {

/*!
* \brief Information entry in executable function table.
Expand Down Expand Up @@ -214,11 +214,11 @@ class VMExecutable : public runtime::ModuleNode {
void LoadPackedFuncNames(dmlc::Stream* strm);
};

} // namespace relax_vm
} // namespace vm
} // namespace runtime
} // namespace tvm

namespace dmlc {
DMLC_DECLARE_TRAITS(has_saveload, ::tvm::runtime::relax_vm::VMFuncInfo, true);
DMLC_DECLARE_TRAITS(has_saveload, ::tvm::runtime::vm::VMFuncInfo, true);
} // namespace dmlc
#endif // TVM_RUNTIME_RELAX_VM_EXECUTABLE_H_
#endif // TVM_RUNTIME_VM_EXECUTABLE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
#ifndef TVM_RUNTIME_RELAX_VM_NDARRAY_CACHE_SUPPORT_H_
#define TVM_RUNTIME_RELAX_VM_NDARRAY_CACHE_SUPPORT_H_
#ifndef TVM_RUNTIME_VM_NDARRAY_CACHE_SUPPORT_H_
#define TVM_RUNTIME_VM_NDARRAY_CACHE_SUPPORT_H_

#include <tvm/ffi/container/array.h>
#include <tvm/ffi/function.h>
Expand All @@ -29,7 +29,7 @@

namespace tvm {
namespace runtime {
namespace relax_vm {
namespace vm {

/*!
* \brief Metadata for NDArray cache, which by default, is named as "ndarray-cache.json".
Expand Down Expand Up @@ -89,8 +89,8 @@ struct NDArrayCacheMetadata {
static NDArrayCacheMetadata LoadFromStr(const std::string& json_str, const std::string& path);
};

} // namespace relax_vm
} // namespace vm
} // namespace runtime
} // namespace tvm

#endif // TVM_RUNTIME_RELAX_VM_NDARRAY_CACHE_SUPPORT_H_
#endif // TVM_RUNTIME_VM_NDARRAY_CACHE_SUPPORT_H_
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
*/

/*!
* \file tvm/runtime/relax_vm/vm.h
* \file tvm/runtime/vm/vm.h
*/
#ifndef TVM_RUNTIME_RELAX_VM_VM_H_
#define TVM_RUNTIME_RELAX_VM_VM_H_
#ifndef TVM_RUNTIME_VM_VM_H_
#define TVM_RUNTIME_VM_VM_H_

#ifndef TVM_RELAX_VM_ENABLE_PROFILER
#define TVM_RELAX_VM_ENABLE_PROFILER 1
#ifndef TVM_VM_ENABLE_PROFILER
#define TVM_VM_ENABLE_PROFILER 1
#endif

#include <memory>
Expand All @@ -45,7 +45,7 @@ using memory::MemoryManager;
using memory::Storage;
using memory::StorageObj;

namespace relax_vm {
namespace vm {

/*!
* \brief Possible instrument actions.
Expand Down Expand Up @@ -227,8 +227,8 @@ class VirtualMachine : public runtime::ModuleNode {
std::unordered_map<uint32_t, VMExtension> extensions;
};

} // namespace relax_vm
} // namespace vm
} // namespace runtime
} // namespace tvm

#endif // TVM_RUNTIME_RELAX_VM_VM_H_
#endif // TVM_RUNTIME_VM_VM_H_
4 changes: 2 additions & 2 deletions python/tvm/contrib/hexagon/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def get_executor_from_factory(
The hexagon arch to be used
"""
if isinstance(module, (runtime.Executable, str)):
return self._relax_vm_executable_executor(module, hexagon_arch=hexagon_arch)
return self._vm_executable_executor(module, hexagon_arch=hexagon_arch)

raise TypeError(f"Unsupported executor type: {type(module)}")

Expand All @@ -244,7 +244,7 @@ def _set_device_type(self, module: Union[str, pathlib.Path]):
else:
self._requires_cpu_device = False

def _relax_vm_executable_executor(
def _vm_executable_executor(
self, executable: Union[runtime.Executable, str], hexagon_arch: str
):
"""Create a local TVM module which consumes a remote vm executable.
Expand Down
4 changes: 2 additions & 2 deletions python/tvm/relax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# under the License.
# pylint: disable=invalid-name, wrong-import-position
"""The Relax IR namespace containing the IR, type, operator, builder, vm, etc."""
from tvm.runtime import relax_vm as vm
from tvm.runtime.relax_vm import VirtualMachine, VMInstrumentReturnKind
from tvm.runtime import vm
from tvm.runtime.vm import VirtualMachine, VMInstrumentReturnKind

from .type_converter import args_converter

Expand Down
2 changes: 1 addition & 1 deletion python/tvm/relax/frontend/nn/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from tvm.runtime import Device, NDArray
from tvm.runtime import device as as_device
from tvm.runtime import ndarray
from tvm.runtime.relax_vm import VirtualMachine
from tvm.runtime.vm import VirtualMachine
from tvm.target import Target

from .... import relax as rx
Expand Down
2 changes: 1 addition & 1 deletion python/tvm/relax/frontend/nn/torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from tvm.ir import Array
from tvm.runtime import NDArray, ShapeTuple, ndarray
from tvm.runtime.relax_vm import VirtualMachine
from tvm.runtime.vm import VirtualMachine

from . import core
from . import spec as _spec
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/relax/backend/vm/codegen_vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <tvm/relax/exec_builder.h>
#include <tvm/relax/expr_functor.h>
#include <tvm/relax/op_attr_types.h>
#include <tvm/runtime/relax_vm/bytecode.h>
#include <tvm/runtime/vm/bytecode.h>
#include <tvm/target/target.h>
#include <tvm/tir/function.h>

Expand All @@ -37,12 +37,12 @@

namespace tvm {
namespace relax {
namespace relax_vm {
namespace codegen_vm {

using tvm::Target;
using namespace relax;
using namespace tvm::runtime;
using namespace tvm::runtime::relax_vm;
using namespace tvm::runtime::vm;

/*!
* \brief A class to generate VM executable for Relax functions.
Expand Down Expand Up @@ -492,6 +492,6 @@ Module VMLink(ExecBuilder builder, Target target, Optional<Module> lib, Array<Mo

TVM_FFI_REGISTER_GLOBAL("relax.VMLink").set_body_typed(VMLink);

} // namespace relax_vm
} // namespace codegen_vm
} // namespace relax
} // namespace tvm
6 changes: 3 additions & 3 deletions src/relax/backend/vm/codegen_vm_tir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <tvm/relax/exec_builder.h>
#include <tvm/relax/expr_functor.h>
#include <tvm/relax/op_attr_types.h>
#include <tvm/runtime/relax_vm/executable.h>
#include <tvm/runtime/vm/executable.h>
#include <tvm/target/target.h>
#include <tvm/tir/builtin.h>
#include <tvm/tir/expr.h>
Expand All @@ -39,7 +39,7 @@

namespace tvm {
namespace relax {
namespace relax_vm {
namespace codegen_vm {

using vm::VMFuncInfo;

Expand Down Expand Up @@ -532,6 +532,6 @@ IRModule VMTIRCodeGen(ExecBuilder exec_builder, IRModule mod) {

TVM_FFI_REGISTER_GLOBAL("relax.VMTIRCodeGen").set_body_typed(VMTIRCodeGen);

} // namespace relax_vm
} // namespace codegen_vm
} // namespace relax
} // namespace tvm
Loading
Loading