Skip to content

Commit

Permalink
2024-06-08 nightly release (9068baf)
Browse files Browse the repository at this point in the history
  • Loading branch information
pytorchbot committed Jun 8, 2024
1 parent a824303 commit 92073eb
Show file tree
Hide file tree
Showing 222 changed files with 5,500 additions and 2,168 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
paths:
- .ci/docker/**
- .github/workflows/android.yml
- build/build_android_library.sh
- build/test_android_ci.sh
- install_requirements.sh
- examples/demo-apps/android/**
- extension/android/**
Expand Down Expand Up @@ -45,6 +47,8 @@ jobs:
BUILD_TOOL=${{ matrix.build-tool }}
# Setup MacOS dependencies as there is no Docker support on MacOS atm
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
# Build Android library
bash build/build_android_library.sh
# Build Android demo app
bash build/test_android_ci.sh
Expand All @@ -62,8 +66,8 @@ jobs:
cp cmake-out-android-x86_64/lib/*.a artifacts-to-be-uploaded/x86_64/
cp cmake-out-android-x86_64/extension/android/*.so artifacts-to-be-uploaded/x86_64/
# Copyp AAR to S3
cp build_aar/executorch.aar artifacts-to-be-uploaded/
cp build_aar/executorch-llama.aar artifacts-to-be-uploaded/
cp executorch.aar artifacts-to-be-uploaded/
cp executorch-llama.aar artifacts-to-be-uploaded/
# Upload the app and its test suite to S3 so that they can be downloaded by the test job
upload-artifacts:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ jobs:
install_arm
# Test tosa_reference flow
PYTHON_EXECUTABLE=python bash backends/arm/test/run_tosa_reference.sh
# Run arm unit tests
pytest -c /dev/null -v -n auto --cov=./ --cov-report=xml backends/arm/test
test-coreml-delegate:
name: test-coreml-delegate
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@
[submodule "backends/vulkan/third-party/Vulkan-Headers"]
path = backends/vulkan/third-party/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers
[submodule "third-party/lm-evaluation-harness"]
path = third-party/lm-evaluation-harness
url = https://github.com/EleutherAI/lm-evaluation-harness
branch = v0.4.1
[submodule "kernels/optimized/third-party/eigen"]
path = kernels/optimized/third-party/eigen
url = https://gitlab.com/libeigen/eigen.git
Expand Down
43 changes: 28 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,47 +37,60 @@ We recommend using the latest release tag from the
executorch
├── backends # Backend delegate implementations.
├── build # Utilities for managing the build system.
├── bundled_program # Utilities for attaching reference inputs and outputs to models.
├── codegen # Tooling to autogenerate bindings between kernels and the runtime.
├── configurations
├── docs # Static docs tooling
├── docs # Static docs tooling.
├── examples # Examples of various user flows, such as model export, delegates, and runtime execution.
├── exir # Ahead of time library, model capture and lowering apis.
├── exir # Ahead-of-time library: model capture and lowering APIs.
| ├── _serialize # Serialize final export artifact.
| ├── backend # Backend delegate ahead of time APIs
| ├── capture # Program capture.
| ├── dialects # Op sets for various dialects in the export process.
| ├── emit # Conversion from ExportedProgram to ExecuTorch execution instructions.
| ├── operator # Operator node manipulation utilities.
| ├── passes # Built-in compiler passes.
| ├── program # Export artifacts.
| ├── serde # Graph module
serialization/deserialization.
| ├── verification # IR verification.
├── extension # Extensions built on top of the runtime.
| ├── aten_util
| ├── android # ExecuTorch wrappers for Android apps.
| ├── apple # ExecuTorch wrappers for iOS apps.
| ├── aten_util # Converts to and from PyTorch ATen types.
| ├── data_loader # 1st party data loader implementations.
| ├── evalue_util # Helpers for working with EValue objects.
| ├── gguf_util # Tools to convert from the GGUF format.
| ├── kernel_util # Helpers for registering kernels.
| ├── memory_allocator # 1st party memory allocator implementations.
| ├── pybindings # Python api for executorch runtime.
| ├── module # A simplified C++ wrapper for the runtime.
| ├── parallel # C++ threadpool integration.
| ├── pybindings # Python API for executorch runtime.
| ├── pytree # C++ and Python flattening and unflattening lib for pytrees.
| ├── testing_util
| ├── runner_util # Helpers for writing C++ PTE-execution
tools.
| ├── testing_util # Helpers for writing C++ tests.
| ├── training # Experimental libraries for on-device training
├── kernels # 1st party kernel implementations.
| ├── aten
| ├── optimized
| ├── portable # Reference implementations of ATen operators.
| ├── prim_ops # Special ops used in executorch runtime for control flow and symbolic primitives.
| ├── quantized
├── profiler # Utilities for profiling.
├── runtime # Core cpp runtime
| ├── backend # Backend delegate runtime APIs
| ├── core # Core structures used across all levels of the runtime
├── profiler # Utilities for profiling runtime execution.
├── runtime # Core C++ runtime.
| ├── backend # Backend delegate runtime APIs.
| ├── core # Core structures used across all levels of the runtime.
| ├── executor # Model loading, initalization, and execution.
| ├── kernel # Kernel registration and management.
| ├── platform # Layer between architecture specific code and user calls.
├── schema # ExecuTorch program definition
| ├── platform # Layer between architecture specific code and portable C++.
├── schema # ExecuTorch PTE file format flatbuffer
schemas.
├── scripts # Utility scripts for size management, dependency management, etc.
├── sdk # Model profiling, debugging, and introspection.
├── shim # Compatibility layer between OSS and Internal builds
├── test # Broad scoped end2end tests
├── third-party # Third-party dependencies
├── util
├── test # Broad scoped end-to-end tests.
├── third-party # Third-party dependencies.
├── util # Various helpers and scripts.
```

## License
Expand Down
2 changes: 1 addition & 1 deletion backends/apple/coreml/compiler/coreml_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def save_model_debug_info(model_debug_info: ModelDebugInfo, model_dir_path: Path
def preprocess_model(
mlmodel: ct.models.MLModel, model_type: MODEL_TYPE
) -> PreprocessResult:
identifier = str(uuid.uuid4())
identifier = "executorch_" + str(uuid.uuid4())
dir_path: Path = Path("tmp") / identifier
model_dir_path: Path = dir_path / "lowered_module"
model_spec: ct.proto.Model_pb2 = mlmodel.get_spec()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ NS_ASSUME_NONNULL_BEGIN
///
/// @param error On failure, error is filled with the failure information.
/// @retval `YES` is the assets are purged otherwise `NO`.
- (BOOL)purge:(NSError* __autoreleasing*)error;
- (BOOL)purgeAndReturnError:(NSError* __autoreleasing*)error;

/// The estimated size of the assets store. The returned value might not correct if the asset
/// directory is tampered externally.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ - (BOOL)_purge:(NSError * __autoreleasing *)error {
return static_cast<BOOL>(status);
}

- (BOOL)purge:(NSError * __autoreleasing *)error {
- (BOOL)purgeAndReturnError:(NSError * __autoreleasing *)error {
__block BOOL result = 0;
dispatch_sync(self.syncQueue, ^{
result = [self _purge:error];
Expand Down
7 changes: 5 additions & 2 deletions backends/apple/coreml/runtime/delegate/ETCoreMLModelManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ __attribute__((objc_subclassing_restricted))
/// @retval `YES` if the model was pre-warmed otherwise `NO`.
- (BOOL)prewarmModelWithHandle:(ModelHandle*)handle error:(NSError* __autoreleasing*)error;

/// The `ETCoreMLAssetManager` instance used to manage models cache.
@property (strong, readonly, nonatomic) ETCoreMLAssetManager* assetManager;
/// Purges model cache.
///
/// @param error On failure, error is filled with the failure information.
/// @retval `YES` if the cache is purged otherwise `NO`.
- (BOOL)purgeModelsCacheAndReturnError:(NSError* __autoreleasing*)error;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ @interface ETCoreMLModelManager () {
}

@property (nonatomic, readonly, strong) NSFileManager *fileManager;
@property (strong, readonly, nonatomic) ETCoreMLAssetManager* assetManager;
@property (nonatomic, readonly, strong) NSMutableDictionary<NSValue *, id<ETCoreMLModelExecutor>> *handleToExecutorMap;
@property (nonatomic, readonly, strong) NSMapTable<NSString *, dispatch_queue_t> *modelIdentifierToLoadingQueueMap;
@property (nonatomic, readonly, strong) NSMutableDictionary<NSString *, ETCoreMLAsset *> *modelIdentifierToPrewarmedAssetMap;
Expand Down Expand Up @@ -832,4 +833,8 @@ - (BOOL)unloadModelWithHandle:(ModelHandle *)handle {
return result;
}

- (BOOL)purgeModelsCacheAndReturnError:(NSError *__autoreleasing *)error {
return [self.assetManager purgeAndReturnError:error];
}

@end
Loading

0 comments on commit 92073eb

Please sign in to comment.