Skip to content

ReRAM-Labs/yzlite

Repository files navigation

Yizhu Technology ReRAM YZLite (YZLITE)

The YZLite package by Yizhu Technology is an experimental Python package with command-line utilities and scripts for developing machine learning models for embedded platforms. It provides features such as command-line interface, Python API, model profiler, model training and evaluation, model summary, visualization, quantization, audio feature generation, C++ Python wrappers, and more. The package does not come with any warranty or support services, but it is supported by online documentation and community support. YZLite can be installed using pre-built Python package or by building from Github. The software is provided "as-is" without any warranty, but it can be used for any purpose including commercial applications, subject to certain restrictions.

version PyPI - Python Version gsdk tflm tf python

This is a Python package with command-line utilities and scripts to aid the development of machine learning models for Yizhu Technology 's embedded platforms.

The features of this Python package include:

Refer to Why YZLITE? for more details on the benefits of using the YZLITE.

๐Ÿ†• What's New in v0.2.0

โญ Major New Features

ReRAM Crossbar Array Simulator

A complete simulation environment for ReRAM-based Processing-In-Memory (PIM) architectures:

from yzlite.core import TfliteMicro

# Load model with ReRAM simulation
model = TfliteMicro.load_tflite_model('model.tflite', accelerator='reram')

# Configure ReRAM parameters
model.accelerator.configure_crossbar(rows=256, cols=256, levels=8)
model.accelerator.set_adc_resolution(bits=4)

# Test with fault injection
model.accelerator.inject_faults(fault_rate=0.01)
results = model.profile()

# Get performance metrics
stats = model.accelerator.get_statistics()
print(f"Energy: {stats['energy_uj']} ฮผJ, Latency: {stats['latency_us']} ฮผs")

Key Capabilities:

  • โœ… Multi-Level Cell (MLC): 2-16 configurable resistance levels
  • โœ… Realistic Hardware Modeling: IR drop, sneak path, write/read variation
  • โœ… Fault Injection: Reliability analysis with configurable fault rates
  • โœ… Performance Metrics: Energy (ฮผJ), latency (ฮผs), operation counts
  • โœ… Flexible Configuration: Crossbar size, ADC resolution, cell levels

๐Ÿ”ง Improvements

  • Extended Python Support - Now supports Python 3.7-3.13 (previously 3.7-3.10)
  • Updated TensorFlow - Compatible with TensorFlow 2.13+ (tested with 2.13.1)
  • Enhanced Documentation - 90 KB of comprehensive ReRAM simulator documentation
  • 100% Test Coverage - All 56 tests passing across multiple configurations

๐Ÿ“š Research Integration

Based on latest academic research (2019-2024):

  • RAELLA - Low-resolution ADC for analog PIM
  • FARe - Fault-aware GNN training on ReRAM
  • FPSA - Reconfigurable ReRAM accelerator
  • RED - ReRAM-based deconvolution

๐Ÿ“– New Documentation

Overview

.. raw:: html

   <iframe src="./_static/overview/index.html" width="100%" height="600" frameborder="0" class="slideshow-iframe" allowfullscreen style="min-height: 600px; border: 1px solid #e0e0e0; border-radius: 4px; display: block;"></iframe>

Installation

Install the pre-built Python package:

.. tab-set::

   .. tab-item:: Windows

      .. code-block:: shell

         pip  install yizhu-yzlite

   .. tab-item:: Linux

      .. code-block:: shell

         pip3 install yizhu-yzlite

Or, build and install the Python package from Github:

.. tab-set::

   .. tab-item:: Windows

      .. code-block:: shell

         pip  install git+https://github.com/ReRAM-Labs/yzlite.git

   .. tab-item:: Linux

      .. code-block:: shell

         pip3 install git+https://github.com/ReRAM-Labs/yzlite.git

Refer to the Installation Guide for more details on how to install the YZLITE.

Quick Start with ReRAM Simulator

Standalone Usage (No TensorFlow Required)

from reram_simulator_example import ReRAMSimulator
import numpy as np

# Create simulator
simulator = ReRAMSimulator(rows=128, cols=128, adc_resolution=4)

# Load weights
weights = np.random.randn(128, 128)
simulator.load_weights(weights)

# Run inference
input_data = np.random.randn(128)
output = simulator.inference(input_data)

# Test fault tolerance
num_faults = simulator.crossbar.inject_stuck_at_faults(0.01)
output_with_faults = simulator.inference(input_data)

YZLITE Integration

Requires Python 3.10 environment with TensorFlow:

# Create compatible environment
conda create -n yzlite python=3.10 -y
conda activate yzlite
pip install tensorflow==2.13.1

# Install YZLITE
pip install yizhu-yzlite

Documentation

Getting Started

Guides

C++ Development

ReRAM Simulator Documentation

Compatibility

Python Versions

  • โœ… Python 3.7, 3.8, 3.9, 3.10 - Fully supported
  • โœ… Python 3.11, 3.12 - Supported (less tested)
  • โš ๏ธ Python 3.13 - Standalone ReRAM simulator works, TensorFlow has known issues

TensorFlow Versions

  • โœ… TensorFlow 2.13.1 - Recommended (tested)
  • โœ… TensorFlow 2.14-2.19 - Should work
  • โš ๏ธ TensorFlow 2.20+ - Compatibility issues with Python 3.13

Recommended Setup: Python 3.10 + TensorFlow 2.13.1

Contributing

Contributions are welcome! Please see the documentation for development guidelines.

License

SPDX-License-Identifier: Zlib

See LICENSE.md for full license text.

Citation

If you use YZLITE or the ReRAM simulator in your research, please cite:

@software{yzlite2025,
  title = {YZLITE: Machine Learning Toolkit for Embedded Platforms},
  author = {Yizhu Technology},
  year = {2025},
  version = {0.2.0},
  url = {https://github.com/ReRAM-Labs/yzlite}
}

For the ReRAM simulator specifically:

@software{yzlite_reram2025,
  title = {YZLITE ReRAM Crossbar Array Simulator},
  author = {Yizhu Technology},
  year = {2025},
  note = {Based on RAELLA, FARe, FPSA, and RED research},
  url = {https://github.com/ReRAM-Labs/yzlite}
}

Releases

No releases published

Packages

No packages published