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

1.0.3

bf16 now has more verified details

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

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

bf16-1.0.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bf16-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bf16-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f0cd5a58d2ca3b24255fabf63dd9080b0c4ce7316f2377c60563a37bc96ae942
MD5 25834d40e76d5481da5ed5ed52462cfe
BLAKE2b-256 97f91e0b5184cfe725795991c588f28635c32e9554f2320a219e80dceeb0be88

See more details on using hashes here.

Provenance

The following attestation bundles were made for bf16-1.0.3-py3-none-any.whl:

Publisher: bf16_workflow.yml on Pythonexplorer48/bf16

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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