eIQ Neutron SDK

Neutron conversion tool converts a TFLite model into a format compatible with Neutron‑based platforms. It can also be used to profile a model by running simulated NPU performance analysis.

This guide covers how to:

  • Install the Neutron package

  • Use the tool from the command-line interface

  • See results of performance analysis

If you’re working with a model type other than TFLite, please refer to the Conversion and Quantization guide for instructions on how to prepare it.

Installation

The Neutron conversion tool is distributed as a Python package hosted on a custom eIQ PyPI repository. A standard pip install won’t find it, since pip looks only in the default PyPI repository. To make the package discoverable, you need to configure pip to search the additional repository first. You can do that with the following commands:

python -m pip config --user set global.index https://eiq.nxp.com/repository
python -m pip config --user set global.index-url  https://eiq.nxp.com/repository
python -m pip config --user set global.trusted-host eiq.nxp.com
python -m pip config --user set global.extra-index-url https://pypi.org/simple
python -m pip config --user set global.find-links https://eiq.nxp.com/repository/

Now it is possible to download neutron package using pip

!python -m pip install eiq-neutron-sdk

Usage

Once the eiq-neutron-sdk package is installed, you can run it from the command line as a Python module. This section walks through the basic usage for converting TFLite models so they can be deployed on Neutron‑based platforms.

First, let’s prepare some model we want to convert.

from pathlib import Path
import requests

# Change this if you have your own model.
model_path = Path("my_path_to_tflite_model.tflite")
# Alternatively download example model.
example_model_url = "https://eiq.nxp.com/training-materials/_misc/models/mobilenet_v3-small_224_1.0_uint8.tflite"

with open(model_path, "wb") as f:
    response = requests.get(
        url=example_model_url
    )
    f.write(response.content)

    if response.status_code != 200:
        print(f"Failed to download model: {response.content}")
    else:
        print(f"Model downloaded and saved to {model_path} file.")

The simplest way to run the Neutron conversion is to provide the model you want to convert along with the target platform you’re converting it for.

python -m eiq_neutron_sdk.neutron_converter.converter --input $model_path --target imxrt700

The converted model will be saved in the same directory as the input model.

To explore additional conversion options the tool supports, you can check its help:

python -m eiq_neutron_sdk.neutron_converter.converter --help

Profiling statistics

The tool can also estimate model performance during the conversion process. To display this performance estimate, run the conversion command with the following arguments:

python -m eiq_neutron_sdk.neutron_converter.converter --input $model_path --target imxrt700 --dump-statistics