Git Product home page Git Product logo

tinychat-tutorial's Introduction

Tutorial for TinyChat: Optimizing LLM on Edge Devices

This is a lab for efficientml.ai course.

Running large language models (LLMs) on the edge is of great importance. By embedding LLMs directly into real-world systems such as in-car entertainment systems or spaceship control interfaces, users can access instant responses and services without relying on a stable internet connection. Moreover, this approach alleviates the inconvenience of queuing delays often associated with cloud services. As such, running LLMs on the edge not only enhances user experience but also addresses privacy concerns, as sensitive data remains localized and reduces the risk of potential breaches.

However, despite their impressive capabilities, LLMs have traditionally been quite resource-intensive. They require considerable computational power and memory resources, which makes it challenging to run these models on edge devices with limited capabilities.

In this lab, you will learn the following:

  • How to deploy an LLaMA2-7B-chat with TinyChatEngine on your computer.
  • Implement different optimization techniques (loop unrolling, multithreading, and SIMD programming) for the linear kernel.
  • Observe the end-to-end latency improvement achieved by each technique.

TinyChatEngine

This tutorial is based on TinyChatEngine, a powerful neural network library specifically designed for the efficient deployment of quantized large language models (LLMs) on edge devices.

demo

Tutorial document

Please check this document and follow the instructions which will walk you through the tutorial: https://docs.google.com/document/d/13IaTfPKjp0KiSBEhPdX9IxgXMIAZfiFjor37OWQJhMM/edit?usp=sharing

Submission

  • Report: Please write a report (form) that includes your code and the performance improvement for each starter code.
  • Code: Use git diff to generate a patch for your implementation. We will use this patch to test the correctness of your code. Please name your patch as {studentID}-{ISA}.patch where {ISA} should be one of x86 and ARM, depending on your computer.

Related Projects

TinyChatEngine.

TinyEngine.

Smoothquant.

AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration

Acknowledgement

llama.cpp

transformers

tinychat-tutorial's People

Contributors

meenchen avatar raymondwang0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tinychat-tutorial's Issues

error while running ./chat

Hi @meenchen , @RaymondWang0
I'm implementing this tinychat tutorial in Windows OS. Follwed the instructions mentioned in the MIT_Efficient_AI_Lab_5_Optimize_LLM_on_Edge document.
I've downloaded x86 model.
I'm facing error while running ./chat.
Below is the error Screenshot.
Please provide a solution for this where the issue lies.
Thnaks,
Imran
Screenshot (5)

Error while running ./evaluate.sh

Hi @meenchen , @RaymondWang0
I'm implementing this tinychat tutorial in Windows OS. Follwed the instructions mentioned in the MIT_Efficient_AI_Lab_5_Optimize_LLM_on_Edge document.
I've downloaded x86 model.
I'm facing error while running ./evaluate.sh or ./evaluate.sh loop_unrolling.
Below is the error Screenshot.
Please provide a solution for this where the issue lies.
Thnaks,
Swathi

Screenshot 2024-01-02 194947

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.