Code Monkey home page Code Monkey logo

tensil's Introduction

Tensil

Build status

Tensil toolchain flow

Flow

Setup

  1. Pull and run Tensil docker container (see below);
  2. Download and install Xilinx Vitis or Vivado;
  3. Download and install Xilinx PYNQ for your FPGA development platform;
  4. Copy Tensil PYNQ driver drivers/tcu_pynq to /home/xilinx/tcu_pynq on your FPGA development platform.

Pull and run docker container

docker pull tensilai/tensil
docker run -v $(pwd):/work -w /work -it tensilai/tensil bash

Compile AI/ML model

Compile AI/ML model (ResNet20 v2 CIFAR) for specific TCU architecture and FPGA development platform (Avnet Ultra96 v2).

From ONNX

tensil compile -a /demo/arch/ultra96v2.tarch -m /demo/models/resnet20v2_cifar.onnx -o "Identity:0" -s true

From frozen TensorFlow graph

tensil compile -a /demo/arch/ultra96v2.tarch -m /demo/models/resnet20v2_cifar.pb -o "Identity" -s true

Other ML frameworks are supported by converting to ONNX

Make Verilog RTL

Make Verilog RTL for specific TCU architecture and FPGA development platform (Ultra96 v2) and 128-bit AXI interface to DDR memory.

tensil rtl -a /demo/arch/ultra96v2.tarch -d 128 -s true

Create Vivado design

Create Vivado design for specific FPGA development platform (Ultra96 v2). If this is something you don't know how to do, we can help! Please reach out to us at [email protected].

Ultra96 v2 design

Run AI/ML model on FPGA

Use PYNQ and Jupyter notebooks to run AI/ML model on FPGA. (See in notebooks.)

Resnet on PYNQ

For maintainers

Additional setup steps

  1. Download and install OpenJDK 11 from Azul;
  2. Download and install Verilator;
  3. Download test models:
wget https://github.com/tensil-ai/tensil-models/archive/main.tar.gz
tar xf main.tar.gz
mv tensil-models-main models
rm main.tar.gz

Run RTL tool from source code

./mill rtl.run -a ./arch/ultra96v2.tarch -d 128 -s true

Run compiler from source code

./mill tools.run -a ./arch/ultra96v2.tarch -m ./models/resnet20v2_cifar.onnx -o "Identity:0" -s true

Run full test suite

./mill __.test -l org.scalatest.tags.Slow

Get help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.