OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Pytorch Onn

Pytorch Onn is a Python library built on PyTorch for simulating photonic integrated circuits and developing optical neural networks. It provides optical model layers and a method for mapping conventional PyTorch layers to optical counterparts, supporting model training, inference, and hardware-aware co-design.

Independent OpenViST project profile, based on linked sources.

Pytorch Onn — Prototyping optical counterparts to Conv2d and Linear neural-network layers
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when a research or development workflow needs PyTorch-based photonic circuit simulation, optical neural-network modeling, or hardware-aware exploration of photonic AI designs.

Who it is for

  • Researchers in neuromorphic photonics and optical AI system design
  • Teams exploring photonic integrated-circuit optimization
  • PyTorch practitioners developing or training optical neural networks

Documented uses

  • Simulate photonic integrated circuits as part of model experiments
  • Construct and train optical neural-network models with PyTorch
  • Convert supported conventional PyTorch layers into optical-layer mappings
  • Explore device, circuit, architecture, and algorithm co-optimization
Before you choose

Requirements & limits

The project is distributed as an open-source MIT-licensed Python library. The README documents installation through pip, source installation, a shell script, or a Conda build.

  • The documented stack requires Python 3.6+, PyTorch 1.13.0+, TensorFlow-GPU 2.5.0+, pyutils 0.0.2+, and GCC 9+.
  • GPU model training requires an NVIDIA GPU and compatible CUDA.
  • The README describes CUDA-backed GPU support and tensorized processing, while also showing optical model construction and layer conversion in PyTorch.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install Pytorch Onn from its source repository

Set up the library from a cloned repository, following the documented source-install route.

Before you start

  • Python 3.6 or later
  • PyTorch 1.13.0 or later
  • TensorFlow-GPU 2.5.0 or later
  • pyutils 0.0.2 or later and other dependencies listed in requirements.txt
  • GCC 9 or later

Steps

  1. Clone https://github.com/JeremieMelo/pytorch-onn.git.

  2. In the cloned directory, run the command below, or use the documented ./setup.sh route.

    Documented command
    python3 setup.py install clean
  3. For a Conda build, the README also lists conda mambabuild ..

Expected outcome

The documented source-install or build steps for the library are completed.

Guide limitations

  • The README lists additional dependencies in requirements.txt.
  • GPU model training requires an NVIDIA GPU and compatible CUDA.
Source-based practical guide

Map a PyTorch model to optical layers

Use the documented model-conversion method to configure optical counterparts for Conv2d and Linear layers.

Before you start

  • Pytorch Onn installed in a Python environment
  • A PyTorch model containing Conv2d and/or Linear layers

Steps

  1. Create the conventional PyTorch model.

  2. Call ONNBaseModel.from_model with the model and a map_cfgs mapping.

  3. Map Conv2d to MZIBlockConv2d and Linear to MZIBlockLinear, as in the documented example.

Expected outcome

The conversion method returns an optical-model representation using the configured layer mappings.

Guide limitations

  • The example documents mappings for Conv2d and Linear layers; it does not specify conversion behavior for other layer types.
COMPARE OPTIONS

Compare options for Model inference and serving

These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.

ProjectDocumented purposePlatformAccess and requirements
Pytorch OnnSimulate photonic integrated circuits as part of model experimentsLinux, Windows, macOSThe project is distributed as an open-source MIT-licensed Python library. The README documents installation through pip, source installation, a shell script, or a Conda build.
ErgoCreate a project with separate data-preparation, model and training scripts.CLI
Llama2LangTranslate an instruction dataset into a target language and combine translation checkpoints.The repository is public and identified as open source under the Apache-2.0 license.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
20 November 2026
Original website title
JeremieMelo/pytorch-onn · Official homepage title · retained in its source language