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.
Installation
pip install bf16
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.12 because its a real breainfloat16
print(f"Size: {len(x.data)} bytes") # Always 2 bytes
Requirements
- Windows AMD x86-64
- Python 3.6+ The package includes a compiled assembly executable for fast conversion.
Acknowledgments
Jeremy Gordon thank you for making golink
Changelog
1.0.1 bf16 has completely changed with the last update here is the main stuff
- added all operators that function that exist within float32 to bfloat16
- optimized to not have to open and exit bf16.exe and bf16.obj everytime
- added Changelog
- added acknowlegement to golink I forgot
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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.1.tar.gz.
File metadata
- Download URL: bf16-1.0.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e8d130c89656cdee619de11e2421fc9c1060722486c6931faa84848185746f9
|
|
| MD5 |
baf944e5005103548dfaf71ffadb5345
|
|
| BLAKE2b-256 |
2cf7884a41d971a09972cd86fc95ed18631aef688a6bb9332af7078538bb1205
|
File details
Details for the file bf16-1.0.1-py3-none-any.whl.
File metadata
- Download URL: bf16-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0da92d8eb8c3fac1f6fa9ba92699256a7a5e5c168e9eee6aa9b518b33e6fd33
|
|
| MD5 |
4392c92b8dcbaabc9ce2cbbac662c92a
|
|
| BLAKE2b-256 |
d04ab8c6c18a0228bd8889b5c9eb28072555fd000bfb44c8df4f1132e6e35bba
|