From 92f9a8c366cbddf9610f221f5c644131e842243d Mon Sep 17 00:00:00 2001 From: Scott Roy Date: Tue, 16 Sep 2025 15:40:24 -0700 Subject: [PATCH] Back out "Add extra logging in CoreML (#13890)" (#14353) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Original commit changeset: ae667b071853 Original Phabricator Diff: D81256207 Since the introduction of D80715432, WhatsApp is seeing an increase in model load failures with error code 0x23 (P1948468840). From logs, the underlying issue is something like "Model init failed “model.mlmodelc” couldn’t be moved to “models” because an item with the same name already exists." FB app has also seen an increase in error code 0x23 since 9/5. We are unable to reproduce this error locally, but out of caution we want to revert D80715432 and see if the errors resolve. Since D80715432 landed, we also landed D81256207 to add more logging. To prevent conflicts, we backout in 3 steps: * In diff 1/3, we backout D81256207, which added more logging * In diff 2/3, we backout D80715432, which is the problematic diff we're trying to revert * In diff 3/3, we introduce some of the logging we backed out in diff 1/3 Differential Revision: D82581442 --- backends/apple/coreml/runtime/delegate/ETCoreMLModelManager.mm | 3 --- 1 file changed, 3 deletions(-) diff --git a/backends/apple/coreml/runtime/delegate/ETCoreMLModelManager.mm b/backends/apple/coreml/runtime/delegate/ETCoreMLModelManager.mm index 524ceaf7e28..c27b42566dc 100644 --- a/backends/apple/coreml/runtime/delegate/ETCoreMLModelManager.mm +++ b/backends/apple/coreml/runtime/delegate/ETCoreMLModelManager.mm @@ -449,14 +449,12 @@ - (nullable NSURL *)compiledModelURLWithIdentifier:(NSString *)identifier case ModelAssetType::CompiledModel: { // The model is already compiled; no further action needed. // Return the existing model URL. - ETCoreMLLogInfo("The model in the pte file is pre-compiled. Skipping compilation."); return modelURL; } case ModelAssetType::Model: { // The model is not compiled yet. // Compile the model at the specified URL with a maximum wait time of 5 minutes. - ETCoreMLLogInfo("The model in the pte file is not pre-compiled. Compiling with a 5 min timeout."); NSURL *compiledModelURL = [ETCoreMLModelCompiler compileModelAtURL:modelURL maxWaitTimeInSeconds:(5 * 60) error:error]; @@ -492,7 +490,6 @@ - (nullable ETCoreMLAsset *)compiledModelAssetWithMetadata:(const ModelMetadata& error:error]; if (compiledModelURL) { // Move the compiled model to the asset manager to transfer ownership. - ETCoreMLLogInfo("Storing compiled asset with identifier=%@ in the asset manager.", identifier); compiledModelAsset = [self.assetManager storeAssetAtURL:compiledModelURL withIdentifier:identifier error:error]; } }];