Skip to main content

A package for estimating the energy and area of NeuroSim components

Project description

HWComponents-NeuroSim

HWComponents-NeuroSim provides energy, area, and leakage models for NeuroSim[1] components. It enables estimation for analog Compute-In-Memory (CiM) Array components and various peripheral components.

We also allow conversions for NVMExplorer[2]/NVSim[3] style cell files to Neurosim processing-in-memory / compute-in-memory arrays.

These models are for use with the HWComponents package, found at https://accelergy-project.github.io/hwcomponents/.

CiM Array Model

We encourage you read section 6 of the NeuroSim Manual in the DNN_NeuroSim_V1.3/Documents folder.

We model CiM array energy/area with four pieces:

  • Row Activation: This is the path for inputs to activate a array. An input voltage will actiavte a wordline, or row of memory cells. Multiple input voltages or longer-duration inputs can feed higher resolution inputs.
  • Column Activation: This is the path for outputs to be read out of a array. Once input voltages have activated a wordline, they will feed current onto bitlines, or columns. Column activation is the energy required to get this current out and to precharge the wordline before reading.
  • Analog-Digital-Conversion: This is the circuit that reads an analog value from the array and converts to a digital signal for output processing.
  • Cell: This a memory cells in the array.

In short: An input activates a row, an output activates a column, a multiplication activates a cell, and an output read takes an ADC conversion.

Installing

Install from PyPI:

pip install hwcomponents-neurosim

# Check that the installation is successful
hwc --list | grep array_col_drivers

Creating Custom Cells

Cell files must follow the NVMExplorer[2]/NVSim[3] format. See the cells/ directory for references. CiM arrays can be created with any user-defined cell.

CiM Components

We support four components for estimating CiM array energy.

  • array_row_drivers: These activate rows.
  • array_col_drivers: These activate columns.
  • array_adc: These read out analog values into digital signals.
  • memory_cell: This is a cell in a array.

CiM Component Arguments

CiM components take the following arguments.

  • tech_node: The technology node in m
  • row: The number of rows in the array
  • cols: The number of columns in the array
  • cols_active_at_once: The number of columns to be activated at a single time
  • cell_config: The path to a NVMExplorer[2]/NVSim[3] cell file, or a sample cell to use.
  • average_input_value: A value between 0 and 1 reflecting the average input being sent on rows. For example, if inputs are encoded as values from 0-4 with an average of 3, average_input_value is 0.75.
  • average_cell_value: Like average_input_value, but with encoded weights. For example, if weights are encoded as values from 1-10 with an average of 7, average_cell_value is 0.7.
  • sequential: A binary value. If true, rows are addressed and accessed one at a time. Otherwise, rows are to be activated in large blocks and not addressed. Setting this to TRUE can simulate a CiM memory.
  • adc_resolution: This is the number of bits of the ADC used for readout. ADC is a flash ADC. To exclude the ADC and use your own, set adc_resolution to 0.
  • read_pulse_width: Number of ns each read pulse lasts.
  • voltage_dac_bits: Number of bits resolution for a voltage-based DAC on each row. Voltage DACs use a row switch connected to a power rail for each possible input value.
  • temporal_dac_bits: Number of bits resolution for a temporal DAC on each row. Temporal DACs enode inputs as an amount of time the row stays high.

Peripheral Components

We support other digital components from NeuroSim. These components are useful in many places-- not just CiM!

Integer Adder

Yep, it adds integers.

Class:

  • intadder

Required parameters:

  • tech_node: The technology node in m
  • n_bits: Number of bits to add

Actions:

  • add

Integer Shift-Add

An adder + a shift register to accumulate variable-precision values.

Class:

  • shift_add

Required parameters:

  • tech_node: The technology node in m
  • n_bits: Number of bits to add
  • shift_register_n_bits: Number of bits in the shift register

Actions:

  • shift_add

Integer Adder-Tree

A tree of adders to accmulate many values. Each level of the tree adds with higher n_bits to ensure no overflow.

Class:

  • intadder_tree

Required parameters:

  • tech_node: The technology node in m
  • n_bits: Number of bits of a leaf adder. This is the minimum n_bits in the tree. Each additional level will add a bit.
  • n_adder_tree_inputs: Number of values to add

Actions:

  • add

Integer Max-Pool

A max-pooling unit that finds and outputs the maximum a set of values.

Class:

  • max_pool

Required parameters:

  • tech_node: The technology node in m
  • n_bits: Number of bits for each input value
  • pool_window: Number of values to compare

Actions:

  • max_pool

Multiplexer

An n-bit multiplexer

Class:

  • mux

Required parameters:

  • tech_node: The technology node in m
  • n_bits: Number of bits for each input value
  • n_inputs: Number of inputs to the mux

Actions:

  • max_pool

Flip-flop

A digital flip flop

Class:

  • flip_flop

Required parameters:

  • tech_node: The technology node in m
  • n_bits: Number of flip flop bits

Actions:

  • max_pool

NOT, NAND, and NOR gates

Logic gates

Class:

  • not_gate
  • nand_gate
  • nor_gate

Required parameters:

  • tech_node: The technology node in m

Actions:

  • read

References

[1]X. Peng, S. Huang, Y. Luo, X. Sun, and S. Yu, “DNN+NeuroSim: An End-to-End Benchmarking Framework for Compute-in-Memory Accelerators with Versatile Device Technologies,” in 2019 IEEE International Electron Devices Meeting (IEDM), Dec. 2019, p. 32.5.1-32.5.4. doi: 10.1109/IEDM19573.2019.8993491.

[2]L. Pentecost, A. Hankin, M. Donato, M. Hempstead, G.-Y. Wei, and D. Brooks, NVMExplorer: A Framework for Cross-Stack Comparisons of Embedded Non-Volatile Memories. 2021.

[3]X. Dong, C. Xu, Y. Xie, and N. P. Jouppi, “NVSim: A Circuit-Level Performance, Energy, and Area Model for Emerging Nonvolatile Memory,” IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 31, no. 7, pp. 994–1007, Jul. 2012, doi: 10.1109/TCAD.2012.2185930.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hwcomponents_neurosim-1.0.32.tar.gz (33.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hwcomponents_neurosim-1.0.32-py3-none-manylinux_2_17_x86_64.whl (34.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

hwcomponents_neurosim-1.0.32-py3-none-macosx_10_13_universal2.whl (34.8 MB view details)

Uploaded Python 3macOS 10.13+ universal2 (ARM64, x86-64)

File details

Details for the file hwcomponents_neurosim-1.0.32.tar.gz.

File metadata

  • Download URL: hwcomponents_neurosim-1.0.32.tar.gz
  • Upload date:
  • Size: 33.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hwcomponents_neurosim-1.0.32.tar.gz
Algorithm Hash digest
SHA256 b6ebf4709eb7828e522dd4bc7696ac082b12e30807ccc0ae35edc4cf6d601fee
MD5 f3902e82c2d702d0af6de0c92cbacfcc
BLAKE2b-256 bedda6551c305d10a6c4cb94013d73c553122c01b1f7e84b3f1ae3b86117fd78

See more details on using hashes here.

Provenance

The following attestation bundles were made for hwcomponents_neurosim-1.0.32.tar.gz:

Publisher: publish.yaml on Accelergy-Project/hwcomponents-neurosim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hwcomponents_neurosim-1.0.32-py3-none-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hwcomponents_neurosim-1.0.32-py3-none-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f942b49e554012f109fcad12a78c7762f56dd96997b8768c4b35cde9526faa1a
MD5 835318e3fd85a4947addfcf0569b86cc
BLAKE2b-256 90947391c847c4270a03ce9cb7c2a7f2dd9b886d7d856db2e7a1e1af3eb87e2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for hwcomponents_neurosim-1.0.32-py3-none-manylinux_2_17_x86_64.whl:

Publisher: publish.yaml on Accelergy-Project/hwcomponents-neurosim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hwcomponents_neurosim-1.0.32-py3-none-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for hwcomponents_neurosim-1.0.32-py3-none-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 98532529bf5ef7a4fb5912977b4534587bea802795090d6ff8b572e12b0dd03e
MD5 3b2dbe034d452cec8a8b8f922d9791da
BLAKE2b-256 90f91f692c0abd9f62e6d5d8210f2383af3243e1391aefad8a219639146076be

See more details on using hashes here.

Provenance

The following attestation bundles were made for hwcomponents_neurosim-1.0.32-py3-none-macosx_10_13_universal2.whl:

Publisher: publish.yaml on Accelergy-Project/hwcomponents-neurosim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page