Skip to main content

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

bf16-1.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bf16-1.0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

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

Hashes for bf16-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2e8d130c89656cdee619de11e2421fc9c1060722486c6931faa84848185746f9
MD5 baf944e5005103548dfaf71ffadb5345
BLAKE2b-256 2cf7884a41d971a09972cd86fc95ed18631aef688a6bb9332af7078538bb1205

See more details on using hashes here.

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

Hashes for bf16-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0da92d8eb8c3fac1f6fa9ba92699256a7a5e5c168e9eee6aa9b518b33e6fd33
MD5 4392c92b8dcbaabc9ce2cbbac662c92a
BLAKE2b-256 d04ab8c6c18a0228bd8889b5c9eb28072555fd000bfb44c8df4f1132e6e35bba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page