Skip to content

Pythonexplorer48/bf16

bf16

BF16 is a Python package for converting floating-point numbers to BFloat16 format using optimized Windows x86-64 assembly.

Live Data

Pepy.tech data

PyPI DownloadsPyPI DownloadsPyPI Downloads

Github.com data

Stars Forks Open Issues Open PRs License Repo Size Top Language Code Size Last Commit Commit Activity Contributors Followers Watchers

Pypi.org data

PyPI Version Python Versions

Socket.dev data

Socket

Virustotal Scan Results

VirusTotal

More Badges

Platform Dependencies CPU Instruction Set Security Policy

Installation

To install bf16 the 2 easiest options are either run this command:

pip install bf16

or click this button to download a zip containing only necessary files to download and also extract it: Download bf16.zip

Usage

import bf16

x = bf16.bfloat16(3.14)
print(x)  # Outputs the BFloat16 approximation as a float and for the record it also actually output 3.125 because its a real brain-float16
print(f"Size: {len(x.data)} bytes")  # Always 2 bytes

Requirements

  • Windows AMD x86-64
  • Python 3.6+
  • cffi The package includes a compiled assembly executable for fast conversion.

Acknowledgments

  • Thank you to Tomasz Grysztar for his work on FASM which made it possible to optimize bf16.dll and make it smaller
  • Jeremy Gordon thank you for making golink which helped with earlier versions of bf16

Changelog

1.0.1

bf16 has completely changed with the last update here is the main stuff

  • added nearly all operators that function that exist within float32 to bfloat16
  • instead of bf16.obj and bf16.exe it is now just a bf16.dll
  • optimized to not have to open and exit bf16.dll everytime
  • added Changelog
  • added acknowlegement to golink I forgot

1.0.2

bf16 has gained a way for people to know they are downloading a safe package

  • corrected README.md old changelog for 1.0.1
  • added repo and its link

1.0.3

bf16 now has more verified details

  • added more verified details
  • made SECURITY.md workflow and CODEOWNERS

1.0.4

bf16 now has finished documentation.

  • Finished community Standards
  • Added downloading Zip file allowing you to only download only necessary files saving memory including README.md, LICENSE, bf16/__init__.py, and bf16/bf16.dll NOTE: go to [[CHANGELOG.md]] for more specific information on the changelog

1.0.5

bf16 is now much faster!

  • optimized bf16.dll by using vectorization merged functions and merged sections
  • switched from GoLink&NASM to FASM for increased speed and smaller dll
  • at the cost of adding a dependency uses cffi to make __init__.py much faster

About

A bfloat16 for windows AMD x86_64

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors