Skip to content

[CoreAI] Persist raw bookmarks - #23389

Draft
metascroy wants to merge 1 commit into
coreai-v2/02-filesystemfrom
coreai-v2/03a-bookmarks
Draft

metascroy wants to merge 1 commit into
coreai-v2/02-filesystemfrom
coreai-v2/03a-bookmarks

Conversation

@metascroy

@metascroy metascroy commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Persists the raw SDK bookmark for a selected Core AI bundle, so later loads can restore a specialized model without re-reading the payload (runtime/coreai_bookmarks.{h,mm}).

  • Store raw opaque bookmarks (at most 8 MiB) with atomic publication.
  • Keys include the bundle digest, platform, architecture and persistence policy, but not function bindings or delivery location.
  • Per-key OS locks coordinate threads and processes; independent keys proceed in parallel.
  • SDK acquisition and cache removal are not included here.
  • Tests: the bookmark suite in coreai_host_test, including a cross-process lock test that spawns child processes.
  • README: the "Asset storage" key derivation, bookmark bound and locking text.

No changes outside backends/apple/coreai.

Stack: 3 of 9, based on #23388. Review only this PR's commit. Next: #23390.

Test plan: built locally for macOS 27.0; 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/23389

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

❌ 5 Cancelled Jobs, 2 Pending

As of commit 68a8b17 with merge base 0b3d26d (image):

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

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
Summary:
Persist the raw SDK bookmark for a selected Core AI bundle, so later loads can
restore a specialized model without re-reading the payload.

- Bookmarks (`runtime/coreai_bookmarks.{h,mm}`): store raw opaque bookmarks
  (at most 8 MiB) with atomic publication. Keys include the bundle digest,
  platform, architecture and persistence policy, but not function bindings or
  delivery location. Per-key OS locks coordinate threads and processes.
- SDK acquisition and cache removal are not included here.
- README: the "Asset storage" key derivation, bookmark bound and locking text.

Trust model: the application owns the assets root and is trusted not to modify
it while the backend uses it.

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`, which adds the bookmark suite, including a
cross-process lock test that spawns child processes.

This branch was successfully deployed

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