Skip to content

Commit 167b72d

Browse files
robellfacebook-github-bot
authored andcommitted
Summary: Initial TOSA support in executorch (#161)
Summary: An implementation of a TOSA Partitioner and TOSA backend supporting a small list of operators in fp32 and int8/32. This includes a set of integer networks which will then compile to target Ethos-U NPU using the Vela compiler. * A small set of test networks in fp32 * A subset of these supporting integer and compiling with Vela * A test wrapper to register and test networks through the compile stack * A flow pt2 -> executorch -> tosa_flatbuffer.tosa file -> tosa_reference_model * A flow pt2 -> executorch -> tosa_flatbuffer.tosa file -> vela -> command_stream * This work depends on a few different python modules * https://review.mlplatform.org/plugins/gitiles/tosa/serialization_lib/ * https://review.mlplatform.org/plugins/gitiles/ml/ethos-u/ethos-u-vela/ * This work uses other projects for validation * https://review.mlplatform.org/plugins/gitiles/tosa/reference_model/ Pull Request resolved: #161 Reviewed By: mergennachin Differential Revision: D49542254 Pulled By: digantdesai fbshipit-source-id: bb4074d5b66233c85452c2373a08ddc1cdd0826f
1 parent c3f3ef4 commit 167b72d

File tree

13 files changed

+1122
-2
lines changed

13 files changed

+1122
-2
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@
2828
[submodule "backends/xnnpack/third-party/XNNPACK"]
2929
path = backends/xnnpack/third-party/XNNPACK
3030
url = https://github.com/google/XNNPACK.git
31+
[submodule "backends/arm/third-party/serialization_lib"]
32+
path = backends/arm/third-party/serialization_lib
33+
url = https://git.mlplatform.org/tosa/serialization_lib.git

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ BSD License
33
For "ExecuTorch" software
44

55
Copyright (c) Meta Platforms, Inc. and affiliates.
6+
Copyright 2023 Arm Limited and/or its affiliates.
67

78
Redistribution and use in source and binary forms, with or without modification,
89
are permitted provided that the following conditions are met:

backends/arm/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Executorch Arm/TOSA Delegate
2+
3+
This subtree contains the Arm Delegate implementation for Executorch.
4+
5+
This delegate is structured to, over time, support a number of different Arm devices
6+
through an AoT flow which targets multiple Arm IP using the TOSA standard.
7+
8+
The expected flow is:
9+
* torch.nn.module -> TOSA -> command_stream for fully AoT flows e.g. embedded.
10+
* torch.nn.module -> TOSA for flows supporting a JiT compilation step.
11+
12+
Current backend support is being developed for TOSA to Ethos-U55/65 via the
13+
ethos-u-vela compilation stack. which follows the fully AoT flow.
14+
15+
## Layout
16+
- `arm_backend.py` - AoT Partitioner which maps to a subset of Base Inference and Main Inference TOSA profiles, where the subset may be further constrained for early support devices like Ethos-U55. AoT Backend which implements the preprocess step which converts to TOSA and can emit files for ethos-u-vela as shown in `executorch/examples/arm/`
17+
- `test/` - unit test and test support functions
18+
- `third-party/` - source dependencies - currently just on TOSA serialization_lib
19+
- `tosa_mapping.py` - helper functions for mapping edge dialect to TOSA
20+
21+
## Help & Improvements
22+
If you have problems or questions, or have suggestions for ways to make
23+
implementation and testing better, please reach out to the Arm team developing this delegate, or
24+
create an issue on [github](https://www.github.com/pytorch/executorch/issues).

0 commit comments

Comments
 (0)