Skip to content

Commit

Permalink
Merge pull request #74 from xhochy/cross-compile-aarch64
Browse files Browse the repository at this point in the history
Cross-compile aarch64
  • Loading branch information
h-vetinari authored Jun 22, 2023
2 parents e7c8f94 + 82f456f commit 072ec57
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 87 deletions.
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

0 comments on commit 072ec57

Please sign in to comment.