Skip to content

Commit 49b629a

Browse files
authored
Merge aeb970b into 80fd3b3
2 parents 80fd3b3 + aeb970b commit 49b629a

File tree

5 files changed

+49
-20
lines changed

5 files changed

+49
-20
lines changed

.github/workflows/runtime_nightly.yaml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Multipy runtime nightly release
33
on:
44
schedule:
55
- cron: '0 2 * * *' # run at 2 AM UTC
6+
pull_request:
7+
push:
8+
branches:
9+
- main
610

711
jobs:
812
unittest:
@@ -11,6 +15,7 @@ jobs:
1115
python-version: [3.8]
1216
platform: [linux.2xlarge]
1317
abi: [0,1]
18+
cuda: [0,1]
1419
fail-fast: false
1520
runs-on: ${{ matrix.platform }}
1621
steps:
@@ -27,6 +32,7 @@ jobs:
2732
2833
- name: setup Path
2934
run: |
35+
echo /usr/local/cuda-11.3/bin >> $GITHUB_PATH
3036
echo "/home/ec2-user/miniconda/bin" >> $GITHUB_PATH
3137
echo "CONDA=/home/ec2-user/miniconda" >> $GITHUB_PATH
3238
@@ -75,7 +81,7 @@ jobs:
7581
conda run -n example_env python -m pip install torch torchvision torchaudio pathlib
7682
conda run -n example_env python generate_examples.py
7783
78-
- name: Build pytorch with ABI=${{ matrix.abi }}
84+
- name: Build pytorch with ABI=${{ matrix.abi }} and USE_CUDA=${{ matrix.cuda }}
7985
shell: bash -l {0}
8086
env:
8187
PYTHON_VERSION: ${{ matrix.python-version }}
@@ -85,9 +91,10 @@ jobs:
8591
export TORCH_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=${{ matrix.abi }}"
8692
cd multipy/runtime/third-party/pytorch
8793
export USE_DEPLOY=1
94+
export USE_CUDA=${{ matrix.cuda }}
8895
conda run -n multipy_runtime_env python setup.py develop
8996
90-
- name: Build multipy runtime with ABI=${{ matrix.abi }}
97+
- name: Build multipy runtime
9198
shell: bash -l {0}
9299
env:
93100
PYTHON_VERSION: ${{ matrix.python-version }}
@@ -98,22 +105,33 @@ jobs:
98105
conda run -n multipy_runtime_env cmake -DABI_EQUALS_1=${{ matrix.abi }} ..
99106
conda run -n multipy_runtime_env cmake --build . --config Release
100107
101-
- name: install files
108+
- name: Install files
102109
shell: bash -l {0}
103110
env:
104111
PYTHON_VERSION: ${{ matrix.python-version }}
105112
run: |
106113
cd multipy/runtime/build
107114
conda run -n multipy_runtime_env cmake --install . --prefix "."
108115
109-
- name: Run unit tests with ABI=${{ matrix.abi }}
116+
- name: Run unit tests with ABI=${{ matrix.abi }} with cuda=${{ matrix.cuda }}
110117
shell: bash -l {0}
111118
env:
112119
PYTHON_VERSION: ${{ matrix.python-version }}
113120
run: |
114121
cd multipy/runtime/build
115122
./test_deploy
116123
124+
- name: Run unit tests with ABI=${{ matrix.abi }} with gpu
125+
shell: bash -l {0}
126+
env:
127+
PYTHON_VERSION: ${{ matrix.python-version }}
128+
run: |
129+
if [[ ${{ matrix.cuda }} -eq 1 ]]
130+
then
131+
cd multipy/runtime/build
132+
./test_deploy_gpu
133+
fi
134+
117135
- name: create tarball [click me to get a list of files for the nightly release]
118136
shell: bash -l {0}
119137
env:
@@ -125,7 +143,7 @@ jobs:
125143
- name: Update nightly release
126144
uses: pyTooling/Actions/releaser@main
127145
with:
128-
tag: nightly-runtime-abi-${{ matrix.abi }}
146+
tag: nightly-runtime-abi-${{ matrix.abi }}-cuda-${{matrix.cuda}}
129147
rm: true
130148
token: ${{ secrets.GITHUB_TOKEN }}
131149
files: |

.github/workflows/runtime_tests.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
python-version: [3.7, 3.8, 3.9]
1414
platform: [linux.2xlarge]
1515
abi: [0,1]
16+
cuda: [0,1]
1617
fail-fast: false
1718
runs-on: ${{ matrix.platform }}
1819
steps:
@@ -30,6 +31,7 @@ jobs:
3031
3132
- name: setup Path
3233
run: |
34+
echo /usr/local/cuda-11.3/bin >> $GITHUB_PATH
3335
echo "/home/ec2-user/miniconda/bin" >> $GITHUB_PATH
3436
echo "CONDA=/home/ec2-user/miniconda" >> $GITHUB_PATH
3537
@@ -78,7 +80,7 @@ jobs:
7880
conda run -n example_env python -m pip install torch torchvision torchaudio pathlib
7981
conda run -n example_env python generate_examples.py
8082
81-
- name: Build pytorch with ABI=${{ matrix.abi }}
83+
- name: Build pytorch with ABI=${{ matrix.abi }} and USE_CUDA=${{ matrix.cuda }}
8284
shell: bash -l {0}
8385
env:
8486
PYTHON_VERSION: ${{ matrix.python-version }}
@@ -88,6 +90,7 @@ jobs:
8890
export TORCH_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=${{ matrix.abi }}"
8991
cd multipy/runtime/third-party/pytorch
9092
export USE_DEPLOY=1
93+
export USE_CUDA=${{ matrix.cuda }}
9194
conda run -n multipy_runtime_env python setup.py develop
9295
9396
- name: Build multipy runtime
@@ -109,11 +112,20 @@ jobs:
109112
cd multipy/runtime/build
110113
conda run -n multipy_runtime_env cmake --install . --prefix "."
111114
112-
- name: Run unit tests with ABI=${{ matrix.abi }}
113-
if: ${{ matrix.abi }} == 1
115+
- name: Run unit tests with ABI=${{ matrix.abi }} with cuda=${{ matrix.cuda }}
114116
shell: bash -l {0}
115117
env:
116118
PYTHON_VERSION: ${{ matrix.python-version }}
117119
run: |
118120
cd multipy/runtime/build
119121
./test_deploy
122+
- name: Run unit tests with ABI=${{ matrix.abi }} with gpu
123+
shell: bash -l {0}
124+
env:
125+
PYTHON_VERSION: ${{ matrix.python-version }}
126+
run: |
127+
if [[ ${{ matrix.cuda }} -eq 1 ]]
128+
then
129+
cd multipy/runtime/build
130+
./test_deploy_gpu
131+
fi

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ internally, please see the related [arXiv paper](https://arxiv.org/pdf/2104.0025
1313

1414
### Installing `multipy::runtime` **(recommended)**
1515

16-
The C++ binaries (`libtorch_interpreter.so`,`libtorch_deploy.a`, `utils.cmake`), and the header files of `multipy::runtime` can be installed from our [nightly release](https://github.com/pytorch/multipy/releases/tag/nightly-runtime-abi-0). The ABI for the nightly release is 0. You can find a version of the release with ABI=1 [here](https://github.com/pytorch/multipy/releases/tag/nightly-runtime-abi-1).
16+
The C++ binaries (`libtorch_interpreter.so`,`libtorch_deploy.a`, `utils.cmake`), and the header files of `multipy::runtime` can be installed from our [nightly release](https://github.com/pytorch/multipy/releases/tag/nightly-runtime-abi-0-cuda-0) (uses the pre-cxx11 ABI). You can find a version of the release with the [cxx11 ABI](https://github.com/pytorch/multipy/releases/tag/nightly-runtime-abi-1-cuda-0.
17+
18+
C++ binaries with cuda (11.3) support can also be found for the [pre-cxx11 ABI](https://github.com/pytorch/multipy/releases/tag/nightly-runtime-cuda-abi-0-cuda-1) and the [cxx11 ABI](https://github.com/pytorch/multipy/releases/tag/nightly-runtime-cuda-abi-1-cuda-1).
1719

1820
```
1921
wget https://github.com/pytorch/multipy/releases/download/nightly-runtime-abi-0/multipy_runtime.tar.gz

multipy/runtime/CMakeLists.txt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,12 @@ target_link_libraries(test_deploy
8686
)
8787
target_include_directories(test_deploy PRIVATE ${CMAKE_SOURCE_DIR}/../..)
8888

89-
# LINK_DIRECTORIES("${PYTORCH_ROOT}/torch/lib")
90-
# add_executable(test_deploy_gpu ${INTERPRETER_TEST_SOURCES_GPU})
91-
# target_compile_definitions(test_deploy_gpu PUBLIC TEST_CUSTOM_LIBRARY)
92-
# target_include_directories(test_deploy_gpu PRIVATE ${PYTORCH_ROOT}/torch)
93-
# target_include_directories(test_deploy_gpu PRIVATE ${CMAKE_SOURCE_DIR}/../..)
94-
# target_link_libraries(test_deploy_gpu
95-
# PUBLIC "-Wl,--no-as-needed -rdynamic" gtest dl torch_deploy_interface c10 torch_cpu
96-
# )
89+
LINK_DIRECTORIES("${PYTORCH_ROOT}/torch/lib")
90+
add_executable(test_deploy_gpu ${INTERPRETER_TEST_SOURCES_GPU})
91+
target_compile_definitions(test_deploy_gpu PUBLIC TEST_CUSTOM_LIBRARY)
92+
target_include_directories(test_deploy_gpu PRIVATE ${PYTORCH_ROOT}/torch)
93+
target_include_directories(test_deploy_gpu PRIVATE ${CMAKE_SOURCE_DIR}/../..)
94+
target_link_libraries(test_deploy_gpu PUBLIC "-Wl,--no-as-needed -rdynamic" gtest dl torch_deploy_interface c10 torch_cpu)
9795

9896
LINK_DIRECTORIES("${PYTORCH_ROOT}/torch/lib")
9997
add_library(test_deploy_lib SHARED test_deploy_lib.cpp)
@@ -119,7 +117,7 @@ target_link_libraries(interactive_embedded_interpreter
119117
)
120118

121119
install(TARGETS test_deploy DESTINATION tests/bin)
122-
# install(TARGETS test_deploy_gpu DESTINATION tests/bin)
120+
install(TARGETS test_deploy_gpu DESTINATION tests/bin)
123121

124122
install(TARGETS test_deploy DESTINATION tests/bin)
125123

multipy/runtime/test_deploy_gpu.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ TEST(TorchDeployGPUTest, SimpleModel) {
6363

6464
TEST(TorchDeployGPUTest, UsesDistributed) {
6565
const auto model_filename = path(
66-
"USES_DISTRIBUTED",
67-
"torch/csrc/deploy/example/generated/uses_distributed");
66+
"USES_DISTRIBUTED", "multipy/runtime/example/generated/uses_distributed");
6867
torch::deploy::InterpreterManager m(1);
6968
torch::deploy::Package p = m.loadPackage(model_filename);
7069
{

0 commit comments

Comments
 (0)