Twn_Generator v0.1.5
This package generates c or verilog code for convolutions in Ternary Neural Networks
Installation
To install run
pip3 install twn_generator
Example Usage
There are two example verilog use cases for computing the convolution
The first uses 16 bit adders to compute the convolution quickly. The second computes the same result but computes the convolution using 4 bit serial adders. This only has a quarter of the throughput but also a quarter of the area in adders.
To run the CSE and generate the adders, run:
python3 run_cse_and_generate_example.py --matrix_fname data/conv1_weights.csv --cse_fname data/conv1_tern_op_list.csv --module_name lyr1 --BW_in 16
python3 run_cse_and_generate_example.py --matrix_fname data/conv1_weights.csv --cse_fname data/conv1_tern_op_list.csv --module_name lyr1_serial --BW_in 4 --serial
This will generate 3 files:
- lyr1.sv => the 16 bit adder version
- lyr1_serial.sv => the 4 bit serial adder version
- serial_adder.sv => a helper module implementing the serial adder
In the verilog/ directory the following can be used to verify the 16 bit adder example:
- conv_windower.sv
- windower_3x3_pad.sv
- conv_windower_test.sv
For the 4 bit serial adder example:
- conv_windower_serial.sv
- from_serial.v
- to_serial.v
- windower_3x3_pad_serial_4.sv
- conv_windower_serial_test.sv
The top level design modules are conv_windower.sv and conv_windower_serial.sv respectively. The simulation test sources are conv_windower_test.sv and conv_windower_serial.sv
For more details on CSE
For more details on SMM
Copyleft
The output of the generator ( the verilog or c in this case ) is not under GPL
See: In what cases is the output of a GPL program covered by the GPL too?
Citation
Please cite:
@article{tridgell2019unrolling,
title={Unrolling Ternary Neural Networks},
author={Tridgell, Stephen and Kumm, Martin and Hardieck, Martin and Boland, David and Moss, Duncan and Zipf, Peter and Leong, Philip HW},
journal={ACM Transactions on Reconfigurable Technology and Systems (TRETS)},
volume={12},
number={4},
pages={22},
year={2019},
publisher={ACM}
}
Metadata
Release files for twn-generator 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| twn_generator-0.1.5.tar.gz | 14.9 kB | Without provenance | Details for twn_generator-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| twn_generator-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for twn_generator-0.1.5-py3-none-any.whl |
Total release size: 44.0 kB
Release files / twn_generator-0.1.5.tar.gz
| Download URL | twn_generator-0.1.5.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f8a1c540931cc766e4ed517ad0dc2642ba7000e7a855f4e55e0aeec1f46091e
|
|
BLAKE2b-256 checksum How to use checksums |
615230ce5bf283658641ee9c1b4aae29e46b2898a4a843360c6a957ac8dbebc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
|
Release files / twn_generator-0.1.5-py3-none-any.whl
| Download URL | twn_generator-0.1.5-py3-none-any.whl |
|---|---|
| Size | 29.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89a9a49189e00439192d6f31a410d32c6b8572209e3612e43fbd5e1acc30ef37
|
|
BLAKE2b-256 checksum How to use checksums |
fc004dd98b50b8fe3615a489daff35e279776b33315d5dfd0760e4ece69cd284
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
|
Security for twn-generator 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.