Open your model workspace in VS Code

You can use the Visual Studio Code (VS Code) extension for Arm ML Inference Advisor (MLIA) to move from a CLI view to using MLIA within your IDE. The extension also supports visualizing models in Model Explorer, with data from MLIA overlaid onto the model graphs.

If you completed the earlier steps on the same local machine, do the following:

  1. Open VS Code on the local machine.
  2. Select File > Open Folder.
  3. Open your ml-model-artifacts directory.

If you completed the earlier steps on a remote Linux machine, connect to the machine using VS Code Remote - SSH . With Remote - SSH, the MLIA extension and analysis run on the remote host. Use the same SSH connection details that you used for the CLI steps:

  1. Install the Remote - SSH extension on the machine running VS Code.
  2. Open the Command Palette with Ctrl+Shift+P on Windows or Linux, or Cmd+Shift+P on macOS.
  3. Select Remote-SSH: Add New SSH Host.
  4. Enter your existing SSH command, including any key-file option such as -i. For example, enter ssh ubuntu@YOUR_HOST, replacing the user and host with your connection details.
  5. Select an SSH configuration file when prompted.

Image Alt Text:VS Code prompts for an SSH connection command. Enter the user and host of the Linux machine containing your models.Add your Linux host to Remote - SSH

  1. Run Remote-SSH: Connect to Host and select the host that you added. Confirm that the VS Code status bar shows your SSH host.
  2. In the connected window, select File > Open Folder and open the remote ml-model-artifacts directory.

After opening the ml-model-artifacts directory, install the MLIA extension and prepare its environment.

Install the MLIA extension and prepare its environment

Download the .vsix package from the latest MLIA VS Code extension release to your local machine.

In VS Code:

  1. If you’re using a remote Linux machine, connect to it with Remote - SSH first.
  2. Open the Extensions view.
  3. Select the … menu at the top of the view, then select Install from VSIX….
  4. Select the .vsix file that you downloaded to your local machine and install it.

If you’re connected over SSH, confirm that MLIA is installed and enabled on the SSH host as follows:

The MLIA extension page identifies Arm as the publisher and confirms that the extension is enabled on an SSH host. MLIA installed on the remote host

To set up the MLIA environment:

  1. Select MLIA in the Activity Bar.
  2. In New Analysis, select Refresh MLIA Environment and wait for setup to finish.
The MLIA New Analysis view shows Refresh MLIA Environment before setup. Select this button to prepare the extension's runtime. Create the managed MLIA environment

The extension installs and manages uv, Python, and MLIA in its own environment. You don’t need to activate mlia_env or install MLIA again for the extension. Its packages and backends are separate from the CLI environment that you created earlier.

Setup is complete when New Analysis shows the Estimation and Profiling tabs, a source-model field, and target-profile selection.

The initialized New Analysis view shows Estimation and Profiling tabs, a Source model field, target selection, and check options. Analysis options after environment setup

Run an Ethos-U estimation for a TFLite model

In New Analysis:

  1. Select Estimation.
  2. Use the … button next to Source model to select tflite/mv2_int8.tflite in your ml-model-artifacts folder.
  3. Select ethos-u85-256 as the target profile.
  4. Select both the Performance and Compatibility checkboxes.
  5. Select Run Analysis.
The estimation form selects mv2_int8.tflite and ethos-u85-256 with both Performance and Compatibility enabled, ready to run both checks. Select the model, target, and checks

Model Explorer opens with a loading view while the analysis runs. When it finishes, Current Analysis Run shows Complete, the model path, target profile, and selected checks. The completed-run screenshot confirms Performance + Compatibility.

Image Alt Text:Current Analysis Run shows Complete for mv2_int8.tflite on ethos-u85-256, with both Performance and Compatibility checks recorded.Confirm the analysis completed

Inspect compatibility and model performance

To inspect performance:

  1. Expand Result 1 · compatibility > Model metrics. For this INT8 model, expect accelerator_operator_percentage to be 100%, matching the earlier CLI check.

    Image Alt Text:The compatibility result reports accelerator_operator_percentage as 100 percent, confirming that the INT8 model’s operators map to the accelerator.Inspect the compatibility result

  2. Expand Result 2 · performance > Model metrics to inspect model-level cycle estimates, memory use, and estimated inference time.

    Image Alt Text:The performance result lists NPU cycles, SRAM and DRAM access cycles, total cycles, estimated inference time, and model memory sizes.Inspect whole-model performance estimates

These LiteRT results come from Vela compiler estimates. The displayed inference time is an estimate, rather than latency measured on a board.

Explore operation metrics in Model Explorer

In Model Explorer, pan, zoom, and expand the model’s groups to inspect operations. Use the search box to locate a node by name.

Select a performance metric in the Overlay selector under Current Analysis Run. The corresponding values and colours appear on the graph. You can also select the overlay in Model Explorer, and the selection is synchronized with the sidebar.

The following image shows op_cycles.

Image Alt Text:Model Explorer displays the MobileNet source graph alongside completed compatibility and performance results. The selected op_cycles provider adds cycle values to the graph.View analysis metrics on the source graph

Select a model group and inspect Node data in selected layer. Compare operation placement, npu_cycles, op_cycles, and memory-access metrics. Use the table filter to narrow the operations that you inspect.

Image Alt Text:The node-data table shows NPU placement and coloured performance metrics for convolution and depthwise convolution operations, allowing operation costs to be compared.Compare metrics across operations

The Aggregated stats in selected layer table summarizes the available numeric metrics with minimum, maximum, sum, and average values. These summaries describe the selected graph group.

Image Alt Text:Aggregated stats in selected layer shows minimum, maximum, sum, and average values for the selected group’s numeric metrics.Inspect metrics for a selected group

Use Model metrics for the whole-model result.

You can zoom in on the graph to see specific operators, with associated data overlaid. For example, to investigate memory cost, select the dram_access_cycles overlay. Expand a group and compare the values attached to its operations.

Image Alt Text:Model Explorer shows dram_access_cycles on expanded MobileNet groups, with different cycle values and colours identifying operations to investigate.Explore DRAM access cycle estimates

Find advice on the model graph

Select advice as the overlay in Current Analysis Run or Model Explorer to highlight operations with MLIA advice. Select a highlighted operation to inspect its advice.

Image Alt Text:The selected softmax node has NPU placement and advice about a suboptimal SOFTMAX activation, showing that a supported operation can still receive performance advice.Locate the Softmax performance advice

The advice identifies SOFTMAX as a suboptimal activation for NPU performance. The operation is supported, so the model can still map fully to the NPU, but it’s a candidate for optimization. You can choose to change the model, after which you can rerun MLIA to compare compatibility and performance estimates. After a rerun, check whether the prediction accuracy and any required probability outputs still meet the needs of your application.

What you’ve accomplished

You’ve set up the MLIA extension, analyzed a model for Ethos-U, and inspected compatibility, model metrics, operation overlays, and advice in Model Explorer.

You can now use the same workflow to compare other supported model artifacts or investigate a revised model.

Back
Next