Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge cpp backend into master #2840

Merged
merged 129 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
edd4e11
add workaround solution from nvidia
lxning May 23, 2022
bb3ea61
add comments
lxning May 23, 2022
851327a
expand runtimeType
lxning May 24, 2022
bfaa045
add runtimeType in model config
lxning May 25, 2022
c01e8f8
add unit test
lxning May 26, 2022
246ca01
revert test/buildspec_gpu.yml
lxning May 26, 2022
ea6845f
update testng.xml
lxning May 26, 2022
101c637
update json files
lxning May 26, 2022
7345664
fmt
lxning May 26, 2022
42ecd08
fmt
lxning May 26, 2022
a50c396
init cpp dir
lxning Jun 7, 2022
4e1ff31
init code structure
lxning Jun 9, 2022
a2fc68d
Init socket code and otf protocol
maaquib Jun 10, 2022
f5afa46
add log api
lxning Jun 23, 2022
129899a
decouple backend and model worker; impl torchscript load model; build…
lxning Jul 4, 2022
7e5ff0f
delete src/CMakeLists.txt
lxning Jul 4, 2022
b132cd5
init model archive manifest loader
lxning Jul 7, 2022
bf52ca9
add manifest and unit test
lxning Jul 8, 2022
4aee9d0
integrate manifest into backend; add unit test
lxning Jul 8, 2022
0ec7595
update otf message internal structure; add inference request message
lxning Jul 14, 2022
8de719e
update otfmessage function return [skip ci]
lxning Jul 14, 2022
3333e2a
add torch base handler
lxning Jul 17, 2022
d3f7fe8
support dynamic load shared lib
lxning Jul 21, 2022
3f7ef9e
disable install libtorch
lxning Jul 21, 2022
5338d35
update utils/CMakeLists.txt
lxning Jul 22, 2022
8a579c1
add dynamic lib loader unit test
lxning Jul 24, 2022
40a9942
[skip CI] update src/utils/CMakeLists.txt
lxning Jul 24, 2022
003148d
install kineto in build.sh
lxning Jul 24, 2022
62246b1
[skip ci] add handler factory
lxning Aug 5, 2022
8a3c267
[skip ci] update inference request message
lxning Aug 8, 2022
6b1f4fd
vision handler inference impl.
lxning Aug 15, 2022
1b8c8cf
[skip ci] update torchscript backend api
lxning Aug 16, 2022
272228e
change model_path to model_dir [skip ci]
lxning Aug 16, 2022
3a63765
[skip ci] torchscripted handler load model pass postive test
lxning Aug 17, 2022
701c143
[skip ci] fix dll test teardown
lxning Aug 17, 2022
5ca41fc
[skip ci] add mnist inference positive test
lxning Aug 17, 2022
4224e88
update torchscripted base handler postprocess
lxning Aug 18, 2022
bb15419
[skip ci] add model instance status in backend
lxning Aug 18, 2022
df94603
[skip ci]add prediction test for base and dll handler
lxning Aug 22, 2022
b492407
[skip ci] clean up
lxning Aug 22, 2022
6151975
add batch inference test
lxning Aug 22, 2022
0ab1589
[skip ci] add dll close
lxning Aug 22, 2022
9657494
[skip ci] file_system clean up
lxning Aug 22, 2022
8eb8ae3
[skip ci] add mnist scripted model pt file for testing
lxning Aug 22, 2022
aec424a
[skip ci] torch_scripted/torch_scripted_backend_test refactory
lxning Aug 22, 2022
3c3ef58
Merge branch 'cpp_backend' into cpp_backend_lxning
lxning Aug 22, 2022
d288e2b
[skip ci] torch_scripted_backend_test refactory
lxning Aug 22, 2022
c03665f
[skip ci] extend LoadPredict api
lxning Aug 22, 2022
fa82bc0
[skip ci] add negative test in torch_scripted_backend_test
lxning Aug 22, 2022
abfa3f0
explicit set ABI=1
lxning Sep 9, 2022
1eca177
support different build step for linux and mac
lxning Sep 13, 2022
fd11e01
[skip ci] update folly installation
lxning Sep 13, 2022
8c235a5
add sudo for folly dep installation
lxning Sep 13, 2022
52a8ade
[skip ci] update libtorch cuda installation
lxning Sep 13, 2022
fa7acfe
[skip ci] update sudo mac
lxning Sep 13, 2022
5b07123
[skip ci] update cuda option flag
lxning Sep 13, 2022
03951a2
[skip ci] set cuda compiler
lxning Sep 13, 2022
112a260
[skip ci] skip install kineto on linux
lxning Sep 13, 2022
b37e75c
[skip ci] fix cude compile path
lxning Sep 13, 2022
36a04d9
add documnetation
lxning Sep 17, 2022
7c9ead2
update gcc version description
lxning Sep 19, 2022
d744f22
Merge branch 'master' into issue_1651
lxning Sep 26, 2022
387e4fe
add cpp log config file option
lxning Sep 27, 2022
81a9e83
add parameters
lxning Sep 27, 2022
daf8882
update setup.py for package cpp
lxning Sep 27, 2022
64849b7
set cpp libpath env
lxning Sep 27, 2022
365e37d
Merge branch 'issue_1651' into cpp_backend_lxning
lxning Sep 28, 2022
da06be3
add unit test
lxning Sep 28, 2022
8076b9d
[skip ci] install lib
lxning Sep 28, 2022
2d10148
[skip ci] add cpp log config path for cpp backend start
lxning Sep 28, 2022
50b635c
CPP OTFProtocol implementation for inference request and response (#1…
rohithkrn Sep 28, 2022
e67dd4c
update model archiver for cpp
lxning Sep 30, 2022
ba93a28
Merge branch 'cpp_backend' into cpp_backend_lxning
lxning Sep 30, 2022
2be8227
Bug fix in cpp integration (#1887)
rohithkrn Oct 4, 2022
fbb8417
add clang-tidy in build (#1896)
lxning Oct 11, 2022
c00ae7c
replace strcpy with strncpy (#1898)
lxning Oct 12, 2022
bb7e4f4
[WIP] cpp backend with Java integ (#1890)
maaquib Oct 14, 2022
6e1d22f
add clang-tidy and clang-format for cpp backend lint (#1910)
lxning Oct 19, 2022
7f4403d
remove unused parameter in cpp basehandler (#1917)
lxning Oct 20, 2022
21b23df
fix clang-tidy warnings (#1915)
rohithkrn Oct 20, 2022
ba98131
CPP mnist_base postman test (#1907)
rohithkrn Oct 26, 2022
b600920
install clang-format on linux (#1926)
rohithkrn Oct 27, 2022
a5bc133
Add CI for cpp_backend branch (#1916)
rohithkrn Oct 31, 2022
fb22b88
Metrics helper classes implementation for C++ backend (#1874)
namannandan Nov 1, 2022
a3a5232
install cpp via install_from_src (#1883)
lxning Nov 7, 2022
1f82dee
Update README.md
lxning Nov 15, 2022
3b00b70
YAML metrics configuration handling for C++ backend (#1941)
namannandan Nov 15, 2022
45c8b68
fix yaml_cpp installation in build script (#1996)
lxning Nov 29, 2022
3451bb7
Metrics cache implementation and integration with C++ backend (#1975)
namannandan Nov 29, 2022
bc9ec15
Revert "Metrics cache implementation and integration with C++ backend…
lxning Nov 29, 2022
9d5a142
Metrics cache implementation and integration with C++ backend (#2012)
namannandan Nov 30, 2022
9c5287a
Merge remote-tracking branch 'origin/master' into cpp_revive3
mreso Dec 9, 2023
ca97b10
Merge branch 'master' into cpp_revive3
mreso Dec 9, 2023
319e2bf
Fix lint error
mreso Dec 9, 2023
8ff41a2
Fix lint error
mreso Dec 9, 2023
9e8e358
Fix model-archiver after cpp merge
mreso Dec 9, 2023
a5e9c35
Adjust signature of workerLifeCycleMnist.startWorker in test
mreso Dec 9, 2023
c01f4ba
Fix unit tests after merging master into cpp_backend
mreso Dec 9, 2023
87644b6
Fix linting error
mreso Dec 9, 2023
ded9544
Install dependencies for cpp backend
mreso Dec 12, 2023
5bb4abc
Fix unit tests after cpp merge
mreso Dec 12, 2023
afe74a4
Fix formatting
mreso Dec 12, 2023
f10b377
Move installation of cpp deps to ts_scripts/install_dependencies.py
mreso Dec 12, 2023
f855609
Build cpp backend for regression and sanity tests
mreso Dec 12, 2023
c690f55
Fix formatting
mreso Dec 12, 2023
71eaee7
Fix typo
mreso Dec 12, 2023
e26cb23
Temp fix hanging after starting cpp worker
mreso Dec 12, 2023
8d467a4
Add pytest for cpp backend
mreso Dec 12, 2023
2c131d0
Roll back building of cpp abckend in ci regression and sanity tests; …
mreso Dec 12, 2023
782b8fe
Fix formatting
mreso Dec 13, 2023
19dc458
Remove mnist_custom_cpp.mar file from postman test as we do not build…
mreso Dec 13, 2023
a4a553a
Remove cpp model archive in additional place
mreso Dec 13, 2023
d38064d
Remove cpp build from setup.py
mreso Dec 13, 2023
663a3e4
Remove additional ref to build_cpp in setup.py
mreso Dec 13, 2023
f93a108
fix code link
lxning Dec 13, 2023
a3fd9ba
Merge branch 'master' into cpp_revive3
mreso Dec 14, 2023
1d5d316
Update README.md
mreso Dec 14, 2023
df6d749
Update libtorch versions + move installation of cpp backend to build.sh
mreso Dec 14, 2023
b89f2c2
Merge branch 'master' into cpp_revive3
chauhang Dec 23, 2023
2b5ebd4
Prepare cpp build workflow for merge into master
mreso Jan 12, 2024
34391f7
Update cuda version in cpp/build.sh
mreso Jan 12, 2024
d04e5ab
Remove reference to LDP
mreso Jan 12, 2024
e8c671b
Fix WorkerLifeCycleTest
mreso Jan 13, 2024
ca368f3
rm src/test/resources/config_test_cpp.properties
mreso Jan 13, 2024
c059c6c
Merge branch 'master' into cpp_revive3
mreso Jan 16, 2024
dda4cb0
Remove debug prints
mreso Jan 17, 2024
96ce58a
Skip cpp backend test if cpp backend is not available
mreso Jan 17, 2024
fca4a41
Merge branch 'master' into cpp_revive3
mreso Jan 17, 2024
a975e68
Merge branch 'master' into cpp_revive3
mreso Jan 18, 2024
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
34 changes: 34 additions & 0 deletions .github/workflows/ci-cpu-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI CPU - CPP Build

on:
push:
branches:
- master
pull_request:
branches:
- master

concurrency:
group: ci-cpu-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true

jobs:
ci-cpu-cpp:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest]
steps:
- name: Checkout TorchServe
uses: actions/checkout@v2
- name: Install libtorch - macOS
if: matrix.os == 'macOS-latest'
run: |
brew install libtorch
- name: Install dependencies
run: |
python ts_scripts/install_dependencies.py --environment=dev --cpp
- name: Build
run: |
cd cpp && ./build.sh --install-dependencies
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ instances.yaml.backup
## Models
*.pt
*.onnx

# cpp
cpp/_build
cpp/third-party
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
include ts/frontend/model-server.jar
include ts/cpp/bin/*
include ts/cpp/lib/*
include ts/cpp/resources/logging.config
include PyPiDescription.rst
include ts/configs/*
include ts/version.txt
45 changes: 45 additions & 0 deletions cpp/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
# NOTE there must be no spaces before the '-', so put the comma last.
InheritParentConfig: true
Checks: >
-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-forward-declaration-namespace,
-bugprone-macro-parentheses,
-bugprone-lambda-function-name,
-bugprone-reserved-identifier,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-interfaces-global-init,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
-cppcoreguidelines-non-private-member-variables-in-classes,
hicpp-exception-baseclass,
hicpp-avoid-goto,
google-*
modernize-*,
-modernize-concat-nested-namespaces,
-modernize-return-braced-init-list,
-modernize-use-auto,
-modernize-use-default-member-init,
-modernize-use-using,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
performance-*,
-performance-noexcept-move-constructor,
-performance-unnecessary-value-param
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
#WarningsAsErrors: '*'
...
52 changes: 52 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(torchserve_cpp VERSION 0.1)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -fPIC -D_GLIBCXX_USE_CXX11_ABI=1")

find_program(CLANG_TIDY_EXE NAMES "clang-tidy" REQUIRED)
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")

find_program(CLANG_FORMAT_EXE NAMES "clang-format" REQUIRED)
if(CLANG_FORMAT_EXE)
file(GLOB_RECURSE ALL_CXX_SOURCE_FILES
${PROJECT_SOURCE_DIR}/src/*.cc
${PROJECT_SOURCE_DIR}/src/*.hh
${PROJECT_SOURCE_DIR}/test/*.cc
${PROJECT_SOURCE_DIR}/test/*.hh
)

add_custom_target(format
COMMAND
${CLANG_FORMAT_EXE} -i -style=google ${ALL_CXX_SOURCE_FILES}
)
endif()


find_package(Boost REQUIRED)
find_package(folly REQUIRED)
find_package(fmt REQUIRED)
find_package(gflags REQUIRED)
find_package(Torch REQUIRED)
find_package(yaml-cpp REQUIRED NO_CMAKE_PATH)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")

include_directories(${TORCH_INCLUDE_DIRS})
include_directories(${FOLLY_INCLUDE_DIRS})
include_directories(${GTEST_INCLUDE_DIRS})
include_directories(${GMOCK_INCLUDE_DIRS})

include_directories("${CMAKE_INSTALL_PREFIX}/_deps")
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

set(FOLLY_LIBRARIES Folly::folly)

# add subdirectories in src
add_subdirectory(src/utils)
add_subdirectory(src/backends)
add_subdirectory(src/examples)
add_subdirectory(test)

FILE(COPY src/resources/logging.config DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")
Loading