Skip to content

Commit

Permalink
refactor!: API level rename
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This commit renames the namespaces of all
TRTorch/Torch-TensorRT APIs. Now torchscript specific functions
are segregated into their own torch_tensorrt::torchscript /
torch_tensorrt.ts namespaces. Generic utils will remain in the
torch_tensorrt namespace. Guidance on how to port forward will follow in
the next commits
  • Loading branch information
narendasan committed Oct 20, 2021
1 parent f99a6ca commit 483ef59
Show file tree
Hide file tree
Showing 41 changed files with 1,615 additions and 1,502 deletions.
19 changes: 10 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,23 @@ __pycache__
*.egg-info
dist
bdist
py/trtorch/_version.py
py/trtorch/lib
py/trtorch/include
py/trtorch/bin
py/trtorch/BUILD
py/trtorch/LICENSE
py/trtorch/WORKSPACE
py/torch_tensorrt/_version.py
py/torch_tensorrt/lib
py/torch_tensorrt/include
py/torch_tensorrt/bin
py/torch_tensorrt/BUILD
py/torch_tensorrt/LICENSE
py/torch_tensorrt/WORKSPACE
py/wheelhouse
py/.eggs
notebooks/.ipynb_checkpoints/
*.cache
tests/py/data
examples/**/deps/**/*
!examples/**/deps/.gitkeep
examples/trtorchrt_example/trtorchrt_example
examples/torchtrt_runtime_example/torchtrt_runtime_example
examples/int8/ptq/ptq
examples/int8/qat/qat
examples/int8/training/vgg16/data/*
examples/int8/datasets/data/*
examples/int8/datasets/data/*
env/**/*
18 changes: 9 additions & 9 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ config_setting(

pkg_tar(
name = "include_core",
package_dir = "include/trtorch",
package_dir = "include/torch_tensorrt",
deps = [
"//core:include",
"//core/conversion:include",
Expand All @@ -35,17 +35,17 @@ pkg_tar(
srcs = [
"//cpp:api_headers",
],
package_dir = "include/trtorch/",
package_dir = "include/torch_tensorrt/",
)

pkg_tar(
name = "lib",
srcs = select({
":windows": ["//cpp/lib:trtorch.dll"],
":windows": ["//cpp/lib:torch_tensorrt.dll"],
"//conditions:default": [
"//cpp/lib:libtrtorch.so",
"//cpp/lib:libtrtorchrt.so",
"//cpp/lib:libtrtorch_plugins.so",
"//cpp/lib:libtorchtrt.so",
"//cpp/lib:libtorchtrt_runtime.so",
"//cpp/lib:libtorchtrt_plugins.so",
],
}),
mode = "0755",
Expand All @@ -55,21 +55,21 @@ pkg_tar(
pkg_tar(
name = "bin",
srcs = [
"//cpp/bin/trtorchc",
"//cpp/bin/torchtrtc",
],
mode = "0755",
package_dir = "bin/",
)

pkg_tar(
name = "libtrtorch",
name = "libtorchtrt",
srcs = [
"//:LICENSE",
"//bzl_def:BUILD",
"//bzl_def:WORKSPACE"
],
extension = "tar.gz",
package_dir = "trtorch",
package_dir = "torch_tensorrt",
deps = [
":lib",
":include",
Expand Down
24 changes: 12 additions & 12 deletions core/util/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
l.log(sev, ss.str()); \
} while (0)

#define LOG_GRAPH_GLOBAL(s) TRTORCH_LOG(core::util::logging::get_logger(), core::util::logging::LogLevel::kGRAPH, s)
#define LOG_DEBUG_GLOBAL(s) TRTORCH_LOG(core::util::logging::get_logger(), core::util::logging::LogLevel::kDEBUG, s)
#define LOG_INFO_GLOBAL(s) TRTORCH_LOG(core::util::logging::get_logger(), core::util::logging::LogLevel::kINFO, s)
#define LOG_WARNING_GLOBAL(s) TRTORCH_LOG(core::util::logging::get_logger(), core::util::logging::LogLevel::kWARNING, s)
#define LOG_ERROR_GLOBAL(s) TRTORCH_LOG(core::util::logging::get_logger(), core::util::logging::LogLevel::kERROR, s)
#define LOG_GRAPH_GLOBAL(s) TRTORCH_LOG(trtorch::core::util::logging::get_logger(), trtorch::core::util::logging::LogLevel::kGRAPH, s)
#define LOG_DEBUG_GLOBAL(s) TRTORCH_LOG(trtorch::core::util::logging::get_logger(), trtorch::core::util::logging::LogLevel::kDEBUG, s)
#define LOG_INFO_GLOBAL(s) TRTORCH_LOG(trtorch::core::util::logging::get_logger(), trtorch::core::util::logging::LogLevel::kINFO, s)
#define LOG_WARNING_GLOBAL(s) TRTORCH_LOG(trtorch::core::util::logging::get_logger(), trtorch::core::util::logging::LogLevel::kWARNING, s)
#define LOG_ERROR_GLOBAL(s) TRTORCH_LOG(trtorch::core::util::logging::get_logger(), trtorch::core::util::logging::LogLevel::kERROR, s)
#define LOG_INTERNAL_ERROR_GLOBAL(s) \
TRTORCH_LOG(core::util::logging::get_logger(), core::util::logging::LogLevel::kINTERNAL_ERROR, s)
TRTORCH_LOG(trtorch::core::util::logging::get_logger(), trtorch::core::util::logging::LogLevel::kINTERNAL_ERROR, s)

#define LOG_GRAPH_OWN(l, s) TRTORCH_LOG(l, core::util::logging::LogLevel::kGRAPH, s)
#define LOG_DEBUG_OWN(l, s) TRTORCH_LOG(l, core::util::logging::LogLevel::kDEBUG, s)
#define LOG_INFO_OWN(l, s) TRTORCH_LOG(l, core::util::logging::LogLevel::kINFO, s)
#define LOG_WARNING_OWN(l, s) TRTORCH_LOG(l, core::util::logging::LogLevel::kWARNING, s)
#define LOG_ERROR_OWN(l, s) TRTORCH_LOG(l, core::util::logging::LogLevel::kERROR, s)
#define LOG_INTERNAL_ERROR_OWN(l, s) TRTORCH_LOG(l, core::util::logging::LogLevel::kINTERNAL_ERROR, s)
#define LOG_GRAPH_OWN(l, s) TRTORCH_LOG(l, trtorch::core::util::logging::LogLevel::kGRAPH, s)
#define LOG_DEBUG_OWN(l, s) TRTORCH_LOG(l, trtorch::core::util::logging::LogLevel::kDEBUG, s)
#define LOG_INFO_OWN(l, s) TRTORCH_LOG(l, trtorch::core::util::logging::LogLevel::kINFO, s)
#define LOG_WARNING_OWN(l, s) TRTORCH_LOG(l, trtorch::core::util::logging::LogLevel::kWARNING, s)
#define LOG_ERROR_OWN(l, s) TRTORCH_LOG(l, trtorch::core::util::logging::LogLevel::kERROR, s)
#define LOG_INTERNAL_ERROR_OWN(l, s) TRTORCH_LOG(l, trtorch::core::util::logging::LogLevel::kINTERNAL_ERROR, s)

#ifdef _MSC_VER

Expand Down
13 changes: 7 additions & 6 deletions cpp/BUILD
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package(default_visibility = ["//visibility:public"])

cc_library(
name = "trtorch",
name = "torch_tensorrt",
srcs = [
"src/compile_spec.cpp",
"src/logging.cpp",
"src/ptq.cpp",
"src/trtorch.cpp",
"src/torch_tensorrt.cpp",
"src/types.cpp"
],
hdrs = [
"include/trtorch/logging.h",
"include/trtorch/macros.h",
"include/trtorch/ptq.h",
"include/trtorch/trtorch.h",
"include/torch_tensorrt/logging.h",
"include/torch_tensorrt/macros.h",
"include/torch_tensorrt/ptq.h",
"include/torch_tensorrt/torch_tensorrt.h",
],
linkstatic = True,
strip_include_prefix = "include/",
Expand Down
4 changes: 2 additions & 2 deletions cpp/bin/trtorchc/BUILD → cpp/bin/torchtrtc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ config_setting(
)

cc_binary(
name = "trtorchc",
name = "torchtrtc",
srcs = [
"main.cpp",
],
deps = [
"//third_party/args",
"//cpp:trtorch",
"//cpp:torch_tensorrt",
] + select({
":use_pre_cxx11_abi": [
"@libtorch_pre_cxx11_abi//:libtorch",
Expand Down
File renamed without changes.
Loading

0 comments on commit 483ef59

Please sign in to comment.