Hailo-8 AI Software Suite Commands

From RidgeRun Developer Wiki
< Hailo‎ | Hailo-8
Revision as of 18:15, 7 February 2025 by Spalli (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)





Introduction

After installing the Hailo AI Software Suite (if you don't have Hailo AI Software Suite installed, you must follow Hailo AI Software Suite Installation before to proceed with this wiki)and entering the Hailo virtual environment, you can begin interacting with the Hailo platform by executing a series of commands. This wiki provides information on the available Hailo commands to help you get started.

hailo fw-update

The fw-update subcommand updates the firmware on Hailo flash-based devices.

Basic Usage

hailortcli fw-update [OPTIONS] <firmware-file-path>
<firmware-file-path>: The path to the firmware binary file (required).

Key Options

  • -h, --help: Displays help information.
  • --skip-reset: Skips the device reset after the firmware update.
  • -s, --device-id <TEXT>: Targets a specific device by ID (use `*` for all devices).
  • --bdf <TEXT:BDF>: Targets a device by its Bus-Device-Function (BDF) address.
  • --ip <TEXT:IPV4>: Targets a device by IP address.

This command provides flexible options to target devices via ID, BDF, or IP.

hailo ssb-update

The ssb-update subcommand updates the second stage bootloader (SSB) on Hailo flash-based devices.

Basic Usage

hailortcli ssb-update [OPTIONS] <file_path>
<file_path>: The path to the second stage bootloader binary file (required).

Key Options

  • -h, --help: Displays help information.
  • -s, --device-id <TEXT>: Targets a specific device by ID (use `*` for all devices).
  • --bdf <TEXT:BDF>: Targets a device by its Bus-Device-Function (BDF) address.
  • --ip <TEXT:IPV4>: Targets a device by IP address.

This command provides flexible options to update the SSB on devices using ID, BDF, or IP.

hailo fw-config

The fw-config subcommand is a user firmware configuration tool used for reading, writing, and serializing firmware configurations on Hailo devices.

Basic Usage

hailortcli fw-config [OPTIONS] SUBCOMMAND

Key Options

  • -h, --help: Displays help information.

Subcommands

  • read: Reads firmware configuration from the device.
  • write: Writes firmware configuration to the device.
  • serialize: Serializes firmware configuration JSON to a binary file.

This command allows users to manage firmware configurations by reading, writing, or converting configuration data.

hailo udp-rate-limiter

The udp-rate-limiter subcommand is used to control and limit the UDP rate for Hailo devices.

Basic Usage

hailortcli udp-rate-limiter [OPTIONS] SUBCOMMAND

Key Options

  • -h, --help: Displays help information.

Subcommands

  • set: Sets a custom UDP rate limit.
  • reset: Resets the UDP rate limit to default.
  • autoset: Automatically sets the UDP rate limit based on an existing HEF (Hailo Executable File).

This command provides options to manage the UDP data rate by setting, resetting, or auto-configuring the limit based on a HEF file.

hailo fw-control

The fw-control subcommand provides useful firmware control operations for Hailo devices.

Basic Usage

hailortcli fw-control [OPTIONS] SUBCOMMAND

Key Options

  • -h, --help: Displays help information.

Subcommands

  • identify: Displays general information about the device.
  • reset: Resets the device.
  • test-memories: Runs a test of the chip's memories.
  • action-list: Downloads action list data for the runtime profiler.

This command offers various options to control device firmware by retrieving information, resetting the device, testing memory, or downloading action list data.

hailo fw-logger

The fw-logger subcommand downloads firmware logs to a specified file.

Basic Usage

hailortcli fw-logger [OPTIONS] <output_file>
<output_file>: The file path to write the binary firmware log into (required).

Key Options

  • -h, --help: Displays help information.
  • --overwrite: Indicates whether to overwrite the output file if it exists.
  • --stdout: Writes the output to stdout instead of a file.
  • --continuous: Writes logs to file/stdout continuously until the process is terminated.

Device Options

  • -s, --device-id <TEXT>...: Targets a specific device by ID (use `*` for all devices).
  • --bdf <TEXT:BDF>...: Targets a device by its Bus-Device-Function (BDF) address.
  • --ip <TEXT:IPV4>...: Targets a device by IP address.

This command allows for downloading firmware logs from devices, with flexible options for output handling and device targeting.

hailo scan

The scan subcommand displays all available Hailo devices connected to the system.

Basic Usage

hailortcli scan [OPTIONS]

Key Options

  • -h, --help: Displays help information.

Device Options

  • --interface-ip <TEXT:IPV4>: Scans a specific interface by its IP address (excludes `--interface` option).
  • --interface <TEXT>: Scans a specific interface by name (excludes `--interface-ip` option).

This command provides an easy way to identify and list all Hailo devices available for use, with the option to specify the scanning interface.

hailo sensor-config

The sensor-config subcommand configures sensors attached to the Hailo chip.

Basic Usage

hailortcli sensor-config [OPTIONS] SUBCOMMAND

Key Options

  • -h, --help: Displays help information.

Subcommands

  • store-sensor-config: Stores a sensor configuration to a Hailo device.
  • load-config: Loads the sensor configuration stored in the specified section.
  • reset-sensor: Loads the reset configuration stored in the specified section.
  • get-sections-info: Retrieves information about the flash sections.
  • get-config: Dumps the configuration stored in the specified section into a CSV file.
  • store_isp_config: Stores an ISP configuration to the Hailo device in section index 7.
  • set_generic_slave: Sets a custom I2C slave that can be used.

This command provides a comprehensive set of tools for managing sensor configurations, including storing, loading, resetting, and retrieving configuration details.

hailo run

The run subcommand executes a compiled network on the Hailo chip.

Basic Usage

hailortcli run [OPTIONS] [hef] [SUBCOMMAND]

Positionals

  • hef <TEXT:(FILE) OR (DIR)>: Path to an existing HEF file or directory (required).

Key Options

  • -h, --help: Displays help information.
  • -c, --frames-count <UINT:POSITIVE>: Specifies the number of frames to run (excludes `--time-to-run` and `--net-batch-size`).
  • -t, --time-to-run <UINT:POSITIVE>: Specifies the time to run in seconds (excludes `--frames-count`).
  • --batch-size <UINT:NONNEGATIVE>: Sets the inference batch size for the whole network group.
  • --net-batch-size <TEXT>: Sets the inference batch size per network; requires specifying network names and sizes.
  • --power-mode <ENUM:{performance,ultra_performance}>: Sets the core power mode for PCIE (ignored otherwise).
  • -m, --mode <ENUM:{streaming,hw_only}>: Specifies the inference mode.
  • --csv <TEXT>: Outputs results as CSV to the specified path.
  • --input-files <TEXT>: Specifies input file paths for network inputs.
  • --measure-latency: Measures network latency.
  • --show-progress, --dont-show-progress <BOOLEAN>: Toggles progress display during inference.

Device Options

  • -s, --device-id <TEXT>: Targets a specific device by ID (use `*` for all devices).
  • --bdf <TEXT:BDF>: Targets a device by its Bus-Device-Function (BDF) address.
  • --ip <TEXT:IPV4>: Targets a device by IP address.

VDevice Options

  • --device-count <UINT:POSITIVE>: Specifies the count of VDevices.
  • --multi-process-service: Enables multi-process service for VDevices.

Transformations

  • --quantized <BOOLEAN>: Indicates whether data is already quantized (deprecated).
  • --user-format-type <ENUM:{auto,uint8,uint16,float32}>: Specifies the host data type.

Measure Power/Current

  • --sampling-period <UINT>: Specifies the sampling period.
  • --averaging-factor <UINT>: Specifies the averaging factor.

Subcommands

  • measure-stats: Performs pipeline statistics measurements.
  • collect-runtime-data: Collects runtime data for use by the Profiler.

This command is designed for running networks with extensive configuration options for performance measurement and device targeting.

hailo benchmark

The benchmark subcommand measures the basic performance of a compiled network on the Hailo chip.

Basic Usage

hailortcli benchmark [OPTIONS] hef

Positionals

  • hef <TEXT:FILE>: Path to the HEF file to load (required).

Key Options

  • -h, --help: Displays help information.
  • -t, --time-to-run <UINT:POSITIVE>: Sets the measurement time in seconds (default is 15).
  • --no-power <BOOLEAN>: Skips power measurement if set to true (default is false).
  • --batch-size <UINT>: Specifies the inference batch size (default is 1).
  • --power-mode <ENUM:{performance,ultra_performance}>: Sets the core power mode for PCIE (ignored otherwise).
  • --input-files <TEXT>: Specifies input file paths. Supports single and multiple inputs.
  • --csv <TEXT>: Outputs results as CSV to the specified path.

Device Options

  • -s, --device-id <TEXT>: Targets a specific device by ID (use `*` for all devices).
  • --bdf <TEXT:BDF>: Targets a device by its Bus-Device-Function (BDF) address.
  • --ip <TEXT:IPV4>: Targets a device by IP address.

VDevice Options

  • --device-count <UINT:POSITIVE>: Specifies the count of VDevices.
  • --multi-process-service: Enables multi-process service for VDevices.
  • --group-id <TEXT>: Specifies the VDevice group ID.

Measure Power Options

  • --sampling-period <UINT>: Sets the sampling period for power measurements.
  • --averaging-factor <UINT>: Sets the averaging factor for power measurements.

This command is designed for benchmarking performance metrics of compiled networks with flexible options for device targeting and input configuration.

hailo monitor

The monitor subcommand provides a monitoring interface for networks, displaying information about running networks.

Basic Usage

hailortcli monitor [OPTIONS]

Key Options

  • -h, --help: Displays help information.

Usage Note

To enable monitoring, set the environment variable HAILO_MONITOR to 1 in the application process.

This command allows users to view the status and information of currently running networks, enhancing visibility during operations.

hailo parse-hef

The parse-hef subcommand extracts and displays information about the components of a HEF (Hailo Execution Framework) file.

Basic Usage

 hailortcli parse-hef [OPTIONS] hef
<hef>: An existing HEF file or directory path (required).

Key Options

  • -h, --help: Displays help information.
  • --parse-streams [0]: Option to parse stream information (default is disabled).
  • --parse-vstreams [1]: Option to parse virtual stream information (default is enabled).

This command is useful for obtaining detailed insights into the structure and components of a HEF file, aiding in network configuration and analysis.

hailo measure-power

The measure-power subcommand measures the power consumption of the Hailo device.

Basic Usage

hailortcli measure-power [OPTIONS]

Key Options

  • -h, --help: Displays help information.
  • --duration UINT:POSITIVE: Specifies the duration in seconds for measuring power consumption (required).
  • --sampling-period UINT:{140, 204, 332, 588, 1100, 2116, 4156, 8244} [1100]: Sets the sampling period for measurements (default is 1100).
  • --averaging-factor UINT:{1, 4, 16, 64, 128, 256, 512, 1024} [256]: Defines the averaging factor for measurement data (default is 256).
  • --dvm ENUM:{AUTO,VDD_CORE, VDD_IO, MIPI_AVDD, MIPI_AVDD_H, USB_AVDD_IO, VDD_TOP, USB_AVDD_IO_HV, AVDD_H, SDIO_VDD_IO, OVERCURRENT_PROTECTION} [AUTO]: Specifies the DVM type to be measured (default is AUTO).
  • --type ENUM:{AUTO,SHUNT_VOLTAGE,BUS_VOLTAGE,POWER,CURRENT} [AUTO]: Determines the type of power measurement to be performed (default is AUTO).

Device Options

  • -s, --device-id TEXT ...: Device ID as returned from the `hailortcli scan` command. Use space to separate multiple devices or use '*' for all devices connected to the machine.
  • --bdf TEXT:BDF ...: Device BDF in the format [<domain>]:<bus>:<device>.<func>. Supports multiple BDFs and '*' for all devices.
  • --ip TEXT:IPV4 ...: Specifies the IP address of the target device.

This command enables users to assess the power consumption of the Hailo device, aiding in performance optimization and power management strategies.

hailo tutorial

The tutorial subcommand provides a command-line interface to launch a Jupyter notebook for Hailo tutorials.

Basic Usage

hailo tutorial [OPTIONS]

Key Options

  • -h, --help: Displays help information.
  • --ip IP: Specifies an IP address for the Jupyter notebook. Use 0.0.0.0 to accept remote connections (default is None).
  • --port PORT: Specifies a port for the Jupyter notebook. The default is set to Automatic.

This command is useful for users who want to explore Hailo's functionalities and capabilities through interactive tutorials in a Jupyter notebook environment.

hailo analyze-noise

The analyze-noise subcommand is designed to analyze noise in quantized HAR files, providing insights based on the specified dataset.

Basic Usage

hailo analyze-noise [OPTIONS] har_path
<har_path>: Path to the quantized HAR (Hailo Archive) file (required).

Key Options

  • -h, --help: Displays help information.
  • --data-path DATA_PATH: Specifies the path to the dataset for analysis (required).
  • --batch-size BATCH_SIZE: Sets the batch size for analysis; the default is 1.
  • --data-count DATA_COUNT: Limits the maximum number of images used for analysis; by default, all examples in the dataset are used.
  • --analyze-mode {simple,advanced}: Chooses the analysis mode, either simple or advanced.

This command is useful for users aiming to assess the noise characteristics of their HAR files, facilitating better optimization and tuning of their models.

hailo compiler

The compiler subcommand compiles a Hailo Archive (HAR) file for a specified hardware architecture, allowing for the preparation of models for deployment.

Basic Usage

hailo compiler [OPTIONS] har_path
<har_path>: Path to the HAR file of the model to compile (required).

Key Options

  • -h, --help: Displays help information.
  • --hw-arch {hailo8, hailo8r, hailo8l, hailo15h, hailo15m, hailo10h}: Specifies the hardware architecture to be used for compilation.
  • --model-script MODEL_SCRIPT: Provides the path to a custom model script to use during the compilation process.
  • --output-dir OUTPUT_DIR: Designates the directory where the HEF (Hailo Execution Framework) file will be saved; defaults to the current directory.
  • --auto-model-script AUTO_MODEL_SCRIPT: Sets the path to save the auto-generated model script.
  • --output-har-path OUTPUT_HAR_PATH: Specifies the path where the compiled model will be written.

This command is essential for users looking to prepare and optimize their models for deployment on Hailo hardware, facilitating an efficient transition from model development to execution.

hailo params-csv

The params-csv subcommand extracts parameters from a Hailo Archive (HAR) file and saves them in a specified CSV format.

Basic Usage

hailo params-csv [OPTIONS] har_path
<har_path>: Path to the HAR file (required).

Key Options

  • -h, --help: Displays help information.
  • --csv-path CSV_PATH: Specifies the path where the CSV file containing the extracted parameters will be saved.

This command is useful for users who need to analyze or document the parameters of a model, providing an easy way to export essential data for further examination or reporting.

hailo parser

The parser subcommand is used to parse model files from different source formats, such as TensorFlow and ONNX, facilitating the conversion and preparation of models for Hailo hardware.

Basic Usage

 hailo parser [OPTIONS] {tf,onnx} ...

Key Options

  • -h, --help: Displays help information.

Source Format

  • {tf,onnx}: Specifies the source format of the model to parse.
  • tf: TensorFlow parser for models in TensorFlow format.
  • onnx: ONNX parser for models in ONNX format.

This command is essential for users looking to import models from popular frameworks into the Hailo ecosystem, ensuring compatibility and optimal performance on Hailo devices.

hailo optimize

The optimize subcommand is designed to optimize a network model and its parameters, primarily for quantization, using a pre-processed calibration set.

Basic Usage

hailo optimize [OPTIONS] har_path
<har_path>: Path to the HAR (Hailo Archive) file of the model to be optimized (required).

Key Options

  • -h, --help: Displays help information.
  • --hw-arch {hailo8,hailo8r,hailo8l,hailo15h,hailo15m,hailo10h}: Specifies the hardware architecture to be used.
  • --calib-set-path CALIBRATION_SET_PATH: Path to the calibration set .npy file containing a numpy array of pre-processed images.
  • --use-random-calib-set: Indicates that random data will be used for calibration instead of a specified dataset.
  • --full-precision-only: Runs full-precision optimizations only, applying model modifications without quantization.
  • --calib-random-max CALIB_RANDOM_MAX: Maximum value for the random calibration set, affecting the datatype.
  • --use-random-weights: Option to generate random weights for the model.
  • --work-dir WORK_DIR: Directory for dumping quantization debug outputs.
  • --model-script MODEL_SCRIPT: Path to a model script for modifying the model prior to quantization.
  • --output-har-path OUTPUT_HAR_PATH: Specifies the path for saving the quantized HAR file.
  • --compilation-only-har: Saves a reduced size HAR file containing only compilation-related data.

This command is crucial for users aiming to enhance model performance by optimizing quantization parameters, thereby ensuring efficient execution on Hailo devices.

hailo tb

The tb subcommand facilitates the use of TensorBoard for visualizing TensorFlow model performance and metrics.

Basic Usage

hailo tb [OPTIONS] model_path
<model_path>: Path to the TensorFlow model (required).

Key Options

  • -h, --help: Displays help information.
  • -c, --ckpt: Indicates that the model file is a checkpoint (ckpt), not a HAR (Hailo Archive).
  • -p PORT, --port PORT: Specifies the port for the TensorBoard web server (default is random).
  • -f, --frozen: Indicates that the model file is a frozen graph.

This command is essential for users who want to analyze and visualize their TensorFlow models' performance metrics, making it easier to identify improvements and optimizations during development.

hailo visualizer

The visualizer subcommand generates a visual representation of a network described in a Hailo Archive (HAR) file, aiding in understanding the network architecture.

Basic Usage

hailo visualizer [OPTIONS] har_path
<har_path>: Path to the HAR file containing the network description (required).

Key Options

  • -h, --help: Displays help information.
  • --out-path OUT_PATH: Specifies the output path for the SVG file (default is **<net_name>.svg**).
  • -v, --verbose: Provides additional details in the created SVG.
  • --no-browser: Prevents the automatic opening of the browser after generating the visualization.

This command is useful for users who want to visualize their network architecture, making it easier to comprehend the structure and flow of data within the model.

hailo har

The har subcommand provides utilities for managing Hailo Archive (HAR) files, allowing users to extract contents, retrieve information, and compare different archive files.

Basic Usage

hailo har [OPTIONS] {extract,info,diff}

Subcommands

  • extract: Extracts the files from the specified HAR file. When using flags, specific files can be extracted; otherwise, all files will be extracted.
  • info: Displays information about the specified Hailo archive, providing insights into its contents and structure.
  • diff: Compares two Hailo archive files, highlighting the differences between them.

Key Options

  • -h, --help: Displays help information for the HAR command.

This command is essential for users needing to manipulate HAR files, whether for extracting model parameters, analyzing archive contents, or comparing different model versions.

hailo join

The join subcommand facilitates the merging of two Hailo Archive (HAR) files, allowing users to combine models into a single network for streamlined processing.

Basic Usage

hailo join [OPTIONS] har_path1 har_path2
<har_path1>: Path to the HAR file for the first model (required).
<har_path2>: Path to the HAR file for the second model (required).

Key Options

  • -h, --help: Displays help information.
  • --join-action {none,auto_join_inputs,auto_chain_networks}: Specifies the action to perform while joining:
  • none: Joins the graphs without any connections.
  • auto_join_inputs: Automatically detects and combines inputs if both networks have a single input of the same shape.
  • auto_chain_networks: Automatically connects the output of one model to the input of another if both have single outputs and inputs of the same shape.
  • --scope-name1 SCOPE_NAME1: Scope name for all layers of the first model.
  • --scope-name2 SCOPE_NAME2: Scope name for all layers of the second model.
  • --output-path OUTPUT_PATH: Specifies the path to save the HAR of the joined model.

This command is useful for users who need to create complex networks by merging existing models, enhancing flexibility in model management and deployment.

hailo har-onnx-rt

The har-onnx-rt subcommand converts a compiled Hailo Archive (HAR) file into an ONNX runtime model, enabling interoperability with ONNX-compatible frameworks.

Basic Usage

hailo har-onnx-rt [OPTIONS] har_path
<har_path>: Path to the compiled HAR file (required).

Key Options

  • -h, --help: Displays help information.
  • --out-onnx-path OUT_ONNX_PATH: Specifies the path where the converted ONNX runtime model will be saved.

This command is beneficial for users who want to leverage the Hailo model in ONNX environments, facilitating model deployment across different platforms and enhancing compatibility with various machine learning frameworks.

hailo runtime-profiler

The runtime-profiler subcommand analyzes performance data from a Hailo runtime trace file, generating a detailed report that visualizes the runtime behavior of models.

Basic Usage

hailo runtime-profiler [OPTIONS] input_file
<input_file>: Path to the Hailo trace file generated using hailortcli (required).

Key Options

  • -h, --help: Displays help information.
  • --output-path OUTPUT_PATH: Specifies the path where the output HTML report will be saved (default is runtime_report.html).

This command is essential for users who want to assess the efficiency and performance of their models during execution, providing insights that can guide optimizations and improvements in model design and deployment.

hailo dfc-studio

The dfc-studio subcommand is a minimal interface for managing and utilizing Hailo's DataFlow Compiler (DFC) features.

Basic Usage

hailo dfc-studio [OPTIONS]

Key Options

  • -h, --help: Displays help information.

This command serves as a starting point for users looking to access the Hailo DFC environment, although additional functionality and options may be available through other subcommands within the Hailo command-line tools.

hailortcli run2

The run2 subcommand in hailortcli is used to execute networks on Hailo devices, with options for performance measurement and multi-device configuration.

Basic Usage

hailortcli run2 [OPTIONS] [SUBCOMMAND]

Key Options

  • -h, --help: Displays help information.
  • -t, --time-to-run [SECONDS]: Specifies how long to run the inference (default is 5 seconds).
  • -m, --mode [full_sync, full_async, raw_sync, raw_async]: Sets the inference mode (default: full_sync).
  • -j, --json [PATH]: Saves statistics as a JSON file to the specified path.
  • --scheduling-algorithm [round_robin, none]: Defines the scheduling algorithm to use.

VDevice Options

  • -s, --device-id [DEVICE_ID]: Specifies the device ID(s) for inference.
  • --device-count [COUNT]: Sets the number of devices (VDevices) to use (default is 1).
  • --group-id [GROUP_ID]: Sets the VDevice group ID.
  • --multi-process-service: Enables multi-process service for VDevices.

Measurement Options

  • --measure-power: Measures power consumption (excludes current measurement).
  • --measure-current: Measures current consumption (excludes power measurement).
  • --measure-latency: Measures network latency on the NN core.
  • --measure-overall-latency: Measures overall latency.
  • --measure-temp: Measures chip temperature.

Subcommands

  • measure-fw-actions, collect-runtime-data: Collects runtime data for profiling.
  • set-net: Sets the network for inference.

This command provides users with tools to execute and measure network performance across single or multiple devices, making it highly useful for benchmarking and analyzing performance in real-time.