Use the CoreML cache as its compilation working directory#161
Draft
MaxHalford wants to merge 1 commit into
Draft
Use the CoreML cache as its compilation working directory#161MaxHalford wants to merge 1 commit into
MaxHalford wants to merge 1 commit into
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com>
Author
|
Disclaimer: This is completely vibe coded PR, following an issue we noticed with @raphaelsty, while installing colgrep in person on my laptop. |
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.
What changed
ModelCacheDirectoryand the processTMPDIRRoot cause
CoreML cold compilation uses
TMPDIRfor intermediate work even when ONNX Runtime has a persistentModelCacheDirectory.In a macOS Seatbelt workspace, ordinary file writability is not sufficient for CoreML's compilation service:
/var/folders/.../T: process writes succeeded, CoreML compilation failed/private/var/folders/.../T: CoreML compilation failed/private/tmp: CoreML compilation failedAfter an external cold compile populated the model cache, sandboxed loads also succeeded. This isolated the failure to CoreML's intermediate compilation path rather than model download, cache lookup, ONNX Runtime loading, repository indexing, or inference.
Why this fix
The configured CoreML cache is already intended to be a stable writable location for compiled model artifacts. Reusing it as CoreML's working directory keeps cold compilation on an accessible path and preserves CoreML execution. There is no CPU fallback.
Validation
cargo test -p colgrep --features coreml --lib(673 passed, 1 ignored)cargo clippy -p colgrep --features coreml --all-targets -- -D warnings--force-gpusmoke test in the failing Seatbelt workspace succeeded on CoreML without an externalTMPDIRoverrideThe implementation and this description were prepared with OpenAI Codex. The commit includes a
Co-authored-bytrailer.