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 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

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.2.tar.gz (3.9 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.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file bf16-1.0.2.tar.gz.

File metadata

  • Download URL: bf16-1.0.2.tar.gz
  • Upload date:
  • Size: 3.9 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.2.tar.gz
Algorithm Hash digest
SHA256 913cb1bc18d94d2b9ad92d3427f82269bdc9d1f97b496538b4c37ce9601bc3ce
MD5 d24ba3c3b3f1fe5b308b92a726c89203
BLAKE2b-256 48fa06d84d8375eaca11a4372b58bb83774a1cdc8875197bb63d653a1fd9ff2d

See more details on using hashes here.

File details

Details for the file bf16-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: bf16-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0335547f6b346733a2d1e598242417342a1fc044ad619675ae57b245060d8a07
MD5 b8f7dc09ec0797ed4447a062a1c971d2
BLAKE2b-256 12ebba85e728b3334d9ae2445cca4ffaf705b34f367987dcbf4360cbd7b1d203

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