Skip to content

Releases: rustnn/webnn-graph

webnn-graph v0.3.0

04 May 08:30

Choose a tag to compare

[0.3.0] - 2026-05-04

Added

  • Dynamic dimension representation in AST and WG grammar via dyn("name", maxSize) input dims.
  • ONNX conversion support for preserving unresolved dynamic input dimensions in graph metadata.
  • New convert-onnx CLI flag: --experimental-dynamic-inputs (opt-in dynamic input preservation).
  • ONNX converter/operator support improvements:
    • ScatterND
    • Where, Equal, comparison operators, Cos, Sin, TriLu, Tile
    • ConstantOfShape, Range, and additional constant-folding evaluators
  • Built-in constant folding in webnn-graph (--optimize) to reduce dynamic-shape plumbing.
  • Global debug switch for converter diagnostics (--debug).
  • Pre-commit hook setup script and make-based local checks.

Changed

  • ONNX conversion now supports static-lowering + dynamic metadata workflows in one pipeline.
  • Graph parser/serializer now support richer values (including object literals in options).
  • JS/HTML emitters and visualizer now render mixed static/dynamic shapes.
  • Docs expanded and corrected:
    • ONNX lowering behavior
    • Dynamic dimension guidance
    • SmolLM-135M conversion example from Hugging Face

Fixed

  • Multiple ONNX conversion correctness fixes, including:
    • dynamic reshape/expand conversion edge cases
    • shape inflation prevention and post-conversion shape tracking
    • Unsqueeze v14 handling
    • identifier sanitization robustness (including $ prefixes)
    • clippy/robustness cleanup across converter and shape inference

Compatibility

  • Existing static graphs remain supported.
  • Validator/serializer support both graph versions v1 and v2.
  • Dynamic input metadata is experimental and must be enabled with
    --experimental-dynamic-inputs.

0.2.1

28 Dec 17:54
285aa01

Choose a tag to compare

Full Changelog: v0.2.0...0.2.1

v0.2.0: WebNN Text Format and Binary Weights

24 Dec 16:04
48e40c3

Choose a tag to compare

What's New

Features

  • WebNN text format (.webnn) is now the primary format - 10x smaller than JSON, human-readable
  • Binary weights support - Separate weight data from graph structure
    • extract-weights: Extract weights from JSON to binary format with manifest
    • inline-weights: Inline weights back into JSON for round-trip conversion
    • pack-weights, unpack-weights, create-manifest: Low-level weight management
  • Improved serialization - JSON to .webnn conversion no longer includes inline bytes

Improvements

  • Enhanced documentation with complete workflow examples
  • Better separation of concerns: graph structure, weights, and input data
  • Full round-trip support: .webnn ↔ JSON ↔ .webnn
  • Clippy warnings fixed and code formatted
  • Version bumped to 0.2.0 in Cargo.toml

Technical Details

  • All commands now accept both .webnn and .json formats (auto-detected)
  • Weight extraction achieves 93% size reduction for large models
  • Complete test coverage across all modules (50 tests)
  • All tests passing, clippy clean
  • Ready for crates.io publication

Full Changelog: v0.1.0...v0.2.0

v0.1.0 - Initial Release

24 Dec 06:40
0fb4c11

Choose a tag to compare

Initial release of webnn-graph, a DSL for webnn.

  • Basic parsing of .webnn text files or JSON files.
  • Javascript code generator