From 0b552d2ae47da4fb9c16d2a59d6ebe12c8307771 Mon Sep 17 00:00:00 2001 From: Nathan Bailey Date: Thu, 15 Feb 2024 14:50:58 +0000 Subject: feat: Enable rewrite parameterisation Enables user to provide a toml or default profile to change training settings for rewrite optimization Resolves: MLIA-1004 Signed-off-by: Nathan Bailey Change-Id: I3bf9f44b9a2062fb71ef36eb32c9a69edcc48061 --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index ee53247..e24dded 100644 --- a/README.md +++ b/README.md @@ -209,6 +209,44 @@ mlia optimize ~/models/ds_cnn_large_fp32.tflite \ --rewrite-end MobileNet/fc1/BiasAdd ``` +### optimization Profiles + +Training parameters for rewrites can be specified. + +There are a number of predefined profiles: + +| Name | Batch Size | LR | Show Progress | Steps | LR Schedule | Num Procs | Num Threads | Checkpoints | +| :----------: | :--------: | :--: | :-----------: | :---: | :---------: | :-------: | :---------: | :---------: | +| optimization | 32 | 1e-3 | True | 48000 | "cosine" | 1 | 0 | None | + +```bash +##### An example for using optimization Profiles +mlia optimize ~/models/ds_cnn_large_fp32.tflite \ + --target-profile ethos-u55-256 \ + --optimization-profile optimization \ + --rewrite \ + --dataset input.tfrec \ + --rewrite-target fully_connected \ + --rewrite-start MobileNet/avg_pool/AvgPool \ + --rewrite-end MobileNet/fc1/BiasAdd_ +``` + +#### Custom optimization Profiles + +For the _custom optimization profiles_, the configuration file for a custom +optimization profile is passed as path and needs to conform to the TOML file format. +Each optimization in MLIA has a pre-defined set of parameters which need to be present +in the config file. When using the built-in optimization profiles, the appropriate +toml file is copied to `mlia-output` and can be used to understand what parameters +apply for each optimization. + +*Example:* + +``` bash +# for custom profiles +mlia ops --optimization-profile ~/my_custom_optimization_profile.toml +``` + # Target profiles The targets currently supported are described in the sections below. @@ -275,8 +313,9 @@ For more information, see TOSA Checker's: For the _custom target profiles_, the configuration file for a custom target profile is passed as path and needs to conform to the TOML file format. Each target in MLIA has a pre-defined set of parameters which need to be present -in the config file. The built-in target profiles (in `src/mlia/resources/target_profiles`) -can be used to understand what parameters apply for each target. +in the config file. When using the built-in target profiles, the appropriate +toml file is copied to `mlia-output` and can be used to understand what parameters +apply for each target. *Example:* -- cgit v1.2.1