Skip to content

[CoreAI] Parse the delegate manifest at runtime and run host tests in CI - #23387

Draft
metascroy wants to merge 1 commit into
mainfrom
coreai-v2/01-export-parser
Draft

metascroy wants to merge 1 commit into
mainfrom
coreai-v2/01-export-parser

Conversation

@metascroy

@metascroy metascroy commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Adds the native parser the Core AI runtime uses to read the delegate manifest, and builds and runs the backend's host tests in the Core AI workflow. This is the first of the runtime PRs; it does not add an ExecuTorch delegate yet.

  • Runtime (runtime/coreai_assets.{h,mm}):
    • Parse and validate the manifest for inline source and aot_compiled_inline assets: function, ordered input_names/output_names, the files size map and bundle_digests.
    • Select AOT assets by exact platform and Core AI architecture match, with no fallback.
  • Tests: a Foundation-only coreai_host_test GoogleTest executable (no Swift, no Core AI SDK) for the parser and asset selection. Path and file-map checks are covered because they feed filesystem writes; the manifest is otherwise treated as trusted exporter output.
  • README: the "Runtime" manifest description, AOT architecture selection and "Host Tests".
  • backends/apple/coreai/.clang-format: the root style without its Language: Cpp key, so clang-format also formats the backend's Objective-C headers.
  • Changes outside backends/apple/coreai are CMake and CI only, and nothing changes unless EXECUTORCH_BUILD_COREAI=ON:
    • tools/cmake/preset/default.cmake: add EXECUTORCH_BUILD_COREAI (default OFF).
    • CMakeLists.txt: add the backend subdirectory under that option.
    • .github/workflows/coreai.yml: build backends/apple/coreai/all for macOS 27 with tests on, and run every CTest test the backend registers (--no-tests=error).

Stack: 1 of 9 Core AI runtime PRs, based on main. Next: #23388.

Test plan: built locally for macOS 27.0 (backends/apple/coreai/all, EXECUTORCH_BUILD_TESTS=ON); ctest -N lists coreai_host_test, which the Core AI workflow runs on the macOS 27 runner. lintrunner is clean.

@pytorch-bot

pytorch-bot Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure, 1 Unclassified Failure

As of commit 8bdd47d with merge base 0b3d26d (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:

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 Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 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.

Summary:
Add the native parser the Core AI runtime uses to read the delegate manifest,
and build and run the backend's host tests in the Core AI workflow.

- Runtime (`runtime/coreai_assets.{h,mm}`): parse and validate the manifest
  for `inline` source and `aot_compiled_inline` assets, including the ordered
  I/O names, file sizes and bundle digests, and select AOT assets by exact
  platform and Core AI architecture match with no fallback.
- Tests: a Foundation-only `coreai_host_test` GoogleTest executable (no Swift,
  no Core AI SDK) for the parser and asset selection. Path and file-map checks
  are covered because they feed filesystem writes; the manifest is otherwise
  treated as trusted exporter output.
- README: the "Runtime" manifest description, AOT architecture selection and
  "Host Tests".

Changes outside `backends/apple/coreai` are CMake and CI only, and nothing
changes unless `EXECUTORCH_BUILD_COREAI=ON`:
- `tools/cmake/preset/default.cmake`: add `EXECUTORCH_BUILD_COREAI`
  (default OFF).
- `CMakeLists.txt`: add the backend subdirectory under that option. The host
  test is registered inside the backend when `EXECUTORCH_BUILD_TESTS=ON`.
- `.github/workflows/coreai.yml`: build the backend directory for macOS 27 and
  run every CTest test it registers.

Test Plan:
```
# Local: configure and build only
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_OSX_DEPLOYMENT_TARGET=27.0 -DEXECUTORCH_BUILD_COREAI=ON \
  -DEXECUTORCH_BUILD_TESTS=ON -DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON
cmake --build build --target backends/apple/coreai/all
# CI (macOS 27 runner, .github/workflows/coreai.yml)
ctest --test-dir build/backends/apple/coreai --output-on-failure --no-tests=error
```
CTest runs `coreai_host_test`.

This branch was successfully deployed

1 active deployment
cadence — 8bdd47d1 Deployed Oct 5, 2026 by metascroy via hifi-op-test / hifi4 #31508
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