Releases: barakugav/executorch-rs
Releases · barakugav/executorch-rs
v0.9.0
What's Changed
- Bump Cpp lib to 1.1.0
- Split Module creation to simple
Module::new(path)and a newModuleBuilderthat support all customization and arguments, including newmemory_allocatorandtemp_allocatorargs 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&stror&CStrdirectly is no longer possible, asArrayRefmust be allocated somewhere and borrowed to the EValue. UseArrayRef::from_cstrorArrayRef::from_charsand 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,MemoryAllocatorandNamedDataMaptraits instead of structs. In the Cpp side these are all base classes, and classes extending them used to implementAsRef<BaseClass>on the Rust side. Traits are more flexible, and allow for functions that consumeself. This change is reverting the opposite change introduced inv0.8.0. - Add
TensorPtr::copy_of
Full Changelog: v0.8.1...v0.9.0
v0.8.1
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-gptexample which was broken in 1.0.0.
Full Changelog: v0.8.0...v0.8.1
v0.8.0
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
flatccstatic lib moved from{build-dir}/third-party/flatcc_external_project/libto{build-dir}/third-party/flatcc_ep/libEXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP=ONis required ifEXECUTORCH_BUILD_EXTENSION_MODULE=ON
- Add
NamedDataMapstruct, support reading.ptdfiles - Add
FlatTensorDataMapunderflat-tensorfeature, an implementation forNamedDataMap, seeexamples/data_map - Use more fine grained generics bounds for functions and structs
- Rename
Tensor.as_ptr()->Tensor.as_data_ptr() - Merge
ErrorandCErrorinto a simpler flat enum - Mark
executorch::platform::pal_initunsafe, it access global variables without synchronization - Make
DataLoadera struct instead of trait, implementAsRef<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
logcrate. Also useful for embedded systems - Flatten the sys crate, removing the dedicated module of the cxx bridge
- Add
TensorLayoutstruct - Add a few minor new functions to existing structs, matching the Cpp API
Full Changelog: v0.7.4...v0.8.0
v0.7.4
What's Changed
- Use
FfiChar(ffi::c_char)internally to solve trait impl conflicts whenc_charisu8(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
What's Changed
- Fix build for arm 32bit platforms by correcting
EValueStoragelayout
Full Changelog: v0.7.2...executorch-sys/v0.7.3
v0.7.3
v0.7.2
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
What's Changed
- Implement
SendforModuleandTensorPtr - 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
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_messageinplatform.h - Check slice bounds against shape and strides when creating tensors
Full Changelog: v0.6.0...v0.7.0
v0.6.0
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