Skip to content

Commit 0b4de82

Browse files
authored
Add extra logging in CoreML (#13890)
Summary: This diff adds extra logging in CoreML to indicate whether the model in the pte file was pre-compiled. Differential Revision: D81256207
1 parent 5abad6c commit 0b4de82

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

backends/apple/coreml/runtime/delegate/ETCoreMLModelManager.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,14 @@ - (nullable NSURL *)compiledModelURLWithIdentifier:(NSString *)identifier
449449
case ModelAssetType::CompiledModel: {
450450
// The model is already compiled; no further action needed.
451451
// Return the existing model URL.
452+
ETCoreMLLogInfo("The model in the pte file is pre-compiled. Skipping compilation.");
452453
return modelURL;
453454
}
454455

455456
case ModelAssetType::Model: {
456457
// The model is not compiled yet.
457458
// Compile the model at the specified URL with a maximum wait time of 5 minutes.
459+
ETCoreMLLogInfo("The model in the pte file is not pre-compiled. Compiling with a 5 min timeout.");
458460
NSURL *compiledModelURL = [ETCoreMLModelCompiler compileModelAtURL:modelURL
459461
maxWaitTimeInSeconds:(5 * 60)
460462
error:error];
@@ -490,6 +492,7 @@ - (nullable ETCoreMLAsset *)compiledModelAssetWithMetadata:(const ModelMetadata&
490492
error:error];
491493
if (compiledModelURL) {
492494
// Move the compiled model to the asset manager to transfer ownership.
495+
ETCoreMLLogInfo("Storing compiled asset with identifier=%@ in the asset manager.", identifier);
493496
compiledModelAsset = [self.assetManager storeAssetAtURL:compiledModelURL withIdentifier:identifier error:error];
494497
}
495498
}];

0 commit comments

Comments
 (0)