Skip to content
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

Support vision transformers #18

Open
guangy10 opened this issue Feb 5, 2025 · 2 comments
Open

Support vision transformers #18

guangy10 opened this issue Feb 5, 2025 · 2 comments
Assignees

Comments

@guangy10
Copy link
Collaborator

guangy10 commented Feb 5, 2025

Following PR #35124, we will add support for vision transformer models that are suitable for on-device deployment

@guangy10 guangy10 self-assigned this Feb 5, 2025
@johnsutor
Copy link

What is the timeline for this? Is there any way I can contribute?

@guangy10
Copy link
Collaborator Author

@johnsutor I think we will prioritize to get the key features implemented first so that users can have a good experience to publish .pte models, and load cached one from hub. For connecting the exportable vision models to optimum, it will have to wait until after it. However, it would be super nice if you would like to contribute!

Here are what you need in order to contribute:

  1. Register new tasks for the vision models under https://github.com/huggingface/optimum-executorch/tree/main/optimum/exporters/executorch/tasks, similar to causal_lm for "text-genertion" task.
  2. Modify the existing xnnpack recipe as needed, e.g. https://github.com/huggingface/optimum-executorch/blob/main/optimum/exporters/executorch/recipes/xnnpack.py#L78, the lowering to .pte should just work
  3. To run the .pte model using ExecuTorch runtime via pybind, you will need to implement a new modeling class similar to ExecuTorchModelForCausalLM for the vision tasks.

With step 1 & 2, you will be able to generate the pte models. Step 3, inference, can be done separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants