Skip to content

Qualcomm AI Engine Direct - Separate model class into model_family + model_id - #24762

Open
qti-mmadhava wants to merge 3 commits into
pytorch:mainfrom
CodeLinaro:dev1/mmadhava/model_class_refactor
Open

qti-mmadhava wants to merge 3 commits into
pytorch:mainfrom
CodeLinaro:dev1/mmadhava/model_class_refactor

Conversation

@qti-mmadhava

Copy link
Copy Markdown
Contributor

Summary

  • Split the legacy combined base.model_class selector into:
    • base.model_family for architecture and export-path
      selection.
    • base.model_id for specific model selection, checkpoint download and artifact
      naming.
  • Add model identity resolution and validation:
    • Infer a family from known model IDs.
    • model_family and model_id are mutually exclusive.
    • base.params required for every model_id, including legacy model_class that resolves to an id.
    • Reject mixing legacy model_class with either new field.
  • Update Llama export, CLI parsing, DictConfig compatibility,
    model loading, and documentation to use the new identity fields.
  • Add coverage for config resolution, CLI compatibility, model
    routing, checkpoint download selection, checkpoint override
    behavior, and legacy OmegaConf input.
  • Default artifact names use model_id, or model_family when no model_id is selected. Legacy model_class=static_llama now defaults to llama3_2.pte instead of static_llama.pte.

This is a follow up for RFC #20402

Test plan

  python -m unittest \
    executorch.examples.models.llama.config.test_llm_config \
    executorch.examples.models.llama.tests.test_export_llama_lib
  python -m extension.llm.export.export_llm \
    base.model_id=qwen3_0_6b \
    base.params=examples/models/qwen3/config/0_6b_config.json \
    model.use_kv_cache=false \
    export.max_seq_length=4 \
    export.max_context_length=4 \
    export.output_dir=/tmp \
    export.output_name=qwen3_model_id
 python -m extension.llm.export.export_llm \
   base.model_family=llama3_2 \
   base.params=/path/to/Llama-3.2-1B-Instruct/original/params.json \
   base.checkpoint=/path/to/Llama-3.2-1B-Instruct/original/consolidated.00.pth \
   model.use_kv_cache=false \
   export.max_seq_length=4 \
   export.max_context_length=4 \
   export.output_dir=/tmp \
   export.output_name=llama3_2_1b_family

cc @psiddh @JacobSzwejbka @digantdesai

@pytorch-bot

pytorch-bot Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⚠️ 28 Awaiting Approval

As of commit e221b7a with merge base f2564fb (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

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

@meta-cla meta-cla 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 Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

This branch has not been deployed

No deployments
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant