Skip to content

Support SmolLM shape tensors in CoreML - #223

Open
matthargett wants to merge 23 commits into
rustnn:mainfrom
rebeckerspecialties:fix/coreml-smollm-shape
Open

Support SmolLM shape tensors in CoreML#223
matthargett wants to merge 23 commits into
rustnn:mainfrom
rebeckerspecialties:fix/coreml-smollm-shape

Conversation

@matthargett

@matthargett matthargett commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • lower internal shape nodes to MIL shape
  • infer and preserve shape-tensor rank and type through imported unsqueeze nodes
  • cast integer where conditions to uniquely named MIL bool values
  • verify exact CoreML predictions for shape -> unsqueeze (int64 and uint32 readback) and zero/nonzero integer masks

This completes the first three items in #222. The SmolLM compiler pass now reaches the dynamic attention_mask input-signature mismatch tracked there.

Validation

  • M4, Rust 1.97.0: make fmt-check, make lint, and strict Clippy with coreml-runtime,dynamic-inputs pass
  • Rust library tests: 357 default; 364 with coreml-runtime; 371 with coreml-runtime,dynamic-inputs; all pass
  • TensorRT option-operand consumer regression test passes
  • full CoreML WPT at 04cd4a830e26add75d385f28d95a080600b5d70f: 2,460 passed, 41 expected skips, 20 existing negative-index scatter failures. Results match a clean main control case-for-case
  • make docs-backend-ops-check passes
  • earlier M4 SmolLM-135M validation: compilation advances from unsupported shape and duplicate MIL values to Model input 'attention_mask' has a different shape than its corresponding parameter to main.

The public builder/interchange shape dtype remains int64; the uint32 test uses an explicit cast. This does not implement #225's proposed dynamic-shape API. A reduced ranged shape -> unsqueeze probe still reproduces the input-signature mismatch tracked in #222; the passing numerical tests use fixed dimensions and repeated CPU-only predictions.

Retain option-operand tracking and tensor identity validation from main, preserve shape and integer condition lowering, and resolve local lint failures.
Preserve the resample2d and CANN changes from main alongside shape import and integer-mask lowering. Check native MIL shape types and exact integer readback and select results on CoreML.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants