Skip to content

DistilUSE CoreML variant: forward pass fails on iOS #1164

@msluszniak

Description

@msluszniak

Description

The CoreML build of distiluse-base-multilingual-cased-v2 downloads successfully from HuggingFace but its first forward() invocation fails at the C++ layer on iOS. Surfaces as:

[TextEmbeddings.cpp] Forward pass failed (in: std::shared_ptr<OwningArrayBuffer>
rnexecutorch::models::embeddings::TextEmbeddings::generate(const std::string)).
Ensure the model input is correct.

This is reproducible on both main and PR #1148 (model-registry) — not introduced by the registry refactor.

Reproduction

  1. Run the text-embeddings demo app on the iOS simulator.
  2. Select Multilingual DistilUSE (with { backend: 'coreml' } before this PR; the registry variant was removed in feat(constants)!: switch URLs to v0.9.0 layout + add MODEL_REGISTRY #1148 in response).
  3. Provide single word input to the example! More than one word seems to be working correctly.
  4. Model loads ("Model is ready"), but the inference throws.

Notes

  • The xnnpack variant of the same model works correctly on both iOS and Android, so the tokenizer/input pipeline is fine; the failure is specific to the CoreML .pte.
  • HuggingFace serves the file at the new distiluse_base_multilingual_cased_v2_coreml_fp32.pte path (200 OK); the broken URLs on main (hyphen form) 404 entirely, masking this bug as a download failure rather than a runtime one.
  • PR feat(constants)!: switch URLs to v0.9.0 layout + add MODEL_REGISTRY #1148 drops the CoreML variant from the registry (and removes the deprecated DISTILUSE_BASE_MULTILINGUAL_CASED_V2_COREML export) so users only get the working xnnpack path. Re-add the variant once the CoreML export is fixed.
  • Related: clearer surfacing of native-layer errors in the demo apps is tracked in Native errors thrown via JSI stringify as [object Object] #1150 — once that lands the underlying [object Object] problem we hit while diagnosing this won't recur.

Metadata

Metadata

Assignees

No one assigned

    Labels

    modelIssues related to exporting, improving, fixing ML modelsplatform: iosIssues and tasks related to iOS

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions