Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23392
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Unclassified FailureAs of commit 61e2774 with merge base 61ec450 ( 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. |
2f63441 to
12fd39f
Compare
dae7df4 to
756e906
Compare
12fd39f to
1beeef8
Compare
|
@claude review this PR |
|
Claude finished @metascroy's task in 2m 41s —— View job The coordinator logic looks correct, but I'd ask for changes: the specialize-error and empty-bookmark paths have no tests, the fake loader carries unused knobs, and a repeated bookmark-save failure leaks one SDK cache entry per load attempt. Detailed reviewPR Review: #23392SummaryThis PR adds Code Quality
Testing
Performance
RecommendationRequest Changes Nothing here is a correctness bug in the coordinator. Before merging I'd ask for the missing error-path tests (specialize error, empty bookmark), the unused fake knobs to be removed or tested, and a decision on the save-failure leak. |
Summary:
Acquire a prepared Core AI model for a selected bundle: restore it from the
persisted bookmark, or materialize the source and specialize it.
- `runtime/coreai_load_coordinator.{h,mm}`: `acquire_bookmark_model` restores
from the persisted bookmark, or on a miss materializes the source and
specializes it with the persistent default SDK cache, then publishes the
new bookmark atomically. Restore errors fail without a source fallback.
Sources and SDK pins are retained across completion.
- Tests: an acquisition-only fake SDK loader
(`runtime/test/coreai_fake_loader.{h,mm}`) lets the coordinator run in
`coreai_host_test` without Swift or CoreAI. The acquisition suite calls
`acquire_bookmark_model` directly and covers cold specialization, warm
restores, restore errors and misses, bookmark-save failures, contention on
one key versus independent keys across processes, and a crash after the
SDK call.
- The backend that uses this lands separately.
- README: the "Asset storage" acquisition flow.
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 acquisition suite) and
`coreai_swift_bridge_test`.
Summary: Avoid retaining redundant staged model bundles once persistent specialization and durable bookmark publication succeed. Preserve the bookmark and return cleanup failures without automatic retries or eviction, keeping warm restoration independent of staging. Tighten acquisition error coverage and test-fixture behavior. Test Plan: All three Core AI CTest suites passed on macOS 27. The source-lifetime regression verified portable and AOT model inference after source deletion, bookmark restoration in fresh processes, and a restore miss after explicit eviction. Native tests covered publication ordering, unsafe staging entries, and cleanup failures preserving durable bookmarks. The full Core AI Python suite passed: 113 tests.
756e906 to
66fd8b0
Compare
1beeef8 to
61e2774
Compare
|
@claude review this code Updated head: Context on the previous findings: a fresh UUID from the fake does not establish that the SDK leaks a distinct entry on every failed bookmark save. A real-SDK experiment found that evicting the first specialization's bookmark invalidated subsequent bookmarks too, consistent with cache reuse, but not a universal guarantee. We intentionally return save errors without automatic retry or blind eviction; a post-rename flush failure can already leave a published bookmark. This revision also removes staged sources only after durable bookmark publication. Cleanup errors are returned while the bookmark remains available, without automatic eviction or retries. Real SDK regression tests on the tested macOS 27 system cover portable and AOT weighted models, live inference after source removal, fresh-process bookmark restoration, and misses after explicit eviction. This is empirical evidence, not a promise covering reboots, OS upgrades, or all devices. The missing acquisition failure-path tests and test-fixture issues were addressed. |
|
Claude finished @metascroy's task in 3m 56s —— View job The earlier findings are fixed, but I'd hold this until one new problem is settled. If staging cleanup fails partway and the SDK later misses, that model can't be loaded again, and nothing in the runtime can clear the damaged entry. Detailed reviewPR Review: #23392SummaryThis PR adds Code Quality
Infrastructure
Testing
RecommendationRequest Changes The partial-cleanup lockout is the only blocker. It makes a model permanently unloadable after one transient filesystem error plus a routine SDK cache miss, and the documented workaround ("explicitly cleared") has no API behind it. The remaining items are minor. |
Acquires a prepared Core AI model for a selected bundle: restore it from the persisted bookmark, or materialize the source and specialize it (
runtime/coreai_load_coordinator.{h,mm}).acquire_bookmark_modelrestores from the persisted bookmark; on a miss it materializes the source, specializes it with the persistent default SDK cache and publishes the new bookmark atomically.runtime/test/coreai_fake_loader.{h,mm}) runs the coordinator incoreai_host_testwithout Swift or CoreAI.acquire_bookmark_modeldirectly: cold specialization, warm restores, restore errors and misses, bookmark-save failures, same-key versus independent-key contention across processes, and a crash after the SDK call.No changes outside
backends/apple/coreai.Stack: 6 of 9, based on #23391. Review only this PR's commit. Next: #23393.
Test plan: built locally for macOS 27.0;
ctest -Nlistscoreai_host_testandcoreai_swift_bridge_test, which the Core AI workflow runs on the macOS 27 runner.lintrunneris clean.