Skip to content

Commit aa9a846

Browse files
authored
Merge branch 'master' into dependabot/gradle/plugins/io.netty-netty-all-4.1.107.Final
2 parents ed33c8b + 13d092c commit aa9a846

File tree

110 files changed

+2065
-729
lines changed

Some content is hidden

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

110 files changed

+2065
-729
lines changed

.github/workflows/ci-cpu-cpp.yml

+33-8
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,42 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
os: [ubuntu-20.04, macOS-latest]
19+
os: [ubuntu-20.04]
2020
steps:
21+
# - name: Setup Python for M1
22+
# if: matrix.os == 'macos-14'
23+
# uses: actions/setup-python@v5
24+
# with:
25+
# python-version: '3.10'
26+
- name: Setup Python for all other OS
27+
if: matrix.os != 'macos-14'
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: 3.9
31+
architecture: x64
32+
- name: Setup Java 17
33+
uses: actions/setup-java@v3
34+
with:
35+
distribution: 'zulu'
36+
java-version: '17'
2137
- name: Checkout TorchServe
22-
uses: actions/checkout@v2
23-
- name: Install libtorch - macOS
24-
if: matrix.os == 'macOS-latest'
25-
run: |
26-
brew install libtorch
38+
uses: actions/checkout@v3
39+
with:
40+
submodules: recursive
41+
# - name: Install libtorch - macOS
42+
# if: matrix.os == 'macOS-latest'
43+
# run: |
44+
# brew install libtorch
2745
- name: Install dependencies
2846
run: |
29-
python ts_scripts/install_dependencies.py --environment=dev --cpp
47+
sudo apt update && python ts_scripts/install_dependencies.py --environment=dev --cpp
48+
- name: Install TorchServe
49+
run: |
50+
python ts_scripts/install_from_src.py
51+
- name: Print Env
52+
run: |
53+
python ts_scripts/print_env_info.py
3054
- name: Build
3155
run: |
32-
cd cpp && ./build.sh
56+
cd cpp && rm -rf _build && sudo mkdir /mnt/_build && sudo chmod 777 /mnt/_build && mkdir _build && sudo mount --bind /mnt/_build _build
57+
./build.sh
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Kubernetes Nightly Tests
2+
3+
on:
4+
workflow_dispatch:
5+
# runs everyday at 6:15am
6+
schedule:
7+
- cron: '15 6 * * *'
8+
9+
jobs:
10+
kubernetes-tests:
11+
runs-on: [self-hosted, regression-test-gpu]
12+
steps:
13+
- name: Clean up previous run
14+
run: |
15+
echo "Cleaning up previous run"
16+
ls -la ./
17+
sudo rm -rf ./* || true
18+
sudo rm -rf ./.??* || true
19+
ls -la ./
20+
- name: Install minikube and kubectl
21+
run: |
22+
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
23+
sudo install minikube-linux-amd64 /usr/local/bin/minikube
24+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
25+
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
26+
echo "/usr/local/bin" >> $GITHUB_PATH
27+
- name: Setup Python 3.9
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: 3.9
31+
architecture: x64
32+
- name: Checkout TorchServe
33+
uses: actions/checkout@v3
34+
- name: Validate TorchServe
35+
run: ./kubernetes/tests/scripts/test_mnist.sh

.github/workflows/official_release.yml

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
steps:
1212
- name: Setup Conda
1313
uses: s-weigand/setup-conda@v1
14+
with:
15+
activate-conda: true
16+
update-conda: false
17+
python-version: "3.9"
1418
- name: Setup Anaconda
1519
run: |
1620
conda --version

.github/workflows/official_release_docker.yml

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
architecture: x64
3333
- name: Checkout TorchServe
3434
uses: actions/checkout@v3
35+
with:
36+
submodules: recursive
3537
- name: Login to Docker
3638
env:
3739
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}

.github/workflows/regression_tests_cpu_binaries.yml

+24-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Run Regression Tests for CPU nightly binaries
33
on:
44
# run every day at 6:15am
55
schedule:
6-
- cron: '15 6 * * *'
6+
- cron: '15 6 * * *'
77

88
concurrency:
99
group: ci-cpu-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
@@ -16,34 +16,54 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
os: [ubuntu-20.04, macOS-latest]
19+
os: [ubuntu-20.04, macOS-latest, macos-14]
2020
python-version: ["3.8", "3.9", "3.10"]
2121
binaries: ["pypi", "conda"]
2222
exclude:
2323
- os: macos-latest
2424
python-version: 3.8
25+
- os: macos-14
26+
python-version: 3.8
27+
- os: macos-14
28+
python-version: 3.9
2529
steps:
2630
- uses: actions/checkout@v3
2731
with:
2832
submodules: recursive
2933
- name: Setup conda with Python ${{ matrix.python-version }}
34+
if: matrix.os == 'macos-14'
35+
uses: conda-incubator/setup-miniconda@v3
36+
with:
37+
auto-update-conda: true
38+
channels: anaconda, conda-forge
39+
python-version: ${{ matrix.python-version }}
40+
- name: Setup conda with Python ${{ matrix.python-version }}
41+
if: matrix.os != 'macos-14'
3042
uses: s-weigand/setup-conda@v1
3143
with:
3244
update-conda: true
3345
python-version: ${{ matrix.python-version }}
3446
conda-channels: anaconda, conda-forge
35-
- run: conda --version
36-
- run: python --version
3747
- name: Setup Java 17
3848
uses: actions/setup-java@v3
3949
with:
4050
distribution: 'zulu'
4151
java-version: '17'
4252
- name: Checkout TorchServe
4353
uses: actions/checkout@v3
54+
- name: Run install dependencies and regression test
55+
if: matrix.os == 'macos-14'
56+
shell: bash -el {0}
57+
run: |
58+
conda info
59+
python ts_scripts/install_dependencies.py --environment=dev
60+
python test/regression_tests.py --binaries --${{ matrix.binaries }} --nightly
4461
- name: Install dependencies
62+
if: matrix.os != 'macos-14'
4563
run: |
4664
python ts_scripts/install_dependencies.py --environment=dev
4765
- name: Validate Torchserve CPU Regression
66+
if: matrix.os != 'macos-14'
4867
run: |
4968
python test/regression_tests.py --binaries --${{ matrix.binaries }} --nightly
69+

.github/workflows/torchserve-nightly-build.yml

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ jobs:
1010
steps:
1111
- name: Setup Conda
1212
uses: s-weigand/setup-conda@v1
13+
with:
14+
activate-conda: true
15+
update-conda: false
16+
python-version: "3.9"
1317
- run: conda --version
1418
- run: conda install -y conda-build anaconda-client
1519
- name: Checkout TorchServe

.gitmodules

-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
[submodule "third_party/google/rpc"]
22
path = third_party/google/rpc
33
url = https://github.com/googleapis/googleapis.git
4-
[submodule "cpp/third-party/llama.cpp"]
5-
path = cpp/third-party/llama.cpp
6-
url = https://github.com/ggerganov/llama.cpp.git
74
[submodule "cpp/third-party/llama2.c"]
85
path = cpp/third-party/llama2.c
96
url = https://github.com/karpathy/llama2.c
107
[submodule "cpp/third-party/llama2.so"]
118
path = cpp/third-party/llama2.so
129
url = https://github.com/mreso/llama2.so.git
13-
[submodule "cpp/third-party/folly"]
14-
path = cpp/third-party/folly
15-
url = https://github.com/facebook/folly.git
1610
[submodule "cpp/third-party/yaml-cpp"]
1711
path = cpp/third-party/yaml-cpp
1812
url = https://github.com/jbeder/yaml-cpp.git

MANIFEST.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include ts/frontend/model-server.jar
22
include ts/cpp/bin/*
33
include ts/cpp/lib/*
4-
include ts/cpp/resources/logging.config
4+
include ts/cpp/resources/logging.yaml
55
include PyPiDescription.rst
66
include ts/configs/*
7-
include ts/version.txt
7+
include ts/version.txt

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
![Benchmark Nightly](https://github.com/pytorch/serve/actions/workflows/benchmark_nightly.yml/badge.svg)
66
![Docker Regression Nightly](https://github.com/pytorch/serve/actions/workflows/regression_tests_docker.yml/badge.svg)
77
![KServe Regression Nightly](https://github.com/pytorch/serve/actions/workflows/kserve_cpu_tests.yml/badge.svg)
8+
![Kubernetes Regression Nightly](https://github.com/pytorch/serve/actions/workflows/kubernetes_tests.yml/badge.svg)
89

910
TorchServe is a flexible and easy-to-use tool for serving and scaling PyTorch models in production.
1011

binaries/conda/build_packages.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
PACKAGES = ["torchserve", "torch-model-archiver", "torch-workflow-archiver"]
2323

2424
# conda convert supported platforms https://docs.conda.io/projects/conda-build/en/stable/resources/commands/conda-convert.html
25-
PLATFORMS = ["linux-64", "osx-64", "win-64"] # Add a new platform here
25+
PLATFORMS = ["linux-64", "osx-64", "win-64", "osx-arm64"] # Add a new platform here
2626

2727
if os.name == "nt":
2828
# Assumes miniconda is installed in windows

cpp/CMakeLists.txt

+33-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(torchserve_cpp VERSION 0.1)
44
set(CMAKE_CXX_STANDARD 17)
55
set(CMAKE_CXX_STANDARD_REQUIRED True)
66
set(CMAKE_CXX_EXTENSIONS OFF)
7-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -fPIC -D_GLIBCXX_USE_CXX11_ABI=1")
7+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -fPIC")
88

99
find_program(CLANG_TIDY_EXE NAMES "clang-tidy" REQUIRED)
1010
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")
@@ -18,35 +18,56 @@ if(CLANG_FORMAT_EXE)
1818
${PROJECT_SOURCE_DIR}/test/*.hh
1919
)
2020

21-
add_custom_target(format
22-
COMMAND
23-
${CLANG_FORMAT_EXE} -i -style=google ${ALL_CXX_SOURCE_FILES}
24-
)
2521
endif()
2622

2723

2824
find_package(Boost REQUIRED)
29-
find_package(folly REQUIRED)
30-
find_package(fmt REQUIRED)
31-
find_package(gflags REQUIRED)
3225
find_package(Torch REQUIRED)
3326

27+
include(FetchContent)
28+
29+
FetchContent_Declare(
30+
spdlog
31+
GIT_REPOSITORY https://github.com/gabime/spdlog
32+
GIT_TAG v1.13.0
33+
)
34+
FetchContent_GetProperties(spdlog)
35+
36+
if(NOT spdlog_POPULATED)
37+
message(STATUS "Fetching spdlog...")
38+
FetchContent_Populate(spdlog)
39+
add_subdirectory(${spdlog_SOURCE_DIR} ${spdlog_BINARY_DIR})
40+
endif()
41+
42+
43+
FetchContent_Declare(
44+
json
45+
GIT_REPOSITORY https://github.com/nlohmann/json
46+
GIT_TAG v3.11.3
47+
)
48+
FetchContent_GetProperties(json)
49+
50+
if(NOT json_POPULATED)
51+
message(STATUS "Fetching json...")
52+
FetchContent_Populate(json)
53+
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR})
54+
endif()
55+
56+
include_directories("${json_SOURCE_DIR}/include" "${spdlog_SOURCE_DIR}/include")
57+
3458
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
3559

3660
include_directories(${TORCH_INCLUDE_DIRS})
37-
include_directories(${FOLLY_INCLUDE_DIRS})
3861
include_directories(${GTEST_INCLUDE_DIRS})
3962
include_directories(${GMOCK_INCLUDE_DIRS})
4063

4164
include_directories("${CMAKE_INSTALL_PREFIX}/_deps")
4265
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
4366

44-
set(FOLLY_LIBRARIES Folly::folly)
45-
4667
# add subdirectories in src
4768
add_subdirectory(src/utils)
4869
add_subdirectory(src/backends)
4970
add_subdirectory(src/examples)
5071
add_subdirectory(test)
5172

52-
FILE(COPY src/resources/logging.config DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")
73+
FILE(COPY src/resources/logging.yaml DESTINATION "${CMAKE_INSTALL_PREFIX}/resources")

0 commit comments

Comments
 (0)