Comments (6)
I got multipy working on aarch64 in a bit of a hacky way but we can polish this up so it does things correctly.
(venv-multipy) ubuntu@ip-172-31-38-182 ~/m/m/r/build (main)> ./interactive_embedded_interpreter
Registering torch::deploy builtin library tensorrt (idx 0) with 0 builtin modules
torch::deploy builtin tensorrt contains 0 modules
Registering torch::deploy builtin library cpython_internal (idx 1) with 0 builtin modules
torch::deploy builtin cpython_internal contains 6 modules
Registering torch::deploy builtin library tensorrt (idx 0) with 0 builtin modules
torch::deploy builtin tensorrt contains 0 modules
Registering torch::deploy builtin library cpython_internal (idx 1) with 0 builtin modules
torch::deploy builtin cpython_internal contains 6 modules
[W OperatorEntry.cpp:150] Warning: Overriding a previously registered kernel for the same operator and the same dispatch key
operator: aten::get_gradients(int context_id) -> Dict(Tensor, Tensor)
registered at /home/ubuntu/pytorch/build/aten/src/ATen/RegisterSchema.cpp:6
dispatch key: (catch all)
previous kernel: registered at /home/ubuntu/pytorch/torch/csrc/jit/runtime/register_distributed_ops.cpp:278
new kernel: registered at /home/ubuntu/pytorch/torch/csrc/jit/runtime/register_distributed_ops.cpp:278 (function registerKernel)
--Return--
> /home/ubuntu/.pyenv/versions/3.9.13/lib/python3.9/pdb.py(1626)set_trace()->None
-> pdb.set_trace(sys._getframe().f_back)
(Pdb) import torch
(Pdb) torch.zeros(100)
tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0.])
(Pdb) import platform
(Pdb) platform.machine()
'aarch64'
Caveats:
- this only works with python/torch/c extensions that are compiled with
-mtls-dialect=trad
since we don't have support for ARM64's TLSDESC support. - DTP* relocations are also pretty hacky (just sets module_id to 0) but don't seem to be causing any issues
Links:
- 8648447
- https://github.com/pytorch/multipy/tree/aarch64
- https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst
I've been testing on a Graviton3 instance
from multipy.
We'd love to add ARM support but I don't have any specific timelines for when that might happen right now. We'd be happy to work with someone to add support if there's any community interest in contributing
Can you share more details of what type of hardware you want to use multipy/deploy with? Are you targeting mobile/embedded devices or desktop style hardware i.e. Macs/Graviton/etc?
The main changes would be to improve the loaders depending on the environment:
I believe this was adapted from the Android linker implementation with the non-x86 bits removed. It's feasible to add it back in though may be quite a bit of work when dealing with the full E2E PyTorch/Python build
https://android.googlesource.com/platform/bionic/+/android-6.0.1_r1/linker/linker.cpp
from multipy.
Hi @d4l3k , I'm actually targeting Datacenter / near-edge, server.
The ARM cores will mostly run very lightweight pre/post processing functions (e.g., tokenization in NLP) which will be added as a custom op (e.g., as done in libraries like torchtext/torchaudio/... ) while the rest of compute will be offloaded to computational accelerators.
from multipy.
@saareliad can you share what ARM architecture you're using? 64-bit? v8?
from multipy.
@saareliad can you share what ARM architecture you're using? 64-bit? v8?
Yes, 64-bit v8.2 (N1).
from multipy.
@saareliad sounds good, that should work with this prototype code -- 32bit won't
from multipy.
Related Issues (20)
- Create a build-requirements.txt for CentOS 8.
- Migrate Test Infra to pytorch/test-infra HOT 1
- Add Multithreading tests to test_deploy.cpp
- Have docs push action exit gracefully when there are no new docs
- support Clang lld
- pybind support
- support Mach-O/MacOS
- Embedded interpreter is 10% slower HOT 5
- A quesion in test_deploy example HOT 1
- Queston: is there any examples of inferece with python models written with numpy (intead of pytorch models)? HOT 3
- Question: is there any multi-threading inference example? HOT 1
- Question: how much do we support non-PyTorch code like NumPy HOT 1
- Local build fails with relocation error HOT 2
- add arm64 multipy instructions to setup.rst
- Get torch::inductor test to work with deploy
- Make errors more explicit when they come from the user
- PyTorch 2.0 compile mode examples HOT 2
- support c++17 compilation
- Deprecated pip option --install-options HOT 2
- Docker build fails with conda error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multipy.