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

SmolLM is ExecuTorch Compatible #34879

Open
Tracked by #32253
guangy10 opened this issue Nov 22, 2024 · 3 comments
Open
Tracked by #32253

SmolLM is ExecuTorch Compatible #34879

guangy10 opened this issue Nov 22, 2024 · 3 comments
Labels
ExecuTorch Feature request Request for a new feature

Comments

@guangy10
Copy link
Contributor

guangy10 commented Nov 22, 2024

Feature request

Feature request

Enable SmolLM to "Export to ExecuTorch" workflow.

Instructions

Instructions of how to enable this model for ExecuTorch:

  1. Export the model to ExportIR. For LLM, to run with performance, typically you will need to export the model with cache. Llama3 and Llama2 are ExecuTorch compatible #34101 is a reference of how to export and validate the model. Note that you may run into some export issue and it may require fixes in the modeling code.
  2. Lower the model to ExecuTorch (to generate a .pte file). You will need to clone the github repo and create a recipe to lower the model. For example lowering the to XNNPACK is the simplest way. See the example code here: https://github.com/pytorch/executorch/blob/release/0.4/extension/export_util/export_hf_model.py#L89L106
  3. Run the model with ExecuTorch. You can follow these instructions to build and run the executor runtime for llama: https://github.com/pytorch/executorch/tree/release/0.4/examples/models/llama2#step-4-run-on-your-computer-to-validate

(Optional) Congrats! Once you complete step 1-3, you will be able to run the model on a host machine. Now if you would to go further like making the model faster, smaller, cheaper for your model use-case, you can create more complicated recipes with quantizations and delegations for different HW accelerators. You can find more tutorials on our website, for example to optimize and run the model with Core ML on Apple’s platform: https://pytorch.org/executorch/stable/build-run-coreml.html

Motivation

See details in #32253

Your contribution

TBD

@guangy10 guangy10 added the Feature request Request for a new feature label Nov 22, 2024
@guangy10 guangy10 mentioned this issue Nov 22, 2024
26 tasks
@merronmuche
Copy link

Hi,

I’m eager to contribute to this issue. As a beginner, I’d appreciate the opportunity to get involved.

@guangy10
Copy link
Contributor Author

Hi,

I’m eager to contribute to this issue. As a beginner, I’d appreciate the opportunity to get involved.

@merronmuche I updated this task to include the instructions. Let me know if it’s helpful for you to get started.

@merronmuche
Copy link

merronmuche commented Nov 25, 2024

Hi,
I’m eager to contribute to this issue. As a beginner, I’d appreciate the opportunity to get involved.

@merronmuche I updated this task to include the instructions. Let me know if it’s helpful for you to get started.

@guangy10,
Thank you for the quick response! I’ll let you know after reviewing the instructions you provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExecuTorch Feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants