GithubHelp home page GithubHelp logo

nyadla-sys / useful-transformers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from usefulsensors/useful-transformers

0.0 0.0 0.0 71.12 MB

Efficient Inference of Transformer models

License: GNU General Public License v3.0

C++ 61.35% Python 0.50% C 37.00% CMake 1.16%

useful-transformers's Introduction

Useful Transformers

Useful Transformers is a library for efficient inference of Transformer models. The focus is on low cost, low energy processors to run inference at the edge. The initial implementation is aimed at running OpenAI's Whisper speech-to-text model efficiently on the RK3588 processors' based single-board computers. The tiny.en Whisper model runs transcribes speech at 30x real-time speeds, and 2x better than best known implementation.

Getting started

The easiest way to try out Whisper transcription is to install the release wheel package.

# Preferably inside a virtual environment
$ python -m pip install https://github.com/usefulsensors/useful-transformers/releases/download/0.1_rk3588/useful_transformers-0.1-cp310-cp310-linux_aarch64.whl

Try transcribing a wav file.

$ taskset -c 4-7 python -m useful_transformers.transcribe_wav <wav_file>

If you don't have a wav file handy, running the above command will transcribe an example provided in the package.

$ taskset -c 4-7 python -m useful_transformers.transcribe_wav
Ever tried, ever failed. No matter, try again. Fail again. Fail better.

Performance

Performance comparison

The plot shows useful-transformers Whisper tiny.en model's inference times across the examples with varying durations. useful-transformer is 2x faster than faster-whisper's int8 implementation. useful-transformer uses FP16 matrix multiplication on the NPU available in the RK3588 processor. The majority of benefit comes from the large matrix multiplications (of sizes 1500x384x384 for the tiny.en model) in the encoder.

TODO

  • Whisper tiny.en
  • Whisper base.en
  • Larger Whisper models
  • Use int8 matmuls from the librknnrt
  • Use int4 matmuls (request Rockhip for int4 matmul kernels)
  • Use asynchronous kernel launches (request Rockchip for better APIs in general)
  • Decode with timestamps

Contributors

  • Nat Jeffries (@njeffrie)
  • Manjunath Kudlur (@keveman)
  • Guy Nicholson (@guynich)
  • James Wang (@JamesUseful)
  • Pete Warden (@petewarden)
  • Ali Zartash (@aliz)

useful-transformers's People

Contributors

keveman avatar

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.