Skip to content

Conversation

@mhpanah
Copy link

@mhpanah mhpanah commented Nov 3, 2025

This PR adds a new tutorial notebook act_to_openvino.ipynb that demonstrates converting a Unitree Action Chunking Transformer (ACT) policy (from the LeRobot format) into OpenVINO IR (FP32), INT8. It walks through dependency verification, checkpoint preparation, ONNX export, OpenVINO Model Optimizer invocation, artifact validation, INT8 quantization and Evaluation.

Conversion Flow

  • Verify dependencies (torch, openvino, nncf, etc.).
  • Confirm presence of LeRobot
  • Load and reconstruct model (feature wrapping + config filtering).
  • Build ordered dummy inputs matching model signature.
  • Export ONNX
  • Run Model Optimizer to generate FP32 IR.
  • Confirm IR artifacts exist and report sizes.
  • Direct PyTorch to OpenVINO IR (No ONNX)
  • INT8 Quantization
  • Evaluation & Comparison Plotting

Core Dependencies:

  • openvino>=2025.0.0
  • torch>=2.1, torchvision, accelerate
  • nncf>=2.14.0 (future quantization integration)
  • safetensors, onnx, onnxruntime
  • Utility: numpy, pandas, matplotlib, tqdm, h5py, rich

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -0,0 +1,598 @@
{
Copy link
Collaborator

@openvino-dev-samples openvino-dev-samples Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #1.    # Export ACT Model to ONNX

Can we skip this step, and convert it to OV IR directly ?https://docs.openvino.ai/2025/openvino-workflow/model-preparation/convert-model-pytorch.html


Reply via ReviewNB

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added another section to also convert it to OV IR directly.

@@ -0,0 +1,598 @@
{
Copy link
Collaborator

@openvino-dev-samples openvino-dev-samples Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need an example to teach developer how to deploy this IR with OpenVINO


Reply via ReviewNB

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added evaluation section which shows how to run the model.


ENV_NAME="unitree_lerobot"
LEROBOT_DIR="unitree_IL_lerobot"
PY_VERSION="3.10"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should we limit the version of python and force developer to use Conda.
For user experience, a notebook should be run across different OS and python virtual environment.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's due to LeRobot requirements.

python -m pip install --upgrade pip wheel setuptools
}

install_openvino_requirements() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, add link to the quide https://github.com/openvinotoolkit/openvino_notebooks/blob/latest/README.md#-installation-guide to the README instead of processing it here

@@ -0,0 +1,598 @@
{
Copy link
Collaborator

@sbalandi sbalandi Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #38.    def pip_install(*packages):

we have such function in utils, please, check example in Prerequisites here https://github.com/openvinotoolkit/openvino_notebooks/blob/latest/notebooks/llm-native-agent-react/llm-native-agent-react.ipynb and use it


Reply via ReviewNB

@@ -0,0 +1,598 @@
{
Copy link
Collaborator

@sbalandi sbalandi Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where model.safetensors are originally placed ? On which step and from where should we download it ?


Reply via ReviewNB

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to create a download link for our model or user can use their own model.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you, please, share some models so I can run it on my machine ?

@@ -0,0 +1,598 @@
{
Copy link
Collaborator

@sbalandi sbalandi Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to load the model directly into act_checkpoint ?


Reply via ReviewNB

@@ -0,0 +1,598 @@
{
Copy link
Collaborator

@sbalandi sbalandi Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo is deprecated, could you please convert model via ov.convert_model(model) https://docs.openvino.ai/2025/openvino-workflow/model-preparation/convert-model-pytorch.html ?


Reply via ReviewNB

Copy link
Collaborator

@openvino-dev-samples openvino-dev-samples left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mhpanah

I can not install the dependencies on my ubuntu system properly.
Have you verified everything from scratch on your side.

image

@mhpanah
Copy link
Author

mhpanah commented Nov 12, 2025

Hi @mhpanah

I can not install the dependencies on my ubuntu system properly. Have you verified everything from scratch on your side.

image

Please run this in your terminal before running the notebook:

bash setup_unitree_lerobot_env.sh
conda create -n unitree_lerobot python=3.10 -y
conda activate unitree_lerobot
# Launch notebook with correct kernel
jupyter lab act_to_openvino.ipynb --NotebookApp.kernel_name=unitree_lerobot

This is in the Minimal Installation & Launch section of the readme.

@openvino-dev-samples
Copy link
Collaborator

Hi @mhpanah
I can not install the dependencies on my ubuntu system properly. Have you verified everything from scratch on your side.
image

Please run this in your terminal before running the notebook:

bash setup_unitree_lerobot_env.sh
conda create -n unitree_lerobot python=3.10 -y
conda activate unitree_lerobot
# Launch notebook with correct kernel
jupyter lab act_to_openvino.ipynb --NotebookApp.kernel_name=unitree_lerobot

This is in the Minimal Installation & Launch section of the readme.

Thanks for clarification. However we can not limit using Conda only, and any specific dependencies of a notebook should be included in the .ipynb file instead of a separate script, which means you cannot expect users to install them through a terminal. Another approach maybe you can refer is that there is supplementary_materials folder to keep some special examples, which is more flexible for contributors. @sbalandi @aleksandr-mokrov whats your opinion ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants