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

Export T5 (encoder-decoder) to ExecuTorch #36486

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

guangy10
Copy link
Contributor

@guangy10 guangy10 commented Mar 1, 2025

What does this PR do?

This PR enables exporting T5 model to ExecuTorch, which has been asked by many OSS users.
We will need to export T5 encoder and decoder separately (i.e. to separate .pte files when lowering to ExecuTorch), and compose the encoder-decoder for specific task (e.g. summarization) in the ExecuTorch runtime. In this PR, I'm demonstrating the impl in python.

The T5 encoder is exported with "encoder_sequence_length" dim being dynamic. The decoder is exported with "encoder_sequence_length_dim" dim being dynamic and with cache support.

Tests:
RUN_SLOW=1 pytest tests/models/t5/test_modeling_t5.py -s -v -k test_export

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@ArthurZucker @amyeroberts @qubvel

@guangy10 guangy10 marked this pull request as ready for review March 1, 2025 01:51
@guangy10 guangy10 mentioned this pull request Mar 1, 2025
31 tasks
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

Successfully merging this pull request may close these issues.

1 participant