Comments (6)
Instead of manually updating the graph signature, you can also try wrapping the code that runs the passes with the following context manager, which will automatically update the signature for you
with ep.graph_module._set_replace_hook(ep.graph_signature.get_replace_hook()):
AddmmToLinearTransform()(ep.graph_module)
Here is an example where we use it: code
But separately, a work item for the executorch team should be to update the passes so that it will do this automatic updating. cc @kimishpatel who wrote the pass
from executorch.
@mhs4670go recently, #3483 was landed that allows backends to specify certain operators to avoid decomposing; this will make it so that the AddmmToLinearTransform()
pass is not necessary as aten.linear
will never be decomposed in the first place.
To see an example of how it works please take a look at the NonDecompTestPartitioner
in op_partitioner_demo.py
. I would recommend going this route instead of using the linear recomposition pass. Please try it out!
cc: @tarun292
from executorch.
@mhs4670go What backend serialization process are you trying to lower the graph to? Is it Vulkan?
from executorch.
@guangy10 Ah, it's internal backend of my company. The graph IR follows this schema. Technically speaking, when the outputs are registered in the circle graph, it refers to the name of the output spec in the exported program, which is addmm
. But the name of the created linear op in the transformation is aten_linear_default
. Then, there is mismatch between them.
So, I think there are two options for this case.
- Update the output spec of the exported program after the transformation.
- Set the name of the linear op to the name of the existing addmm operator during transformation.
constant_prop_pass updates the input spec according to the propagation. But replace_addmm_mm_with_linear doesn't update the spec. So, I wonder that I should manually update the spec.
from executorch.
@SS-JIA @angelayi Thanks for the helps! Both way are very helpful for me.
from executorch.
_set_replace_hook
I did not know about that magic context manager. Yeah when I wrote that pass, I definitely missed this case, but also it was a long time ago so I dont know if we even had graph signature. Will follow up on updating the pass, but I wont be surprised if I forget about it. lol.
from executorch.
Related Issues (20)
- llama model is not fully lowered to ANE (coreml backend)
- Fix bos/eos tokens in bpe tokenizer in c++ HOT 1
- examples/models/llama2 - undefined reference to `pthread_once' HOT 4
- Main requires numpy 1.25 but coremltools only supports up to 1.23 HOT 1
- Failed with qualcomm.scripts.export_example HOT 8
- Crash (native stack) for llama2 demo on Android HOT 4
- Unable to Convert DeepFilterNet to ExecuTorch HOT 11
- Failures/Errors in unit test (with QualComm's AI SDK) HOT 4
- Is there example for running model with Quantization with Vulkan GPU ? HOT 2
- LLAMA Runner with QNN Build Failure in Recent Push HOT 5
- [Mutable Buffer] [Core ML Delegate] Let Core ML Handle Mutable Buffer HOT 3
- Error [[]] attributes are a C23 extension when building with Qualcomm AI Engine Direct HOT 11
- Segmentation Fault when implementing llama/stories110M Android phone deployment HOT 4
- Cross-compiling Executorch SDK for Android HOT 3
- How to export a pretrained model? HOT 1
- The apk downloaded from S3 can not be unzipped HOT 1
- [Android] Set mobile-job workflow as a periodic job HOT 1
- UNSTABLE Build Linux Wheels / pytorch/executorch / upload / manywheel-py3_9-cpu HOT 1
- UNSTABLE Build M1 Wheels / pytorch/executorch / upload / wheel-py3_9-cpu HOT 1
- [coreml][sdk] Add intermediate tensor logging for the coreml
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 executorch.