Giter Site home page Giter Site logo

linguo123 / codegeex-fastertransformer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codegeex/codegeex-fastertransformer

0.0 0.0 0.0 28.3 MB

fastertransformer for codegeex model

License: Apache License 2.0

Shell 0.77% C++ 65.70% Python 1.46% C 0.05% Cuda 29.58% CMake 2.44%

codegeex-fastertransformer's Introduction

CodeGeeX FasterTransformer

This repository provides the fastertrasformer implementation of CodeGeeX model.

Get Started

First, download and setup the following docker environment, replace <WORK_DIR> by the directory of this repo:

docker pull nvcr.io/nvidia/pytorch:21.11-py3
docker run -p 9114:5000 --cpus 12 --gpus '"device=0"' -it -v <WORK_DIR>:/workspace/codegeex-fastertransformer --ipc=host  --name=test nvcr.io/nvidia/pytorch:21.11-py3

Second, install following packages in the docker:

pip3 install transformers
pip3 install sentencepiece
cd codegeex-fastertransformer
sh make_all.sh  # Remember to specify the DSM version according to the GPU.

Then, convert the initial checkpoint (download here) to FT version using get_ckpt_ft.py.

Finally, run api.py to start the server and run post.py to send request:

nohup python3 api.py > test.log 2>&1 &
python3 post.py

Inference performance

The following figure compares the performances of pure Pytorch, Megatron and FasterTransformer under INT8 and FP16. The fastest implementation is INT8 + FastTrans, and the average time of generating a token <15ms.

Liscense

Our code is licensed under the Apache-2.0 license.

codegeex-fastertransformer's People

Contributors

lorashen avatar prnake avatar stanislas0 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.