Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23394
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 011fb30 with merge base 0b3d26d ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
metascroy
force-pushed
the
coreai-v2/05b-sdk-delegate
branch
from
October 4, 2026 19:48
c14c6ea to
836b175
Compare
metascroy
force-pushed
the
coreai-v2/06-pte-inspect
branch
from
October 4, 2026 19:48
7094d5e to
f69015e
Compare
Summary:
Add a private reader that extracts the Core AI processed buffers from a PTE
without constructing a `Program` or `Method`, so cache maintenance can find a
program's Core AI models without loading it.
- `runtime/coreai_pte.{h,cpp}`: `inspect_coreai_pte(DataLoader&)` returns the
`CoreAIBackend` processed buffers in method/delegate order.
- It always runs the flatbuffer structural verifier, the supported schema
version check and the runtime's existing semantic validator, even when
`ET_ENABLE_PROGRAM_VERIFICATION=0`. It also checks method metadata, unique
method names, exact backend IDs, data ranges, alignment and CPU
accessibility.
- It reuses the existing extended-header parser and verifier rather than
duplicating program parsing. No shared runtime code changes.
- Inline buffers borrow the retained program image. Only external segments
referenced by `CoreAIBackend` delegates are loaded, and they keep their
original `FreeableBuffer` callbacks. Unrelated external payloads and named
data are not loaded.
- `CoreAIPteData` owns the program image and buffers. It is move-only, and the
loader must outlive it.
- Tests: a synthetic PTE builder (`runtime/test/coreai_pte_fixture.{h,mm}`).
The suite covers inline and segmented delegates, method-order routing,
exact backend-ID matching, header formats, load-error propagation and
buffer release on late failure. The PTE is treated as trusted exporter
output, so malformed-PTE robustness is limited to the verifier and version
checks.
- README: "Backend-local PTE Inspection".
No changes outside `backends/apple/coreai`.
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` (adding the PTE inspection suite),
`coreai_swift_bridge_test` and `coreai_runtime_smoke`.
metascroy
force-pushed
the
coreai-v2/05b-sdk-delegate
branch
from
October 5, 2026 03:14
836b175 to
a6f16ff
Compare
metascroy
force-pushed
the
coreai-v2/06-pte-inspect
branch
from
October 5, 2026 03:14
f69015e to
011fb30
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a private reader that extracts Core AI processed buffers from a PTE without constructing a
ProgramorMethod, so cache maintenance can find a program's Core AI models without loading it (runtime/coreai_pte.{h,cpp}).inspect_coreai_pte(DataLoader&)returns theCoreAIBackendprocessed buffers in method/delegate order.ET_ENABLE_PROGRAM_VERIFICATION=0; also checks method metadata, unique method names, exact backend IDs, data ranges, alignment and CPU accessibility. Reuses the existing extended-header parser; no shared runtime code changes.CoreAIBackenddelegates are loaded, keeping their originalFreeableBuffercallbacks; unrelated payloads and named data are not loaded.CoreAIPteDataowns the program image and buffers; it is move-only and the loader must outlive it.runtime/test/coreai_pte_fixture.{h,mm}) and a suite covering inline and segmented delegates, method-order routing, exact backend-ID matching, header formats, load-error propagation and buffer release on late failure. The PTE is treated as trusted exporter output, so malformed-PTE coverage is limited to the verifier and version checks.No changes outside
backends/apple/coreai.Stack: 8 of 9, based on #23393. Review only this PR's commit. Next: #23395.
Test plan: built locally for macOS 27.0;
ctest -Nlistscoreai_host_test,coreai_swift_bridge_testandcoreai_runtime_smoke, which the Core AI workflow runs on the macOS 27 runner.lintrunneris clean.