High-performance BFloat16 conversion powered by x64 Assembly.
Project description
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
Github.com data
Pypi.org data
Socket.dev data
Virustotal Scan Results
More Badges
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:
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bf16-1.0.5-py3-none-any.whl.
File metadata
- Download URL: bf16-1.0.5-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09cf6293387cfc10fc20adf87b46c35390c9cba2d73a0fb65c24abae21295cf3
|
|
| MD5 |
7782c62c46fcabc13c9e95d6fba2f864
|
|
| BLAKE2b-256 |
f8ff404d2739d8d481eb9fc5e45f57ee7938e53bb3dd7097050fbb4a709a27cd
|
Provenance
The following attestation bundles were made for bf16-1.0.5-py3-none-any.whl:
Publisher:
bf16_workflow.yml on Pythonexplorer48/bf16
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bf16-1.0.5-py3-none-any.whl -
Subject digest:
09cf6293387cfc10fc20adf87b46c35390c9cba2d73a0fb65c24abae21295cf3 - Sigstore transparency entry: 1391601748
- Sigstore integration time:
-
Permalink:
Pythonexplorer48/bf16@034cbfd1da48fda127c9a5b641123367bf8fc16e -
Branch / Tag:
refs/tags/v1.0.5 - Owner: https://github.com/Pythonexplorer48
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
bf16_workflow.yml@034cbfd1da48fda127c9a5b641123367bf8fc16e -
Trigger Event:
release
-
Statement type: