Repository navigation
Complete from-scratch rewrite targeting ExecuTorch 1.6.0 and Ruby >= 3.2.
Highlights
- Precompiled platform gems for
x86_64-linux,aarch64-linux, andarm64-darwinbundling the official ExecuTorch 1.6.0 shared SDK (XNNPACK, optimized & quantized kernels, CoreML/MLX on Apple Silicon) —gem install executorchworks out of the box with no Python, CMake, or Buck2 required. - Direct Ruby C API native extension (dropped Rice; zero runtime gem dependencies) backed by a
noexceptC++17 core and strict symbol visibility (Init_executorchonly). - Concurrency & zero-copy I/O: releases the GVL (
rb_thread_call_without_gvl) during module load, method load, and execution with per-method thread safety; supports zero-copyIO::Buffer(Tensor.from_buffer/#to_buffer) and pre-allocatedout:output reuse.
Breaking Changes
- Replaced
Executorch::ModelwithExecutorch::Module(Module.open,Module.from_bytes,#call,#forward,#execute,#meta,#load_method,#unload_method,#close). - Canonical tensor dtype symbols are now explicit-width (
:float32,:float64,:float16,:bfloat16,:uint8,:int8,:int16,:uint16,:int32,:uint32,:int64,:uint64,:bool). Short aliases (:float,:double,:int,:long, etc.) remain accepted on input. - Raised minimum Ruby version to
>= 3.2.0. - Removed
ricedependency and leaked internal methods (_original_to_a,Tensor.create,Tensor.from_array,NATIVE_VERSION,NativeError).
Added
- Support for all 13 numeric/boolean dtypes, 0-D scalar tensors (
Tensor#item), non-contiguous /NHWCdim_ordernormalization, value equality (Tensor#==),Tensor.zeros/ones/full,Tensor.from_bytes/#to_bytes, and optionalNumo::NArray/Torch::Tensoradapters. Module.opendefaults to:mmap(supportingPathname, allLoadModes, and external.ptddata_files), plusModule.from_bytes(BufferDataLoader) andMethodMeta/TensorInfointrospection.- Native memory pressure reporting (
dsize+rb_gc_adjust_memory_usage),GC.compactsafety, and deterministic#close/ block-formModule.open. - Runtime introspection (
Executorch.backends,.kernel_count,.num_threads,.num_threads=,.executorch_version), PAL initialization, and thread-local PAL error log capture attached to typedExecutorch::Errorsubclasses.
Full Changelog: https://github.com/benngarcia/executorch-ruby/blob/v1.0.0/CHANGELOG.md