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

Cross-compile aarch64 #74

Merged
merged 7 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
48 changes: 32 additions & 16 deletions .azure-pipelines/azure-pipelines-linux.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cxx_compiler:
cxx_compiler_version:
- '12'
docker_image:
- quay.io/condaforge/linux-anvil-aarch64
- quay.io/condaforge/linux-anvil-cos7-x86_64
libjpeg_turbo:
- 2.1.5
libpng:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cxx_compiler:
cxx_compiler_version:
- '12'
docker_image:
- quay.io/condaforge/linux-anvil-aarch64
- quay.io/condaforge/linux-anvil-cos7-x86_64
libjpeg_turbo:
- 2.1.5
libpng:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cxx_compiler:
cxx_compiler_version:
- '12'
docker_image:
- quay.io/condaforge/linux-anvil-aarch64
- quay.io/condaforge/linux-anvil-cos7-x86_64
libjpeg_turbo:
- 2.1.5
libpng:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cxx_compiler:
cxx_compiler_version:
- '12'
docker_image:
- quay.io/condaforge/linux-anvil-aarch64
- quay.io/condaforge/linux-anvil-cos7-x86_64
libjpeg_turbo:
- 2.1.5
libpng:
Expand Down
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

41 changes: 17 additions & 24 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions conda-forge.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build_platform:
linux_aarch64: linux_aarch64
linux_aarch64: linux_64
osx_arm64: osx_64
conda_build:
pkg_format: '2'
Expand All @@ -9,6 +9,4 @@ github:
tooling_branch_name: main
os_version:
linux_64: cos7
provider:
linux_aarch64: default
test_on_native_only: true
test: native_and_emulated
28 changes: 28 additions & 0 deletions recipe/0001-Monkeypatch-TORCH_LIB_PATH.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From ebc3a96e6e5dfe411d940b147c45368ba5fc3b2d Mon Sep 17 00:00:00 2001
From: Uwe Korn <[email protected]>
Date: Wed, 21 Jun 2023 19:13:57 +0000
Subject: [PATCH] Monkeypatch TORCH_LIB_PATH

---
setup.py | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/setup.py b/setup.py
index 24b7a2e..4016405 100644
--- a/setup.py
+++ b/setup.py
@@ -11,6 +11,11 @@ from pkg_resources import DistributionNotFound, get_distribution, parse_version
from setuptools import find_packages, setup
from torch.utils.cpp_extension import BuildExtension, CppExtension, CUDA_HOME, CUDAExtension

+import site
+import torch.utils.cpp_extension
+
+torch.utils.cpp_extension.TORCH_LIB_PATH = site.getsitepackages()[0] + '/torch/lib'
+

def read(*names, **kwargs):
with open(os.path.join(os.path.dirname(__file__), *names), encoding=kwargs.get("encoding", "utf8")) as fp:
--
2.40.1

6 changes: 4 additions & 2 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ package:
source:
url: https://github.com/pytorch/vision/archive/v{{ version }}.tar.gz
sha256: 1efcb80e0a6e42c54f07ee16167839b4d302aeeecc12839cc47c74b06a2c20d4
patches:
- 0001-Monkeypatch-TORCH_LIB_PATH.patch

build:
number: 0
number: 1
skip: true # [win]
# as of pytorch 1.13, conda-forge only builds for CUDA 11.2+, see
# https://github.com/conda-forge/conda-forge-pinning-feedstock/issues/3491
Expand Down Expand Up @@ -146,7 +148,7 @@ outputs:
# 2023/05 The gaussian blur tests are known to be flaky due to some non-determinism on CUDA (see pytorch/vision#6755)
{% set tests_to_skip = tests_to_skip + " or test_batched_vs_single" %}
- pytest --verbose -k "not ({{ tests_to_skip }})" --durations=50 test/ # [not aarch64]
- pytest -k "not ({{ tests_to_skip }})" --durations=50 test/ # [aarch64]
- pytest -k "not ({{ tests_to_skip }})" --durations=50 test/ # [aarch64 and (build_platform == target_platform)]

about:
home: http://pytorch.org/
Expand Down