Add kwarg example inputs to eager model base (#5765)
Summary:
For situations where the forward has non-position arguments, such as https://github.com/pytorch/torchtune/blob/3c450ef5f1fbe8237f899e942fd5222491a47ca7/torchtune/modules/transformer.py#L519
PR chain:
- **YOU ARE HERE ~>** [Add kwarg example inputs to eager model base](https://github.com/pytorch/executorch/pull/5765)
- [Llama2 model cleanup](https://github.com/pytorch/executorch/pull/5859)
- [Accept model type parameter in export_llama](https://github.com/pytorch/executorch/pull/5910)
- [Export TorchTune llama3_2_vision in ET](https://github.com/pytorch/executorch/pull/5911)
- [Add et version of TorchTune MHA for swapping with custom op](https://github.com/pytorch/executorch/pull/5912)
Pull Request resolved: https://github.com/pytorch/executorch/pull/5765
Test Plan:
Exported Stories110M model.
```
wget "https://huggingface.co/karpathy/tinyllamas/resolve/main/stories110M.pt"
echo '{"dim": 768, "multiple_of": 32, "n_heads": 12, "n_layers": 12, "norm_eps": 1e-05, "vocab_size": 32000}' > params.json
python -m examples.models.llama2.export_llama -c stories110M.pt -p params.json -X -kv
```
Reviewed By: tarun292
Differential Revision: D64027696
Pulled By: dvorjackz
fbshipit-source-id: 15ecfb458c6194159140d4c601e5443a2e524fdc J
Jack Zhang committed
5fc56627de23f1755868d562a3dbffdedfa508b2
Parent: 0ce221e
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 10/9/2024, 9:56:25 PM