Skip to content

Enable T5 and similar models#30

Closed
guangy10 wants to merge 1 commit intohuggingface:mainfrom
guangy10:t5_executorch
Closed

Enable T5 and similar models#30
guangy10 wants to merge 1 commit intohuggingface:mainfrom
guangy10:t5_executorch

Conversation

@guangy10
Copy link
Collaborator

@guangy10 guangy10 commented Mar 5, 2025

This PR enables T5 and similar models e2e to ExecuTorch.

Setup:

executorch            0.6.0a0+84273f4
torch                 2.7.0.dev20250131
transformers          4.50.0.dev0        /Users/guangyang/transformers

Test:
RUN_SLOW=1 pytest tests/models/test_modeling_t5.py -s -v

============================================================================================= test session starts =============================================================================================
platform darwin -- Python 3.11.11, pytest-8.3.4, pluggy-1.5.0 -- /Users/guangyang/miniconda3/envs/executorch/bin/python
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/Users/guangyang/optimum-executorch/.hypothesis/examples'))
rootdir: /Users/guangyang/optimum-executorch
configfile: pyproject.toml
plugins: rerunfailures-15.0, hypothesis-6.126.0, xdist-3.6.1
collecting ... 
collected 2 items

tests/models/test_modeling_t5.py::ExecuTorchModelIntegrationTest::test_t5_export import
/Users/guangyang/miniconda3/envs/executorch/lib/python3.11/site-packages/executorch/exir/emit/_emitter.py:1592: UserWarning: Mutation on a buffer in the model is detected. ExecuTorch assumes buffers that are mutated in the graph have a meaningless initial state, only the shape and dtype will be serialized, unless a pass which sets meta["et_init_buffer"] to True such as InitializedMutableBufferPass is run.
  warnings.warn(
PASSED
tests/models/test_modeling_t5.py::ExecuTorchModelIntegrationTest::test_t5_summarization No ExecuTorch files were found for google-t5/t5-small, setting `export=True` to convert the model to the ExecuTorch IR.
[program.cpp:136] InternalConsistency verification requested but not available
[program.cpp:136] InternalConsistency verification requested but not available
PASSED

============================================================================================== warnings summary ===============================================================================================
================================================================================= 2 passed, 227 warnings in 142.02s (0:02:22) =================================================================================

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@guangy10
Copy link
Collaborator Author

Squeeze more enabled models (encoder-only, decoder-only, encoder-decoder, etc.) to this PR for CI testing only. I will publish a new PR with the updated doc/instructions shortly.

@guangy10 guangy10 force-pushed the t5_executorch branch 3 times, most recently from 91c7664 to decb795 Compare March 19, 2025 18:58
@guangy10
Copy link
Collaborator Author

Moving to #36

@guangy10 guangy10 closed this Mar 19, 2025
@guangy10 guangy10 deleted the t5_executorch branch March 19, 2025 21:19
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.

2 participants