Skip to content

Releases: barakugav/executorch-rs

v0.9.0

14 Feb 13:22
3b57f80

Choose a tag to compare

What's Changed

  • Bump Cpp lib to 1.1.0
  • Split Module creation to simple Module::new(path) and a new ModuleBuilder that support all customization and arguments, including new memory_allocator and temp_allocator args introduced in the new Cpp version.
    - let module = Module::from_file_path(path);
    + let module = Module::new(path);
    
    - let module = Module::new(
    -   pte_path,
    -   &[data1_path, data2_path],
    -   Some(LoadMode::File), 
    -   /* event_tracer */ None);
    + let module = ModuleBuilder::new(ptr_path)
    +   .data_files(&[data1_path, data2_path]),
    +   .load_mode(LoadMode::File)
    +   .build();
  • Change list EValue constructors to accept pointer to ArrayRef/BoxedEvalueList rather than a slice/BoxedEvalueList-value.
    The new API comes from an optimization in the Cpp side (pytorch/executorch#13013), which added another indirection but reduced the size of EValue struct.
    Constructing an EValue from &str or &CStr directly is no longer possible, as ArrayRef must be allocated somewhere and borrowed to the EValue. Use ArrayRef::from_cstr or ArrayRef::from_chars and construct the value using the array ref instead.
      // lists of f64, bool and std::ffi::c_char are simply slices within EValue
      let list = [42.0, 17.0, 6.0];
    - let evalue = EValue::new(list.as_slice());
    + let list_ref = ArrayRef::from_slice(list.as_slice);
    + let evalue = EValue::new(&list);
    
    - let evalue = EValue::new(c"hello world!");
    + let chars = ArrayRef::from_cstr(c"hello world!");
    + let evalue = EValue::new(&chars);
    
      // lists of i64, Tensor and optional Tensor are stored in BoxedEvalueList within EValue
      let (evalue1, evalue2, evalue3) = (EValue::new(42), EValue::new(17), EValue::new(6));
      let wrapped_vals = EValuePtrList::new([&evalue1, &evalue2, &evalue3]);
      let mut unwrapped_vals = storage!(i64, (3));
      let list = BoxedEvalueList::new(&wrapped_vals, unwrapped_vals.as_mut()).unwrap();
    - let evalue = EValue::new(list);
    + let evalue = EValue::new(&list);
  • Make DataLoader, MemoryAllocator and NamedDataMap traits instead of structs. In the Cpp side these are all base classes, and classes extending them used to implement AsRef<BaseClass> on the Rust side. Traits are more flexible, and allow for functions that consume self. This change is reverting the opposite change introduced in v0.8.0.
  • Add TensorPtr::copy_of

Full Changelog: v0.8.1...v0.9.0

v0.8.1

29 Nov 14:31
dab3ce1

Choose a tag to compare

What's Changed

  • Bump Cpp lib to 1.0.1, a bug fix release. Linking with 1.0.0 is still possible, but not recommended. In this new version of the Cpp library, negative indexing was fixed, fixing the nano-gpt example which was broken in 1.0.0.

Full Changelog: v0.8.0...v0.8.1

v0.8.0

12 Nov 12:19
c5806b6

Choose a tag to compare

What's Changed

  • Bump the Cpp executorch lib to 1.0.0, as part of it a few building and linking breaking changes are included
    • flatcc static lib moved from {build-dir}/third-party/flatcc_external_project/lib to {build-dir}/third-party/flatcc_ep/lib
    • EXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ON is required if EXECUTORCH_BUILD_EXTENSION_MODULE=ON
  • Add NamedDataMap struct, support reading .ptd files
  • Add FlatTensorDataMap under flat-tensor feature, an implementation for NamedDataMap, see examples/data_map
  • Use more fine grained generics bounds for functions and structs
  • Rename Tensor.as_ptr() -> Tensor.as_data_ptr()
  • Merge Error and CError into a simpler flat enum
  • Mark executorch::platform::pal_init unsafe, it access global variables without synchronization
  • MakeDataLoader a struct instead of trait, implement AsRef<DataLoader> for impls, matches underlying Cpp polymorphism
  • Support overriding platform abstraction level (PAL) of executorch. Can be used to log executorch inner logs to external loggers, for example by using the log crate. Also useful for embedded systems
  • Flatten the sys crate, removing the dedicated module of the cxx bridge
  • Add TensorLayout struct
  • Add a few minor new functions to existing structs, matching the Cpp API

Full Changelog: v0.7.4...v0.8.0

v0.7.4

18 Oct 10:09
cd6af94

Choose a tag to compare

What's Changed

  • Use FfiChar(ffi::c_char) internally to solve trait impl conflicts when c_char is u8 (for example android aarch64)
  • Fix build for arm 32bit platforms (executorch-sys 0.7.3)
  • Add to CI arm/arm64/x86_64/i686/ubuntu/macos/ios/android

Full Changelog: v0.7.3...v0.7.4

executorch-sys/v0.7.3

18 Oct 10:07
cd6af94

Choose a tag to compare

What's Changed

  • Fix build for arm 32bit platforms by correcting EValueStorage layout

Full Changelog: v0.7.2...executorch-sys/v0.7.3

v0.7.3

15 Oct 08:52
4ad5954

Choose a tag to compare

What's Changed

  • Allow ndarray 0.17 by >=0.16.1, <0.18.0

Full Changelog: v0.7.2...v0.7.3

v0.7.2

05 Oct 01:11
ca26f24

Choose a tag to compare

Quick release to fix docs build failure on docsrs.

What's Changed

  • Replace doc_auto_cfg with doc_auto

Full Changelog: v0.7.1...v0.7.2

v0.7.1

02 Oct 14:44
ed83731

Choose a tag to compare

What's Changed

  • Implement Send for Module and TensorPtr
  • Add bindings to executorch-sys to override platform functions (PAL, executorch/runtime/platform/platform.h)
  • Activate data-loader feature if module feature

Full Changelog: v0.7.0...v0.7.1

v0.7.0

12 Sep 13:24
6a61cb3

Choose a tag to compare

What's Changed

  • Bump Cpp executorch to 0.7.0 and add bindings to new functions and arguments
  • Add bindings to all functions in executorch/runtime/platform/platform.h
  • Add logs when errors occur in addition to the returned error code, using pal_emit_log_message in platform.h
  • Check slice bounds against shape and strides when creating tensors

Full Changelog: v0.6.0...v0.7.0

v0.6.0

22 Jul 04:48
4d5b7e1

Choose a tag to compare

What's Changed

  • Bump Cpp executorch to 0.6.0 and add bindings to new functions and arguments
  • Add RawTensor for low level users, avoiding code size overhead of regular Tensor generics
  • Add TensorAccessor, supporting more efficient indexing into a Tensor
  • Require mut self for get_mut Tensor methods
  • Add EXECUTORCH_CPP_VERSION const str to executorch-sys
  • Bump bindgen from 0.71.1 to 0.72.0

Full Changelog: v0.5.0...v0.6.0