diff --git a/.github/workflows/build_test_release.yaml b/.github/workflows/build_test_release.yaml new file mode 100644 index 00000000..00f09d3b --- /dev/null +++ b/.github/workflows/build_test_release.yaml @@ -0,0 +1,142 @@ +name: Reusable build, test and release + +on: + workflow_call: + inputs: + python3-minor-version: + required: true + type: string + runner: + required: true + type: string + distro: + default: centos7 + type: string + compat-tests: + default: false + type: boolean + release: + default: false + type: boolean + secrets: + token: + required: true + +jobs: + build-test: + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + with: + runner: ${{ inputs.runner }} + upload-artifact: multipy_runtime_python3.${{ inputs.python3-minor-version }} + repository: pytorch/multipy + gpu-arch-type: cuda + gpu-arch-version: 116 + script: | + python_version=3.${{ inputs.python3-minor-version }} + + echo "::group::Install runtime build dependencies" + xargs yum install -y > "${GITHUB_ENV}" - - - name: Build - env: - DOCKER_BUILDKIT: 1 - run: nvidia-docker build -t multipy --progress=plain --build-arg PYTHON_3_MINOR_VERSION=${{ matrix.python3-minor-version }} --build-arg BUILD_CUDA_TESTS=1 . - - - name: Test - run: | - docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && multipy/runtime/build/test_deploy" - nvidia-docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && multipy/runtime/build/test_deploy_gpu" - - - - name: Examples - run: | - docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && examples/build/hello_world_example" - docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && python3 examples/quickstart/gen_package.py && ./examples/build/quickstart my_package.pt" - docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && ./examples/build/movable_example" - - - name: Benchmark - run: | - docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && ./multipy/runtime/build/deploy_benchmark 2 none jit multipy/runtime/example/generated/resnet" - - - name: Set Python Version - run: | - echo "python-version=3.${{ matrix.python3-minor-version }}" >> $GITHUB_ENV - - - name: Create Tarball - run: | - docker cp $(docker run -d multipy):/opt/dist/multipy . - tar -czvf multipy_runtime_python${{ env.python-version }}.tar.gz multipy/ - - - name: Update nightly release - uses: pyTooling/Actions/releaser@main - with: - tag: nightly-runtime-python${{ env.python-version }} - rm: true - token: ${{ secrets.GITHUB_TOKEN }} - files: | - multipy_runtime_python${{ env.python-version }}.tar.gz + uses: ./.github/workflows/build_test_release.yaml + with: + python3-minor-version: ${{ matrix.python3-minor-version }} + runner: ${{ matrix.platform }} + release: true + secrets: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/runtime_tests.yaml b/.github/workflows/runtime_tests.yaml index de40544b..a8bbac54 100644 --- a/.github/workflows/runtime_tests.yaml +++ b/.github/workflows/runtime_tests.yaml @@ -14,43 +14,10 @@ jobs: python3-minor-version: [7,8,9,10] platform: [linux.4xlarge.nvidia.gpu] fail-fast: false - runs-on: ${{ matrix.platform }} - steps: - - name: Checkout MultiPy - uses: actions/checkout@v2 - with: - submodules: true - - name: Install nvidia driver, nvidia-docker runtime, set GPU_FLAG - uses: pytorch/test-infra/.github/actions/setup-nvidia@main - - name: Setup SSH (Click me for login details) - uses: ./.github/actions/setup-ssh - with: - github-secret: ${{ secrets.GITHUB_TOKEN }} - - - name: Build - env: - DOCKER_BUILDKIT: 1 - run: nvidia-docker build -t multipy --progress=plain --build-arg PYTHON_3_MINOR_VERSION=${{ matrix.python3-minor-version }} --build-arg BUILD_CUDA_TESTS=1 . - - - name: C++ Tests - run: | - docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && multipy/runtime/build/test_deploy" - nvidia-docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && multipy/runtime/build/test_deploy_gpu" - - - name: Pybind Tests - run: | - docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && python multipy/runtime/test_pybind.py" - - - name: Examples - run: | - docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && examples/build/hello_world_example" - docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && python3 examples/quickstart/gen_package.py && ./examples/build/quickstart my_package.pt" - docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && ./examples/build/movable_example" - - - name: Benchmark - run: | - docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -lt 8 ]]; then source ~/venvs/multipy/bin/activate; fi && ./multipy/runtime/build/deploy_benchmark 2 none jit multipy/runtime/example/generated/resnet" - - - name: Compat Tests - run: | - docker run --rm multipy bash -c "if [[ ${{ matrix.python3-minor-version }} -gt 7 ]]; then pip install -r compat-requirements.txt && multipy/runtime/build/interactive_embedded_interpreter --pyscript multipy/runtime/test_compat.py; fi" + uses: ./.github/workflows/build_test_release.yaml + with: + python3-minor-version: ${{ matrix.python3-minor-version }} + runner: ${{ matrix.platform }} + compat-tests: true + secrets: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/build-requirements-centos7.txt b/build-requirements-centos7.txt new file mode 100644 index 00000000..9988b758 --- /dev/null +++ b/build-requirements-centos7.txt @@ -0,0 +1,14 @@ +binutils +bzip2 +bzip2-devel +gcc +gtest-devel +libffi-devel +make +openssl-devel +readline-devel +sqlite +sqlite-devel +tk-devel +xz-devel +zlib-devel diff --git a/multipy/runtime/loader.cpp b/multipy/runtime/loader.cpp index 377d9c7e..2a30701a 100644 --- a/multipy/runtime/loader.cpp +++ b/multipy/runtime/loader.cpp @@ -67,6 +67,18 @@ #include #include +/* The ELF version installed with CentOS 7 comes with a trailing 64. For distro + * independent use these are mapped. */ + +#ifndef R_AARCH64_TLS_DTPREL +#define R_AARCH64_TLS_DTPREL R_AARCH64_TLS_DTPREL64 + +#endif +#ifndef R_AARCH64_TLS_DTPMOD +#define R_AARCH64_TLS_DTPMOD R_AARCH64_TLS_DTPMOD64 + +#endif + namespace torch { namespace deploy {