Skip to content

MurrellGroup/BitPacking.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitPacking.jl

Stable Dev Build Status Coverage

BitPacking.jl is a Julia package that implements bitpacking and unpacking arrays with element bit-widths from 1 to 8, imposing mild size limitations on the first dimension. Bitpacking methods are designed to be device-agnostic, meaning they run fast on GPUs.

Usage

using BitPacking

x = rand(UInt8, 32) .& 0b1111 # 4-bit unpacked values
y = bitpacked(x, 4)           # half the memory size
x == y == bitunpacked(y)      # true

# broadcasting assignment works
y .= rand(UInt8, 32) .& 0b1111 # assign new values

Limitations

  • The first dimension of the input array must currently be divisible by the least common multiple of 8 and the bitwidth.
  • Broadcasting assignment first materializes the unpacked result.

Installation

using Pkg
Pkg.add("BitPacking")

Acknowledgements

BitPacking.jl is partially inspired by IntArrays.jl

About

Fast, device-agnostic bitpacking in Julia

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages