Skip to content
forked from kyegomez/BitNet

Implementation of "BitNet: Scaling 1-bit Transformers for Large Language Models" in pytorch

License

Notifications You must be signed in to change notification settings

DewEfresh/BitNet

 
 

Repository files navigation

Multi-Modality

BitNet

bitnet Implementation of the "BitNet: Scaling 1-bit Transformers for Large Language Models"

Paper link:

BitLinear = tensor -> layernorm -> Binarize -> abs max quantization

Installation

pip install bitnet

Usage:

import torch 
from bitnet import BitLinear
from bitnet.main import Transformer


#example 1
x = torch.randn(10, 512)
layer = BitLinear(512)
y, dequant = layer(x)
print(y, dequant)

#example 2
x = torch.randn(1, 1, 10, 512)
layer = Transformer(512, 8, 8, 64)
y = layer(x)
print(y)

License

MIT

Todo

  • Fix transformer pass error issue

About

Implementation of "BitNet: Scaling 1-bit Transformers for Large Language Models" in pytorch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 87.2%
  • Makefile 12.8%