Skip to content

v0.0.27 - LiteRT wasm multithreading for up to 2x faster CPU inference (#300)

Latest

Choose a tag to compare

@github-actions github-actions released this 08 Jul 16:52
1bf3ae5

🌟 Summary

Ultralytics Inference v0.0.27 focuses on faster browser CPU inference with optional LiteRT WebAssembly multithreading, plus stronger CUDA reliability, cleaner postprocessing, better docs, and release/CI hardening πŸš€

πŸ“Š Key Changes

  • LiteRT WASM multithreading for browser inference 🧡
    The @ultralytics/yolo web package now passes an optional threads setting to LiteRT.js and automatically enables WebAssembly multithreading when the page is crossOriginIsolated.

  • Version bump to 0.0.27 across Rust and npm packages πŸ“¦
    Updated ultralytics-inference, ultralytics-inference-web, and @ultralytics/yolo package versions, along with README and CUDA documentation examples.

  • CUDA and TensorRT inference reliability improvements ⚑
    CUDA/TensorRT compute-stream binding was refactored into shared logic, preserving fail-fast behavior when CUDA preprocessing is active to avoid silent CPU fallback issues.

  • New CUDA-focused tests πŸ§ͺ
    Added GPU tests for CUDA preprocessing, model loading, inference, and CUDA/CPU parity with YOLO26 ONNX workflows.

  • Postprocessing cleanup for boxes and keypoints 🎯
    Detection, segmentation, pose, and YOLO26 end-to-end output handling now reuse shared scaling/clipping helpers for more consistent results and easier maintenance.

  • Annotation crash prevention πŸ›‘οΈ
    Label drawing now safely skips empty or invalid text dimensions, preventing runtime panics caused by zero-width or zero-height annotation labels.

  • YOLO26 preprocessing/postprocessing optimizations πŸ¦€
    Several YOLO26 end-to-end shape helpers are now compile-time friendly, and RGB pixel iteration is more explicit and type-safe.

  • Improved build and usage documentation πŸ“š
    Added clearer source-build prerequisites for Linux, macOS, and Windows, updated device option docs to include rocm:0 and xnnpack, and refreshed CUDA guidance.

  • Web classification docs corrected 🌐
    The web README now documents top5names in classification probability outputs.

  • Release and CI workflow hardening πŸ”’
    Releases are now restricted to the main branch, and GitHub Actions dependencies were updated with pinned versions for more reproducible automation.

🎯 Purpose & Impact

  • Faster browser CPU inference where supported πŸš€
    Browser users running LiteRT-backed .tflite models may see significantly better CPU performance, potentially up to about 2x faster in environments that support WebAssembly threads and SharedArrayBuffer.

  • No extra setup for supported browsers βœ…
    Multithreading is enabled automatically when the web page is properly cross-origin isolated. If not supported, LiteRT continues to run single-threaded, keeping compatibility intact.

  • More dependable GPU inference ⚑
    CUDA and TensorRT users benefit from better-tested GPU paths and safer stream handling, reducing the chance of confusing fallback behavior or crashes.

  • More stable visual outputs πŸ–ΌοΈ
    Annotation rendering is more robust, especially for edge cases involving empty labels or problematic fonts.

  • More consistent YOLO26 results handling 🎯
    Shared scaling and clipping logic reduces duplicated code and helps keep detection boxes and pose keypoints consistent across model output formats.

  • Easier installation from source πŸ› οΈ
    Clearer system dependency instructions should help new users avoid common Rust build failures on Linux, macOS, and Windows.

  • Safer, more predictable releases πŸ”
    Restricting release automation to main helps ensure published crates, npm packages, and GitHub tags come from the official release branch.

What's Changed

Full Changelog: v0.0.26...v0.0.27