arm-ai-model-optimizer
Arm AI Model Optimizer command-line client and Python API.
This package installs the np command, a client that submits model optimization
work to the Arm AI Model Optimizer service and displays the results. Model optimization
is performed by the service. Profiling jobs can execute on target devices.
Requirements
- Python 3.11 or later
- Network access to the Arm AI Model Optimizer service
- For
np profile, network access from the target device to the configured broker and S3 model storage
Installation
pip install arm-ai-model-optimizer
If you received a wheel file, install that file instead. Replace the quoted placeholder below with the actual path to the supplied wheel:
python -m pip install "<path-to-provided-wheel.whl>"
Getting started
1. Sign in
Issue a credential from the Arm AI Portal, then register it once on this machine:
np auth login <credential>
np auth status
The credential carries the address of the authentication server, so no further
configuration is needed. np auth status reports the state of the stored token.
2. Check the connection
np health ready
3. Run an optimization
np workspace init # create a workspace with a sample project
np models ls # browse registered models
np validate # check run.yaml against the backend
np run # submit the run
np status # follow progress
np report # inspect the results
Run np --help, or np <command> --help, for the full reference.
Commands
| Command | Purpose |
|---|---|
np auth |
Sign in, sign out, inspect the current session |
np workspace init |
Create a workspace and a sample project |
np models / np datasets / np devices |
Register and browse resources |
np projects / np experiments / np jobs |
Organize and inspect work |
np validate / np run / np cancel |
Validate, submit and cancel runs |
np status / np report / np ls |
Follow progress and read results |
np profile / np evaluate |
Measure latency and memory, score accuracy |
np analyze sensitivity |
Inspect layerwise sensitivity |
np visualize |
Generate a model visualization link |
np export |
Export artifacts for deployment or reproduction |
Some commands may be unavailable depending on the features enabled for your deployment.
Profiling and network access
When using np profile, the target device connects to a broker to receive work and
to S3 storage to retrieve models. This is a networked workflow.
The separately supplied executor_runner profiling binaries can also be invoked
directly on a target device without a server connection or authentication. Their
standalone, local-processing description applies to direct execution of those
binaries, not to the full np profile workflow. See the README supplied with the
profiling binaries for supported models, devices and direct-execution instructions.
Python API
The same package provides a Python API. Every command above has a counterpart, with the same behaviour: where the CLI exits non-zero, the call raises.
The example below refers to registered model, device and dataset identifiers. Replace these identifiers with resources available in your deployment.
from netspresso.api import NetsPresso
client = NetsPresso() # same environment and stored credential as the CLI
project = client.projects.create(name="resnet50-rpi5", model="resnet50_pt2_pytorch_static_fp32",
device="raspberry_pi_5_16gb", runtime="executorch", backend="xnnpack",
calibration_dataset="imagenet1k_calib_seed42_n1000", # required for quantization
evaluation_dataset="imagenet1k_eval_seed42_n5000")
experiment = client.experiments.create(project_path=project.project_path, steps="go,gq")
client.run(experiment_path=experiment.experiment_path, wait=True)
report = client.report(experiment_path=experiment.experiment_path)
See the Python API reference in the documentation below for every call.
Documentation
https://developer.arm.com/dev-docs/arm-ai-model-optimizer
License
This software is licensed under the End User License Agreement for Arm AI Model
Optimizer CLI, SDK and Related Software, provided in
Arm AI Model Optimizer CLI SDK - EULA.txt. Read it before you install or use the software.
Third-party components are subject to their respective license terms, as identified in the accompanying third-party notices.
Notices for the open source software this package depends on are provided in
licenses/Open Source Software Notice.md, with the full license texts in licenses/Appendix 1/
and the copyright notices in licenses/Appendix 2 - Copyright Attribution.md.
The software bill of materials (SBOM) is provided in CycloneDX and SPDX formats in sboms/.
In the source distribution, these paths are relative to the top level. In an installed
package, the EULA and the licenses/ directory are under
arm_ai_model_optimizer-<version>.dist-info/licenses/, and the SBOM files are under
arm_ai_model_optimizer-<version>.dist-info/sboms/.
Metadata
Release files for arm-ai-model-optimizer 2.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arm_ai_model_optimizer-2.1.5.tar.gz | 694.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arm_ai_model_optimizer-2.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.9 MB
Release files / arm_ai_model_optimizer-2.1.5.tar.gz
| Download URL | arm_ai_model_optimizer-2.1.5.tar.gz |
|---|---|
| Size | 694.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f465c09f084306094f0f9002f271062328c13ed72f61bd30de65cc25bfa08a32
|
|
BLAKE2b-256 checksum How to use checksums |
b9c72f7f8b2b952b67216408c077a3ac5f9253bc24f9611f345c6e82cc5802a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.8
|
Release files / arm_ai_model_optimizer-2.1.5-py3-none-any.whl
| Download URL | arm_ai_model_optimizer-2.1.5-py3-none-any.whl |
|---|---|
| Size | 1.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ac6e9d6b03ffb63b50ae455f5cbc33a9042593626b659b70a885f89c07fe93e1
|
|
BLAKE2b-256 checksum How to use checksums |
f51905f2a4aa0edd995c6d844153ffddbeda4ec3311d59618b1a4780955b462a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.8
|