Skip to content

Lower explicit runtime slice sizes in CoreML - #11

Draft
matthargett wants to merge 3 commits into
fix/coreml-dynamic-shape-loweringfrom
fix/coreml-runtime-slice-sizes
Draft

matthargett wants to merge 3 commits into
fix/coreml-dynamic-shape-loweringfrom
fix/coreml-runtime-slice-sizes

Conversation

@matthargett

@matthargett matthargett commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Lower explicit, input-bound named Slice sizes to runtime MIL slice_by_size sizes instead of allocation maxima. Check active bounds before prediction, preserve fixed sizes, and reject unknown/derived labels, unsupported strides and overflowing bounds. Other backends reject named sizes unless they have a runtime lowering.

This stacks on #10. Refreshed against current main, preserving the GraphRecorder importer and the newer shape/gather fixes.

Scope

Names are opaque equality labels, not expressions. This cannot repair exports that have already frozen a shape dependency into a literal maximum. webnn-graph #20 tracks producer-based Slice/Range provenance; the broader API is in upstream #225. Neither is a prerequisite for this deliberately limited lowering.

Validation

  • make test, strict CoreML/dynamic-input Clippy, and make test-coreml pass on the refreshed revision.
  • Regressions cover repeated nonzero sizes, exact selected values, fixed-size counterexamples, active-bound failures, unknown labels and overflow.
  • Static Slice WPT: 20 passed; these are not conformance coverage for the proposed dynamic API.
  • Rustdoc, strict site build and backend-report drift check pass.

Still a draft: the refreshed source has not yet completed a new phone/full-model acceptance run. Earlier device probes and fixed-cache SmolLM runs in #222 do not establish that growing-cache SmolLM is fixed.

@github-actions

Copy link
Copy Markdown

Documentation Build ✅

Documentation builds successfully! 🎉

Preview will be available after merge.

@github-actions

Copy link
Copy Markdown

Documentation Build: passed

MkDocs pages and Rust API docs build successfully.

Preview will be available after merge.

@github-actions

Copy link
Copy Markdown

Documentation Build: passed

MkDocs pages and Rust API docs build successfully.

Preview will be available after merge.

matthargett pushed a commit that referenced this pull request Oct 19, 2026
## Summary

Release 0.6.0: the first release of the WebNN `MLContext` API from
`main`. The 0.5.x releases on crates.io were cut from the `v0.5` branch
and are the earlier converter and loader crate.

- `Cargo.toml`: version `0.5.11` -> `0.6.0` in the package and in both
cargo-c metadata sections; `Cargo.lock` updated for the version bump
only.
- `CHANGELOG.md`: the Unreleased section becomes `[0.6.0]`, with the
entries missing since rustnn#243 added (C/C++ API and Doxygen reference,
CoreML, LiteRT, CANN, WPT harness, TensorRT), six **Breaking** lines
(rustnn#185/rustnn#245, rustnn#246, rustnn#260, rustnn#264, rustnn#266) and three stale statements corrected
(PASS snapshots, the removed spec-mapping page, the `conv2_with_options`
alias that rustnn#264 removed).
- `README.md`, `docs/index.md`, `docs/user-guide/getting-started.md`:
the "not yet published, use the git dependency" text now points at
`rustnn = { version = "0.6", features = [...] }`, with the git line kept
for following `main`.
- `publish.yml`: the release tag must match the `Cargo.toml` version
before publishing. `ci.yml`: the `version-check` job is removed; it
grepped `pyproject.toml` (deleted in #11) and had no tag trigger, so it
never ran. `setup.md` and the workflows README updated accordingly,
including the stale `snapshot-sync.yml` name.
- Removed `.github/workflows/rustnn-gate.yml.orig`, a committed merge
leftover.

## Before tagging

- [x] **webnn-graph release.** `cargo publish --dry-run` fails:
"dependency `webnn-graph` does not specify a version". webnn-graph
`main` is 5 commits past 0.3.0 (rustnn needs the packed 4-bit
SafeTensors commit) and still declares 0.3.0. Bump it (0.4.0; ONNX
support became optional), give it a versioned `webnn-onnx-utils`
dependency (`0.1.1` is published and equals `main`), publish, then
switch both git dependencies in `Cargo.toml` to versions (see the TODO
comment there).
- [ ] Set the changelog date to the tag date, then: merge, tag `v0.6.0`,
create the GitHub release. `publish.yml` publishes; docs.rs builds with
`onnx-runtime`, `trtx-runtime`, `cann-runtime`, `dynamic-inputs`
(trtx-sys and trtx build on docs.rs today). Merge and publish on the
same day, since the docs now describe the crates.io dependency.

## Validation

- `cargo check --features onnx-runtime` on the branch: clean.
- `cargo publish --dry-run`: fails on the unversioned `webnn-graph`
dependency (expected, see above).
- Docs changes are text only; `make test` not run (no Rust code changed
besides the version).

## Documentation

- [x] README, getting started and the landing page describe the
crates.io release.
- [x] `docs/development/setup.md` and `.github/workflows/README.md`
match the workflow changes.
- [x] Operator support unchanged; no rustdoc changes.

This branch has not been deployed

No deployments
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.

1 participant