Skip to content

Commit 97b3467

Browse files
PaliCfacebook-github-bot
authored andcommitted
update nightly builds to work with dynamic loading (#148)
Summary: Pull Request resolved: #148 This pr fixes the nightly builds to work with dynamic loading. Testing can be found here https://github.com/pytorch/multipy/runs/8120141350?check_suite_focus=true Test Plan: Imported from OSS Reviewed By: d4l3k Differential Revision: D39182018 Pulled By: PaliC fbshipit-source-id: cbd2104f5f4362d8b10cd0925e1afd362df6c118
1 parent 2077b37 commit 97b3467

File tree

2 files changed

+15
-98
lines changed

2 files changed

+15
-98
lines changed
+14-97
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Multipy runtime nightly release
1+
name: Multipy runtime nightly test + release
22

33
on:
44
schedule:
@@ -9,27 +9,10 @@ jobs:
99
strategy:
1010
matrix:
1111
python-version: [3.8, 3.9, '3.10']
12-
platform: [linux.2xlarge]
13-
abi: [0,1]
12+
platform: [ubuntu-18.04]
1413
fail-fast: false
1514
runs-on: ${{ matrix.platform }}
1615
steps:
17-
- name: Update pip
18-
run: |
19-
sudo yum update -y
20-
sudo yum -y install git python3-pip
21-
sudo pip3 install --upgrade pip
22-
23-
- name: Setup conda
24-
run: |
25-
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ${RUNNER_TEMP}/miniconda.sh
26-
bash ${RUNNER_TEMP}/miniconda.sh -b -p ${RUNNER_TEMP}/miniconda
27-
28-
- name: setup Path
29-
run: |
30-
echo "${RUNNER_TEMP}/miniconda/bin" >> $GITHUB_PATH
31-
echo "CONDA=${RUNNER_TEMP}/miniconda" >> $GITHUB_PATH
32-
3316
- name: Checkout MultiPy
3417
uses: actions/checkout@v2
3518
with:
@@ -40,94 +23,28 @@ jobs:
4023
with:
4124
github-secret: ${{ secrets.GITHUB_TOKEN }}
4225

43-
- name: Install C++ toolchain
44-
run: |
45-
sudo yum -y install clang llvm
46-
export CC=clang
47-
export CXX=clang++
48-
sudo yum -y install xz-devel bzip2-devel libnsl2-devel readline-devel expat-devel gdbm-devel glibc-devel gmp-devel libffi-devel libGL-devel libX11-devel ncurses-devel openssl-devel sqlite-devel tcl-devel tix-devel tk-devel
49-
sudo yum -y install lzma
50-
sudo yum -y install uuid
51-
sudo yum -y install openmpi-devel
52-
sudo yum -y install zlib-devel
53-
54-
- name: create conda env
55-
run: |
56-
conda create --name multipy_runtime_env python=${{ matrix.python-version }}
57-
conda info
58-
59-
- name: Install python/pytorch dependencies
60-
shell: bash -l {0}
61-
env:
62-
PYTHON_VERSION: ${{ matrix.python-version }}
63-
run: |
64-
conda run -n multipy_runtime_env python -m pip install astunparse numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions future six requests dataclasses pytest
65-
66-
- name: gen examples
67-
shell: bash -l {0}
68-
env:
69-
PYTHON_VERSION: ${{ matrix.python-version }}
70-
run: |
71-
# A minor hack to get the CI working as conda doesn't have torch,
72-
# fortunately we can remove this once we have a dynamically linked torch
73-
cd multipy/runtime/example
74-
conda create --name example_env python=${{ matrix.python-version }}
75-
conda run -n example_env python -m pip install torch torchvision torchaudio pathlib
76-
conda run -n example_env python generate_examples.py
77-
78-
- name: Build pytorch with ABI=${{ matrix.abi }}
79-
shell: bash -l {0}
80-
env:
81-
PYTHON_VERSION: ${{ matrix.python-version }}
82-
run: |
83-
export GLIBCXX_USE_CXX11_ABI=${{ matrix.abi }}
84-
export CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=${{ matrix.abi }}"
85-
export TORCH_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=${{ matrix.abi }}"
86-
cd multipy/runtime/third-party/pytorch
87-
export USE_DEPLOY=1
88-
conda run -n multipy_runtime_env python setup.py develop
89-
90-
- name: Build multipy runtime with ABI=${{ matrix.abi }}
91-
shell: bash -l {0}
26+
- name: Build
9227
env:
93-
PYTHON_VERSION: ${{ matrix.python-version }}
94-
run: |
95-
cd multipy/runtime
96-
mkdir build
97-
cd build
98-
conda run -n multipy_runtime_env cmake -DABI_EQUALS_1=${{ matrix.abi }} ..
99-
conda run -n multipy_runtime_env cmake --build . --config Release
28+
DOCKER_BUILDKIT: 1
29+
run: docker build -t multipy --progress=plain --build-arg PYTHON_VERSION=${{ matrix.python-version }} .
10030

101-
- name: install files
102-
shell: bash -l {0}
103-
env:
104-
PYTHON_VERSION: ${{ matrix.python-version }}
31+
- name: Test
10532
run: |
106-
cd multipy/runtime/build
107-
conda run -n multipy_runtime_env cmake --install . --prefix "."
108-
109-
- name: Run unit tests with ABI=${{ matrix.abi }}
110-
shell: bash -l {0}
111-
env:
112-
PYTHON_VERSION: ${{ matrix.python-version }}
33+
docker run --rm multipy multipy/runtime/build/test_deploy
34+
- name: Compat Tests
11335
run: |
114-
export PYTHONPATH=$PYTHONPATH:$(pwd)
115-
cd multipy/runtime/build
116-
./test_deploy
36+
docker run --rm multipy bash -c "pip install -r compat-requirements.txt && multipy/runtime/build/interactive_embedded_interpreter --pyscript multipy/runtime/test_compat.py"
11737
118-
- name: create tarball [click me to get a list of files for the nightly release]
119-
shell: bash -l {0}
120-
env:
121-
PYTHON_VERSION: ${{ matrix.python-version }}
38+
- name: Create Tarball
12239
run: |
123-
cd multipy/runtime/build/dist
124-
tar -czvf multipy_runtime.tar.gz multipy/
40+
docker cp $(docker run -d multipy):/opt/dist/multipy .
41+
tar -czvf multipy_runtime_python${{ matrix.python-version }}.tar.gz multipy/
12542
12643
- name: Update nightly release
12744
uses: pyTooling/Actions/releaser@main
12845
with:
129-
tag: nightly-runtime-abi-${{ matrix.abi }}
46+
tag: nightly-runtime-python${{ matrix.python-version }}
13047
rm: true
13148
token: ${{ secrets.GITHUB_TOKEN }}
13249
files: |
133-
multipy/runtime/build/dist/multipy_runtime.tar.gz
50+
multipy_runtime_python${{ matrix.python-version }}.tar.gz

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ RUN mkdir multipy/runtime/build && \
7878
RUN cd multipy/runtime/example && python generate_examples.py
7979
ENV PYTHONPATH=. LIBTEST_DEPLOY_LIB=multipy/runtime/build/libtest_deploy_lib.so
8080

81-
RUN mkdir /opt/dist && cp -r multipy/runtime/build/dist /opt/dist/
81+
RUN mkdir /opt/dist && cp -r multipy/runtime/build/dist/* /opt/dist/

0 commit comments

Comments
 (0)