Support more ops and verify more models#14106
Conversation
Signed-off-by: jiseong.oh <jiseong.oh@samsung.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/14106
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Cancelled Job, 37 Pending, 2 Unrelated FailuresAs of commit 3437e4c with merge base a89b858 ( NEW FAILURE - The following job has failed:
CANCELLED JOB - The following job was cancelled. Please retry:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
- Add ops in op builders - batchmatmul, div, maximun, minimun, rsqrt, slice_copy, sqrt, to_copy Co-authored-by: chong-chen <chong.chen@samsung.com> Co-authored-by: jingya-zhang <jingya.zhang@samsung.com>
- add squeeze, sub ops Co-authored-by: chong-chen <chong.chen@samsung.com>
1. Propagate constant and remove constant ops. 2. Prevent some ops from decomposing.(HardSwish, linear in mv3) 3. Add models name to support list (ic4, edsr enabled at the same time) in aot_compiler Co-authored-by: xz-linghu <xz.linghu@samsung.com> Co-authored-by: chong-chen <chong.chen@samsung.com>
Add prelu, softmax, layer_norm, upsample builders. Add these ops to list which keep ops not to decompose Co-authored-by: chong-chen <chong.chen@samsung.com> Co-authored-by: xz-linghu <xz.linghu@samsung.com>
1. Add necessary ops - gelu, expand, etc. 2. Preprocess mul/add/sub scalar ops, add ReplaceScalarOps pass. Co-authored-by: xz-linghu <xz.linghu@samsung.com> Co-authored-by: chong-chen <chong.chen@samsung.com>
Convert conv1d to conv2d and support logsoftmax op. w2l can be enabled in samsung enn backend Co-authored-by: Jonghun Cha <jhbb.cha@samsung.com> Co-authored-by: chong-chen <chong.chen@samsung.com>
Support the ops of bert float model (finetune) Co-authored-by: chong-chen <chong.chen@samsung.com>
Implement test for each op supported in builders Co-authored-by: chong-chen <chong.chen@samsung.com> Co-authored-by: xz-linghu <xz.linghu@samsung.com> Co-authored-by: Jonghun Cha <jhbb.cha@samsung.com> Co-authored-by: jingya-zhang <jingya.zhang@samsung.com>
add more model tests to test workflow. Like mv3, dl3, vit, etc.
Signed-off-by: jiseong.oh <jiseong.oh@samsung.com>
Signed-off-by: jiseong.oh <jiseong.oh@samsung.com>
Signed-off-by: jiseong.oh <jiseong.oh@samsung.com>
…utorch into expands_more_ops
Signed-off-by: jiseong.oh <jiseong.oh@samsung.com>
examples/samsung/aot_compiler.py
Outdated
| model = model.eval() | ||
| outputs = model(*example_inputs) | ||
|
|
||
| print("start start ...") |
Signed-off-by: jiseong.oh <jiseong.oh@samsung.com>
| # Output from pretrained model exceeds the representation scale of half-float. | ||
| # Finetune bert model on specific task and make output more reasonable for hardware. | ||
| # Here is an example. | ||
| class MobileBertFinetune: |
There was a problem hiding this comment.
very cool/useful to have this script as an example, by the way
SS-JIA
left a comment
There was a problem hiding this comment.
LGTM. Please remove the print statement and I will merge.
| def __init__(self, *args) -> None: | ||
| super().__init__(*args) |
There was a problem hiding this comment.
I think __init__ definitions like this can just be omitted
| input1 = node.args[0] | ||
| input_id_1 = self.define_tensor(input1, enn_graph, vals_to_ids) | ||
| input2 = node.args[1] | ||
| input_id_2 = self.define_tensor(input2, enn_graph, vals_to_ids) | ||
|
|
||
| # output | ||
| output_id = self.define_tensor(node, enn_graph, vals_to_ids) | ||
|
|
||
| enn_graph.define_op( | ||
| node.name, "BATCH_MATMUL", [input_id_1, input_id_2], [output_id] | ||
| ) |
There was a problem hiding this comment.
it seems like there's a lot of boilerplate in these visitor definitions. You could package up a few helper subclasses like UnaryOpVisitor, BinaryOpVisitor, etc. that get the operator name ("BATCH_MATMUL" etc.) from a class property similar to the existing target property, and then also accommodate the ones with params by having the helper subclass call self.get_params() (default implementation that returns None on the helper subclass) and pass the result to define_op if it isn't None.
| class LogSoftmax(torch.nn.Module): | ||
| def __init__(self, dim) -> None: | ||
| super().__init__() | ||
| self.module = torch.nn.LogSoftmax(dim=dim) | ||
|
|
||
| def forward(self, x: torch.Tensor) -> torch.Tensor: | ||
| return self.module(x) |
There was a problem hiding this comment.
this looks like it could be deleted and replaced with using torch.nn.LogSoftmax directly
Expands more ops and Verify more models ### Summary - Added for more OPs currently supported by Exynos - Added functionality for models for Showcase - Additional Module for Optimization - Fixed ci issue ### Test plan models="ic3, ic4, resnet18, resnet50, mv3, edsr, dl3, w2l, vit, mobilebert python -m executorch.examples.samsung.aot_compiler --model_name=$model -c E9955 cc @SS-JIA @digantdesai @kimishpatel --------- Signed-off-by: jiseong.oh <jiseong.oh@samsung.com> Co-authored-by: chong-chen <chong.chen@samsung.com> Co-authored-by: jingya-zhang <jingya.zhang@samsung.com> Co-authored-by: xz-linghu <xz.linghu@samsung.com> Co-authored-by: Jonghun Cha <jhbb.cha@samsung.com>
Expands more ops and Verify more models
Summary
Test plan
models="ic3, ic4, resnet18, resnet50, mv3, edsr, dl3, w2l, vit, mobilebert
python -m executorch.examples.samsung.aot_compiler --model_name=$model -c E9955
cc @SS-JIA @digantdesai @kimishpatel