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

Add config system to export_llama #9367

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

Add config system to export_llama #9367

wants to merge 1 commit into from

Conversation

iseeyuan
Copy link
Contributor

Summary

The configuration system in export_llama is limited

  • only via cli command. There's no python API. We cannot export an arbitrary nn.Module
  • the cli args are complicated. It's hard for users to get what can be configured

Add yaml file option for export_llama configuration.

  • Move all default values from command line args to config/default.yaml
  • Add --config option to load user defined configuration yaml file
  • To keep it backward compatible, allow cli args override the configs in the yaml file

Test plan

Reference run:

python3 -m examples.models.llama.export_llama -c stories110M.pt -p params.json -d fp32 -n tinyllama_xnnpack+custom_fp32_main.pte -kv -X --xnnpack-extended-ops -qmode 8da4w -G 128 --use_sdpa_with_kv_cache --output-dir tmp

With config:

python3 -m examples.models.llama.export_llama --config examples/models/llama/config/examples/stories.yaml

Those two commands should provide the same .pte file and used_config.yaml

Copy link

pytorch-bot bot commented Mar 18, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9367

Note: Links to docs will display an error until the docs builds have been completed.

❌ 18 New Failures, 2 Cancelled Jobs, 3 Unrelated Failures

As of commit bd471d2 with merge base f789df2 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 18, 2025
@iseeyuan
Copy link
Contributor Author

@pytorchbot label "topic: not user facing"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants