-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Frontend][TFLite] Batch_MatMul op support #11881
Comments
I'd suggest saving / writing out the tflite model to inspect what actually gets generated in this particular case from the use of math_ops.matmul in the framework. I suspect that produces a matmul operator rather than a batch_matmul operator in the framework , however producing it from the test might be the only way of looking at what is actually being consumed by the frontend . That certainly looks puzzling. |
Ah, came in with this #5510. Perhaps that helps in archeology and identifying the possibly misnamed tests. |
The following transformation seems to unroll all BatchMatMul ops to MatMul: Using the MLIR converter switches from Slice to Split, but still does the unrolling: So as far as I can tell it does not seem possible to generate the BatchMatMul op using the current converter. Maybe the model I referred to was created with an earlier version that did not employ this transformation? |
I was working on adding support for the TFLite op
Batch_MatMul
. When looking at the tests, I was a bit puzzled as to why there was already a test for that operator and why it is passing.https://github.com/apache/tvm/blob/main/tests/python/frontend/tflite/test_forward.py#L726
When I'm trying a model ( https://github.com/huggingface/tflite-android-transformers/blob/master/models_generation/gpt2.py using
distilgpt2
) with the op, I get the expected error:The whole TFLite frontend test file is not quite clear to me. How would I then test that my new operator is converted correctly? It would be great if someone could clarify or add documentation.
@FrozenGene @u99127 @siju-samuel
The text was updated successfully, but these errors were encountered: