Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I figured I'd give iOS building a shot. To even get started, one must build the iOS library for PyTorch. Make sure the
TORCH_VERSION
fromtorch-sys
matches the PyTorch checkout.For
aarch64-apple-ios-sim
you want to runBUILD_PYTORCH_MOBILE=1 IOS_PLATFORM=SIMULATOR IOS_ARCH=arm64 ./scripts/build_ios.sh
.For
aarch64-apple-ios
you wantBUILD_PYTORCH_MOBILE=1 IOS_ARCH=arm64 ./scripts/build_ios.sh
It's unclear how to get
x86_64-apple-ios
(the x86-64 iOS simulator).Once you've got that built,
IPHONEOS_DEPLOYMENT_TARGET=16.1 LIBTORCH=$PWD/pytorch-checkout/build_ios/install cargo build --target aarch64-apple-ios-sim --example basics
TODO:
tch::Cuda::is_available
andtch::Cuda::cudnn_is_available
result in unknown symbols when linkingException raised from findSchemaOrThrow at /Users/simlay/projects/torch-sys-source/pytorch/aten/src/ATen/core/dispatch/Dispatcher.cpp:131
aarch64-apple-ios-sim
, I get a pretty unique linking error that's unrelated to this PR:Work around is to build for host and then build for cross compiler target.
Here's the runtime error I'm seeing when I run the basics example in the iOS simulator: