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

Dockerfile change tst. #164

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
ea69b21
Tst.
anirbanr-fb-r2p Sep 8, 2022
fcfc9eb
Tst.
anirbanr-fb-r2p Sep 8, 2022
159893d
Tst.
anirbanr-fb-r2p Sep 8, 2022
6889445
Tst.
anirbanr-fb-r2p Sep 8, 2022
6dfec4c
Tst.
anirbanr-fb-r2p Sep 8, 2022
bfd5b69
Tst.
anirbanr-fb-r2p Sep 8, 2022
a697e7c
Tst.
anirbanr-fb-r2p Sep 8, 2022
45e00fd
Tst.
anirbanr-fb-r2p Sep 8, 2022
9377eff
Tst.
anirbanr-fb-r2p Sep 8, 2022
51ab43c
Tst.
anirbanr-fb-r2p Sep 8, 2022
7b58b68
Tst.
anirbanr-fb-r2p Sep 8, 2022
3c12d23
Tst.
anirbanr-fb-r2p Sep 8, 2022
fbf0b3f
Tst.
anirbanr-fb-r2p Sep 8, 2022
3187745
Tst.
anirbanr-fb-r2p Sep 9, 2022
534cfbc
Tst.
anirbanr-fb-r2p Sep 9, 2022
3baa11b
tst.
anirbanr-fb-r2p Sep 9, 2022
e1d4b9e
Tst.
anirbanr-fb-r2p Sep 9, 2022
cc9f45c
Tst.
anirbanr-fb-r2p Sep 9, 2022
cd073b4
TSt.
anirbanr-fb-r2p Sep 9, 2022
413f3f8
Tst.
anirbanr-fb-r2p Sep 9, 2022
5b90c8e
Tst.
anirbanr-fb-r2p Sep 9, 2022
5f299ba
Tst.
anirbanr-fb-r2p Sep 9, 2022
9c4faf2
Tst.
anirbanr-fb-r2p Sep 9, 2022
3668646
Tst.
anirbanr-fb-r2p Sep 9, 2022
5503b45
Tst.
anirbanr-fb-r2p Sep 9, 2022
1e9cae5
Tst.
anirbanr-fb-r2p Sep 9, 2022
88ee097
Tst.
anirbanr-fb-r2p Sep 9, 2022
4946be9
Tst.
anirbanr-fb-r2p Sep 9, 2022
0fb8cb5
Tst.
anirbanr-fb-r2p Sep 9, 2022
7342559
Tst.
anirbanr-fb-r2p Sep 9, 2022
16d0638
Tst.
anirbanr-fb-r2p Sep 9, 2022
2b56900
Tst.
anirbanr-fb-r2p Sep 9, 2022
17ff12e
Tst.
anirbanr-fb-r2p Sep 9, 2022
b62643f
Tst.
anirbanr-fb-r2p Sep 9, 2022
9ab470b
Tst.
anirbanr-fb-r2p Sep 9, 2022
3ed4870
Tst.
anirbanr-fb-r2p Sep 9, 2022
d626894
Tst.
anirbanr-fb-r2p Sep 9, 2022
4cd838f
Tst.
anirbanr-fb-r2p Sep 9, 2022
546edad
Works locally.
anirbanr-fb-r2p Sep 9, 2022
41de0df
Try turning off --weaken-symbol=.
anirbanr-fb-r2p Sep 9, 2022
6047ea0
Add PROPERTY POSITION_INDEPENDENT_CODE ON after linking with libpytho…
anirbanr-fb-r2p Sep 9, 2022
26493a4
fpic before py install.
anirbanr-fb-r2p Sep 9, 2022
24b25df
Tst.
anirbanr-fb-r2p Sep 9, 2022
ae391a5
Tst.
anirbanr-fb-r2p Sep 9, 2022
0b6b4d6
Tst.
anirbanr-fb-r2p Sep 9, 2022
4b5348a
Tst.
anirbanr-fb-r2p Sep 9, 2022
5438f34
Tst.
anirbanr-fb-r2p Sep 9, 2022
8d44126
Tst.
anirbanr-fb-r2p Sep 9, 2022
c235223
Tst.
anirbanr-fb-r2p Sep 9, 2022
8436b3e
Tst.
anirbanr-fb-r2p Sep 12, 2022
3c9c4f4
Tst compat-req spec functorch commit.
anirbanr-fb-r2p Sep 14, 2022
c5235a4
Tst commit from aug 30.
anirbanr-fb-r2p Sep 14, 2022
a801e2a
Tst compats.
anirbanr-fb-r2p Sep 14, 2022
69abf98
tst compat vision only.
anirbanr-fb-r2p Sep 14, 2022
f5e1d5f
Tst audio only.
anirbanr-fb-r2p Sep 14, 2022
4972104
Tst pt3d only.
anirbanr-fb-r2p Sep 14, 2022
9af1263
tst tokenz only.
anirbanr-fb-r2p Sep 14, 2022
9f30cff
Tst.
anirbanr-fb-r2p Sep 15, 2022
67a0423
Merge branch 'main' into 3_7_tst_v01
anirbanr-fb-r2p Sep 15, 2022
4254c24
Tst.
anirbanr-fb-r2p Sep 28, 2022
27e1944
Merge branch 'main' into 3_7_tst_v01
anirbanr-fb-r2p Sep 28, 2022
d983547
Tst.
anirbanr-fb-r2p Sep 28, 2022
ef22020
Merge branch '3_7_tst_v01' of github.com:anirbanr-fb-r2p/multipy into…
anirbanr-fb-r2p Sep 28, 2022
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
8 changes: 8 additions & 0 deletions .github/workflows/runtime_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ jobs:
DOCKER_BUILDKIT: 1
run: docker build -t multipy --progress=plain --build-arg PYTHON_MAJOR_VERSION=${{ matrix.python-major-version }} --build-arg PYTHON_MINOR_VERSION=${{ matrix.python-minor-version }} .

- name: Set Python Version
run: |
echo "python-version=${{ matrix.python-major-version }}.${{ matrix.python-minor-version }}" >> $GITHUB_ENV

- name: Print Python version
run: |
echo "python version = ${{ env.python-version }}"

- name: Test
run: |
docker run --rm multipy bash -c "if [[ ${{ matrix.python-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && multipy/runtime/build/test_deploy"
Expand Down
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SHELL ["/bin/bash", "-c"]
RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt \
apt update && DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends \
build-essential \
cmake \
ca-certificates \
ccache \
curl \
Expand Down Expand Up @@ -44,11 +45,15 @@ RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt \
software-properties-common \
python-pip \
python3-pip && \
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor -o /usr/share/keyrings/magic-key.gpg && \
echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/magic-key.gpg] https://apt.kitware.com/ubuntu/ bionic main" | tee -a /etc/apt/sources.list && \
echo "deb http://security.ubuntu.com/ubuntu focal-security main" | tee -a /etc/apt/sources.list && \
# wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - && \
# apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' && \
# echo "deb http://security.ubuntu.com/ubuntu focal-security main" >> /etc/apt/sources.list && \
# apt-add-repository ppa:ubuntu-toolchain-r/test && \
apt update && \
apt install -y binutils cmake && \
apt install -y binutils && \
# cmake && \
# apt install -y binutils cmake gcc-8 g++-8 && \
# update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8 && \
rm -rf /var/lib/apt/lists/*
RUN /usr/sbin/update-ccache-symlinks
RUN mkdir /opt/ccache && ccache --set-config=cache_dir=/opt/ccache
Expand Down
3 changes: 3 additions & 0 deletions multipy/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
cmake_minimum_required(VERSION 3.19)
project(MultipyRuntime)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# set ABI by default to 0

option(ABI_EQUALS_1 "Set ABI value to 1, by default it is set to 0. Pytorch by default builds with ABI set to 1." OFF)
Expand Down Expand Up @@ -87,6 +89,7 @@ add_library(torch_deploy STATIC
${DEPLOY_DIR}/path_environment.cpp
${DEPLOY_DIR}/elf_file.cpp
)
# target_compile_options(torch_deploy PUBLIC -fpic -fpie)
target_link_libraries(torch_deploy PRIVATE crypt pthread dl util m z ffi lzma readline nsl ncursesw panelw) # for python builtins
target_link_libraries(torch_deploy PUBLIC shm torch fmt::fmt-header-only)
target_include_directories(torch_deploy PRIVATE ${CMAKE_SOURCE_DIR}/../..)
Expand Down
9 changes: 9 additions & 0 deletions multipy/runtime/interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ add_custom_command(
COMMAND "${CMAKE_OBJCOPY}" --weaken-symbol=_PyImport_FindSharedFuncptr libpython_multipy.a
)
add_custom_target(libpython_multipy DEPENDS libpython_multipy.a)
# target_compile_options(libpython_multipy PUBLIC -fpic -fpie)
set_property(TARGET libpython_multipy PROPERTY POSITION_INDEPENDENT_CODE ON)

# Build the interpreter lib, designed to be standalone and dlopened
# We bake the python and torch_python binding objs into libinterpreter
Expand All @@ -69,18 +71,25 @@ set(INTERPRETER_LIB_SOURCES
${LINKER_SCRIPT}
)
add_library(torch_deployinterpreter SHARED ${INTERPRETER_LIB_SOURCES} ${LINKER_SCRIPT})
# target_compile_options(torch_deployinterpreter PUBLIC -fpic -fpie)

add_library(multipy_torch SHARED plugin_torch.cpp)
set_property(TARGET multipy_torch PROPERTY POSITION_INDEPENDENT_CODE ON)
# target_compile_options(multipy_torch PUBLIC -fpic -fpie)


add_dependencies(torch_deployinterpreter libpython_multipy)
target_link_libraries(torch_deployinterpreter PRIVATE "-Wl,--no-as-needed -rdynamic" ${CMAKE_CURRENT_BINARY_DIR}/libpython_multipy.a)
set_property(TARGET torch_deployinterpreter PROPERTY POSITION_INDEPENDENT_CODE ON)

# need to ensure headers are present before any .cpp in interpreter are compiled,
# but cpp themselves don't clearly depend on cpython so there is a race otherwise
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(torch_deployinterpreter PRIVATE -fno-gnu-unique)
endif()

# target_compile_options(torch_deployinterpreter PUBLIC -fpic -fpie)

target_include_directories(torch_deployinterpreter PRIVATE ${INTERPRETER_DIR})
target_include_directories(torch_deployinterpreter BEFORE PUBLIC ${Python3_INCLUDE_DIRS})

Expand Down
12 changes: 6 additions & 6 deletions multipy/runtime/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@


class TestCompat(unittest.TestCase):
def test_torchvision(self):
import torchvision # noqa: F401
# def test_torchvision(self):
# import torchvision # noqa: F401

def test_torchaudio(self):
import torchaudio # noqa: F401
# def test_torchaudio(self):
# import torchaudio # noqa: F401

def test_pytorch3d(self):
import pytorch3d # noqa: F401
# def test_pytorch3d(self):
# import pytorch3d # noqa: F401

def test_hf_tokenizers(self):
import tokenizers # noqa: F401
Expand Down