-
Notifications
You must be signed in to change notification settings - Fork 619
Add more models as part of GA models #12340
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/12340
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New Failures, 1 Cancelled Job, 7 Unrelated FailuresAs of commit 05a4134 with merge base f82c2f0 ( NEW FAILURES - The following jobs have failed:
CANCELLED JOB - The following job was cancelled. Please retry:
BROKEN TRUNK - The following jobs failed but were 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. |
145ff6c
to
3e6d709
Compare
ea28cc8
to
9eccb4d
Compare
8265cc3
to
362b08b
Compare
362b08b
to
e2c3810
Compare
how were these specific models were selected? |
examples/models/bilstm/model.py
Outdated
from ..model_base import EagerModelBase | ||
|
||
|
||
class BidirectionalLSTM(nn.Module): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this just seems like a sample model to contain lstm? Should we instead include something else? @jackzhxng was looking into kokoro that also has lstm. although export is a problem there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I will delete this one. This one's not really useful
The other question I would have is, what would be the goal of adding more models? Do we just want to claim enablement or at the least provide good perf via xnnpack lowering? Because this might end up expanding the work that needs to happen, not 100% sure, but just calling it out. Do agree on covering more vision/object detection |
Thanks @kimishpatel
So, i followed this process. I looked at https://ai-benchmark.com/ranking.html and https://mlcommons.org/benchmarks/inference-mobile/ models, and see if we can enable any delta that we didn't have. However, it was difficult to find the "official" pytorch and/or huggingface implementation. Most of them are TFLite or ONNX implementations. For some, we were able to find pytorch, like EfficientNet-B4, Albert So, I swapped with similar models that already has: Object detection: I swapped Yolov4, SSD-MobileNetV2 with DETR-ResNet50
Mainly inspired by the the ai-benchmark and mlcommons. The goal would be covering specific tasks that we don't have coverage. We won't be adding many models but only representative models within each tasks. There are still a few missing important ones like depth estimation and video super resolution For more and more models in specific tasks, we can expand to leverage optimum-executorch instead. |
faf2916
to
4ba5a0e
Compare
Added 8 new representative models to ExecutorTorch examples: EfficientNet-B4: Image classification with CNN architecture DETR-ResNet50: Object detection using transformer decoder SegFormer-ADE: Semantic segmentation transformer Swin2SR: Super-resolution with Swin transformer ALBERT: Lightweight BERT for NLP tasks TrOCR: Optical character recognition transformer Wav2Vec2: Cross-lingual speech representation learning All models include XNNPACK backend support with appropriate quantization configurations and full CI integration. Test plan: Validate model export and execution with portable backend Test XNNPACK delegation and quantization (with appropriate exclusions) Integrate into CI workflows for automated testing Verify all models perform their intended tasks accurately
4ba5a0e
to
05a4134
Compare
Any specific reason that ai-benchmark and mlcommons are picked as a reference for the model list? Just curious because there are lists from other source |
@mergennachin thanks for the clarification. And I'm happy to know how we can make a joint effort regarding get more task/model coverage, something happening in optimum-et. Some models like EfficientNet, Albert Swin, were added there already.
Looks like the main motivation is to enable ai-benchmark to use ET generated models? I recall in the meeting with them, they mentioned that we are deploying exactly same model across all devices and the expense of switching to different variant of models are high. Given it, would adding similar but not exact same models help with adoption by ai-benchmark?
I recall there are depth estimation models enabled in HF transformers (e.g. DepthAnything). Not sure about video super resolution (HF doesn't have a task classification for image/video super resolution).
What are other tasks we would like to cover for GA? Would it be a good idea if we browse top 1-2 popular models based on the task classification on hugging face hub? |
"efficientnet_b4": XNNPACKOptions(QuantType.STATIC_PER_CHANNEL, True), | ||
"detr_resnet50": XNNPACKOptions(QuantType.STATIC_PER_CHANNEL, True), | ||
"segformer_ade": XNNPACKOptions(QuantType.STATIC_PER_CHANNEL, True), | ||
"swin2sr_2x": XNNPACKOptions(QuantType.STATIC_PER_CHANNEL, True), | ||
"albert": XNNPACKOptions(QuantType.DYNAMIC_PER_CHANNEL, True), | ||
"trocr_handwritten": XNNPACKOptions(QuantType.STATIC_PER_CHANNEL, True), | ||
"wav2vec2": XNNPACKOptions(QuantType.DYNAMIC_PER_CHANNEL, True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mergennachin Are those models calibrated after statically quantized? And I'm curious to know how you decide how to quantize the model (static vs dynamic) and how the quality of the quantized model is validated?
Popularity? Please include other popular lists here so we can try them as well? |
Summary
Added 8 new representative models to ExecutorTorch examples:
All models include XNNPACK backend support with appropriate quantization configurations and full CI integration.
Test plan: