Skip to content

feat: MolmoAct2 processors - #234

Merged
alfieroddan merged 33 commits into
openvinotoolkit:mainfrom
alfieroddan:ar/molmoact2
Sep 16, 2026
Merged

alfieroddan merged 33 commits into
openvinotoolkit:mainfrom
alfieroddan:ar/molmoact2

Conversation

@alfieroddan

@alfieroddan alfieroddan commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Corresponding PR to introduce numpy processors

open-edge-platform/physical-ai-studio#809

Other changes: we've adjusted the stats normalization to include the new mask parameter.

@alfieroddan
alfieroddan marked this pull request as ready for review August 28, 2026 14:50
@alfieroddan
alfieroddan requested a review from a team as a code owner August 28, 2026 14:50
Copilot AI lite review requested due to automatic review settings August 28, 2026 14:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds NumPy-based MolmoAct2 inference processors to the runtime (preprocess: observation → prompt/images; model-input assembly: tokens/images → graph inputs; postprocess: outputs → actions), and extends stats (de)normalization to support a per-dimension boolean mask so only selected dimensions are transformed.

Changes:

  • Introduce MolmoAct2 preprocessor, image patchifier, model-input assembler, and postprocessor, and register them in the component factory.
  • Add masked-dimension support to StatsNormalizer / StatsDenormalizer and corresponding unit tests.
  • Add new unit tests for MolmoAct2 preprocessing/model-input assembly/postprocessing pipeline.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/unit/inference/preprocessors/test_stats_normalizer.py Adds a masked-dimension normalization test for StatsNormalizer.
tests/unit/inference/preprocessors/test_molmoact2.py New unit tests for MolmoAct2 preprocessor/image processor/model-input assembly + manifest pipeline.
tests/unit/inference/postprocessors/test_stats_denormalizer.py Adds a masked-dimension denormalization test for StatsDenormalizer.
tests/unit/inference/postprocessors/test_molmoact2.py New unit tests for MolmoAct2 postprocessor and registry instantiation.
src/physicalai/inference/preprocessors/stats_normalizer.py Applies optional mask after normalization so unmasked dims pass through unchanged.
src/physicalai/inference/preprocessors/molmoact2.py New MolmoAct2 observation preprocessor (task normalization, state discretization, image packing/resizing, optional joint transform, optional masked normalization).
src/physicalai/inference/preprocessors/molmoact2_inputs.py New MolmoAct2 model-input assembler: expands `<
src/physicalai/inference/preprocessors/molmoact2_image.py New NumPy image patchification + pooling index generation for MolmoAct2.
src/physicalai/inference/preprocessors/init.py Exposes MolmoAct2 preprocessor and model-input assembler.
src/physicalai/inference/postprocessors/stats_denormalizer.py Applies optional mask after denormalization so unmasked dims pass through unchanged.
src/physicalai/inference/postprocessors/molmoact2.py New MolmoAct2 postprocessor (clamp, masked denormalize, optional inverse joint transform).
src/physicalai/inference/postprocessors/init.py Exposes MolmoAct2 postprocessor.
src/physicalai/inference/component_factory.py Registers MolmoAct2 processors in the component registry.
pyproject.toml Minor dependency-list whitespace change.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/unit/inference/preprocessors/test_stats_normalizer.py
Comment thread src/physicalai/inference/preprocessors/molmoact2_inputs.py Outdated
Comment thread src/physicalai/inference/preprocessors/molmoact2/inputs.py
Comment thread src/physicalai/inference/preprocessors/molmoact2.py
Comment thread src/physicalai/inference/preprocessors/molmoact2/processor.py
Comment thread pyproject.toml Outdated
Comment thread src/physicalai/inference/preprocessors/molmoact2.py Outdated
Comment thread src/physicalai/inference/preprocessors/molmoact2.py Outdated
@alfieroddan
alfieroddan enabled auto-merge (squash) September 10, 2026 12:33
Comment thread src/physicalai/inference/postprocessors/molmoact2.py Outdated
Comment thread src/physicalai/inference/joint_transform.py Outdated
sovrasov
sovrasov previously approved these changes Sep 11, 2026
kdijkstraintel
kdijkstraintel previously approved these changes Sep 14, 2026

@kdijkstraintel kdijkstraintel left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good.

@samet-akcay

Copy link
Copy Markdown
Contributor

would it be an idea to re-structure src/physicalai/inference/postprocessors directory as it is getting a bit cluttered? Maybe a subpackage per-model? Something like

  src/physicalai/inference/preprocessors/
  ├── __init__.py
  ├── base.py
  ├── stats_normalizer.py
  ├── resize.py
  ├── pi05.py
  ├── rldx1/
  │   ├── __init__.py
  │   ├── processor.py
  │   ├── rope.py
  │   └── token_composer.py
  └── molmoact2/
      ├── __init__.py
      ├── processor.py
      ├── inputs.py
      └── image.py

init.py could expose the classes:

  from physicalai.inference.preprocessors.molmoact2.inputs import MolmoAct2Inputs
  from physicalai.inference.preprocessors.molmoact2.processor import MolmoAct2Preprocessor

  __all__ = ["MolmoAct2Inputs", "MolmoAct2Preprocessor"]

so relative imports would still work?

@alfieroddan
alfieroddan dismissed stale reviews from sovrasov and kdijkstraintel via bcac132 September 16, 2026 08:55
@alfieroddan
alfieroddan merged commit 15945cc into openvinotoolkit:main Sep 16, 2026
41 checks passed
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.

5 participants