Skip to content

[CoreAI] Rename manifest packaging to aimodel / aimodelc - #24474

Open
metascroy wants to merge 1 commit into
coreai-expose-compute-unitfrom
coreai-rename-packaging
Open

metascroy wants to merge 1 commit into
coreai-expose-compute-unitfrom
coreai-rename-packaging

Conversation

@metascroy

Copy link
Copy Markdown
Contributor

Renames the Core AI delegate manifest's packaging values so they name the embedded format instead of where it's stored.

Stacked on #24375.

Why

"inline" and "aot_compiled_inline" describe storage (embedded in the .pte), which is the same for both formats. They don't say what is actually different: a portable .aimodel versus AOT-compiled .aimodelc bundles. The runtime also used a third vocabulary, "source" / "aot", in logs and the cache identity. "source" already meant something else there: the bundle copy the runtime writes to the cache for the SDK, which happens for AOT bundles too.

Changes

Where Before After
Manifest packaging "inline" / "aot_compiled_inline" "aimodel" / "aimodelc"
Python AssetPackaging (compiler/preprocess.py) INLINE / AOT_COMPILED_INLINE AIMODEL / AIMODELC
Runtime manifest check (runtime/coreai_manifest.mm) accepts the old values; AOT detected by an aot_compiled_ prefix accepts only the new values; AOT means == "aimodelc"
Specialization log (coreai_load_coordinator.mm) kind=source / kind=aot kind=aimodel / kind=aimodelc
Cache identity (coreai_cache_key.mm) "source" / "aot" "aimodel" / "aimodelc"

Test fixtures, test labels and the README follow the new names. In the README, "source" now only means the copy written for the SDK.

Compatibility

  • Old PTEs: this is a manifest format change. PTEs exported with the old names fail to load with Unsupported Core AI packaging; expected aimodel or aimodelc and must be re-exported.
  • Existing caches: the cache identity changes, so existing bookmarks aren't found and each model specializes again on its first load. Old entries stay on disk unused.

Test plan

  • test_preprocess.py: 25/25 passed, including the real coreai-build AOT test.
  • Native: all 6 CTest targets pass (coreai_host_test, coreai_pte_export_test, coreai_swift_bridge_test, coreai_sdk_source_lifetime_test, coreai_runtime_smoke, coreai_multithread_test). The native fixtures are regenerated and carry packaging: "aimodel".
  • Manual end-to-end with a standalone runner on an M4 Max:
    • Portable PTE: kind=aimodel, outputs match the reference.
    • AOT PTE: first load kind=aimodelc with exact outputs; second load restores from the cache bookmark.
    • A PTE exported before this change is rejected with the error above.
  • ufmt, flake8 and clang-format are clean.

The packaging values "inline" and "aot_compiled_inline" described where the
bundle is stored rather than what it is. Name them after the embedded format
instead: "aimodel" for the portable bundle and "aimodelc" for AOT-compiled
per-architecture bundles.

The runtime's kind names in logs and the cache identity ("source" / "aot")
become "aimodel" / "aimodelc" too, so "source" only refers to the bundle copy
materialized for the SDK. This is a format change: PTEs exported with the old
names are rejected and must be re-exported, and existing cache entries miss
once and are re-specialized.
@metascroy
metascroy requested a review from shoumikhin as a code owner November 3, 2026 00:00
@pytorch-bot

pytorch-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure, 1 Unclassified Failure

As of commit cfdb000 with merge base 822cb60 (image):

NEW FAILURE - The following job has failed:

UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:

  • Core AI / test-coreai / test-coreai (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    RuntimeError: Command bash /Users/runner/work/_temp/exec_script failed with exit code 8

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

This branch was previously deployed

1 inactive deployment
cadence — cfdb0003 Deployed Nov 3, 2026 by metascroy via hifi-op-test / hifi4 #36130
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