All Projects → jofrfu → Tinytpu

jofrfu / Tinytpu

Licence: gpl-3.0
Implementation of a Tensor Processing Unit for embedded systems and the IoT.

Programming Languages

assembly
5116 projects

Projects that are alternatives of or similar to Tinytpu

hwt
VHDL/Verilog/SystemC code generator, simulator API written in python/c++
Stars: ✭ 145 (-5.23%)
Mutual labels:  fpga, vhdl, verilog
Platformio Core
PlatformIO is a professional collaborative platform for embedded development 👽 A place where Developers and Teams have true Freedom! No more vendor lock-in!
Stars: ✭ 5,539 (+3520.26%)
Mutual labels:  verilog, fpga, iot
intfftk
Fully pipelined Integer Scaled / Unscaled Radix-2 Forward/Inverse Fast Fourier Transform (FFT) IP-core for newest Xilinx FPGAs (Source language - VHDL / Verilog). GNU GPL 3.0.
Stars: ✭ 43 (-71.9%)
Mutual labels:  fpga, vhdl, verilog
SpinalCrypto
SpinalHDL - Cryptography libraries
Stars: ✭ 36 (-76.47%)
Mutual labels:  fpga, vhdl, verilog
Clash Compiler
Haskell to VHDL/Verilog/SystemVerilog compiler
Stars: ✭ 958 (+526.14%)
Mutual labels:  verilog, fpga, vhdl
math
Useful m-scripts for DSP (CIC, FIR, FFT, Fast convolution, Partial Filters etc.)
Stars: ✭ 15 (-90.2%)
Mutual labels:  fpga, vhdl, verilog
Platformio Atom Ide
PlatformIO IDE for Atom: The next generation integrated development environment for IoT
Stars: ✭ 475 (+210.46%)
Mutual labels:  verilog, fpga, iot
fpga-docker
Tools for running FPGA vendor toolchains with Docker
Stars: ✭ 54 (-64.71%)
Mutual labels:  fpga, vhdl, verilog
Openfpgaduino
All open source file and project for OpenFPGAduino project
Stars: ✭ 137 (-10.46%)
Mutual labels:  verilog, fpga, iot
Spinalhdl
Scala based HDL
Stars: ✭ 696 (+354.9%)
Mutual labels:  verilog, fpga, vhdl
xeda
Cross EDA Abstraction and Automation
Stars: ✭ 25 (-83.66%)
Mutual labels:  fpga, vhdl, verilog
Vexriscv
A FPGA friendly 32 bit RISC-V CPU implementation
Stars: ✭ 1,041 (+580.39%)
Mutual labels:  verilog, fpga, vhdl
vscode-terosHDL
VHDL and Verilog/SV IDE: state machine viewer, linter, documentation, snippets... and more!
Stars: ✭ 325 (+112.42%)
Mutual labels:  fpga, vhdl, verilog
getting-started
List of ideas for getting started with TimVideos projects
Stars: ✭ 50 (-67.32%)
Mutual labels:  fpga, vhdl, verilog
SpinalDev
Docker Development Environment for SpinalHDL
Stars: ✭ 17 (-88.89%)
Mutual labels:  fpga, vhdl, verilog
Edalize
An abstraction library for interfacing EDA tools
Stars: ✭ 270 (+76.47%)
Mutual labels:  verilog, fpga, vhdl
Platformio Vscode Ide
PlatformIO IDE for VSCode: The next generation integrated development environment for IoT
Stars: ✭ 676 (+341.83%)
Mutual labels:  verilog, fpga, iot
Image Processing
Image Processing Toolbox in Verilog using Basys3 FPGA
Stars: ✭ 31 (-79.74%)
Mutual labels:  verilog, fpga, vhdl
J1sc
A reimplementation of a tiny stack CPU
Stars: ✭ 64 (-58.17%)
Mutual labels:  verilog, fpga, vhdl
Logic
CMake, SystemVerilog and SystemC utilities for creating, building and testing RTL projects for FPGAs and ASICs.
Stars: ✭ 149 (-2.61%)
Mutual labels:  verilog, fpga

tinyTPU

The aim of this project is to create a machine learning co-processor with a similar architecture as Google's Tensor Processing Unit. The implementation is resource-friendly and can be used in different sizes to fit every type of FPGA. This allows the deployment of this co-processor in embedded systems and IoT devices, but it can also be scaled up to be used in data centers and high-perfomance machines. The AXI interface allows usage in a variety of combinations. Evaluations were made on the Xilinx Zynq 7020 SoC.

Quantization

Unlike the original TPU, this version can only do fixed-point arithmetic. Weights and inputs have to be in the range of -1 to 127/128 or 0 to 255/256.

Architecture

There are 6 main components, which allow the arithmetic:

  • Weight Buffer: BlockRAM, which holds the weights. The buffer can be written from the host-system over the AXI interface.
  • Unified Buffer: BlockRAM, which holds the input/output of the net layers. The buffer can be written and read from the host-system over the AXI interface.
  • Systolic Data Setup: A set of Registers, which diagonalizes input data read from the Unified Buffer.
  • Matrix Multiply Unit (MXU or MMU): The heart of the TPU, a 2 dimensional grid of Multiply-Add units, which can do NxN matrix-multiplies. It reads weights from the Weight Buffer and the diagonalized input from the Systolic Data Setup. The result is stored in a set of accumulators.
  • Accumulators: Can accumulate or override the result of the Matrix Multiply Unit to merge splitted up matrix-multiplies.
  • Activation: Fused activation functions to activate the result in the accumulators. Sigmoid and (bounded) ReLU are currently supported. The results are stored in the Unified Buffer.

The sizes of the components (e.g. size of MXU, buffers, etc.) can be configured seperately.

Instructions

The control units allow the system to execute 10 Byte wide instructions (more info at doc/TPU_ISA.md). Instructions can be transmitted over AXI and are stored in a small fifo-buffer.

Measurements

A sample model, trained with the MNIST dataset, was evaluated on different sized MXUs at 177.77 MHz with a theorethical perfomance of up to 72.18 GOPS. Real timing measurements were then compared with traditional processors:

Tensor Processing Unit at 177.77 MHz

Matrix Width N 6 8 10 12 14
Instruction Count 431 326 261 216 186
Duration in us (N input vectors) 383 289 234 194 165
Duration per input vector in us 63 36 23 16 11
Processor Intel Core i5-5287U at 2.9 GHz BCM2837 4x ARM Cortex-A53 at 1.2 GHz
Duration per input vector in us 62 763

Getting Started

To get started with tinyTPU, please have a look at getting_started.pdf, where detailed instructions for Xilinx Zynq SoCs and Vivado can be found.

More Information

This project was developed during a bachelor thesis in technical computer science at the HAW Hamburg. If you want to know more about the co-processor, you can have a look at the thesis here (german).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].