Skip to main content

A place to store reusable transformer components found around the interwebs

Project description

transformer_nuggets

A place to store reusable transformer components of my own creation or found on the interwebs

transformer_nuggies

Getting Started

Clone the repository:

git clone https://github.com/drisspg/transformer_nuggets.git

Install Package

pip install -e .

Dev Tool Chain

pip install -e ".[dev]"

pre-commit is used to make sure that I don't forget to format stuff, I am going to see if I like this or not. This should be installed when installing the dev tools.

Project Structure

  • benchmarks: Contains scripts and data related to benchmarking the transformer components.

    • data: Benchmark data files.
    • flash.py: Benchmarking script for Flash.
    • llama.py: Benchmarking script for Llama.
    • qlora.py: Benchmarking script for Qlora.
    • fp8_sat_cast.py: Benchmarks for comparing FP8 saturated casting kernel to eager and compile code.
  • transformer_nuggets: The main directory containing all transformer components/modules.

    • flash: Components related to the FlashAttention.
    • quant: Implementation of NF4 Tensor and QLora in pure Pytorch
    • sdpa: Prototype for updated SDPA interface in Pytorch.
    • fp8: Components related interacting with PyTorch FP8 tensors.
    • llama: Contains a model def for llama2 models as well as a pretraining script.
    • utils: General utility functions and scripts.
      • benchmark.py: Benchmark-related utility functions.
      • tracing.py: Tracing utilities for transformers.
  • test: Contains test scripts for various transformer components.

    • test_flash.py: Tests for Flash.
    • test_qlora.py: Tests for Qlora.
    • test_sdpa.py: Tests for SDPA.
    • test_fp8.py: Tests for FP8.

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

transformer_nuggets-0.0.2.tar.gz (66.5 kB view details)

Uploaded Source

Built Distribution

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

transformer_nuggets-0.0.2-py3-none-any.whl (58.2 kB view details)

Uploaded Python 3

File details

Details for the file transformer_nuggets-0.0.2.tar.gz.

File metadata

  • Download URL: transformer_nuggets-0.0.2.tar.gz
  • Upload date:
  • Size: 66.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for transformer_nuggets-0.0.2.tar.gz
Algorithm Hash digest
SHA256 033a2aabdcfae5edf2d31485d61cbe3897dc94a5fbe1d9dd6c91eb34e4ad3cb5
MD5 e2057924cec8d92929494f740f41364f
BLAKE2b-256 cfdcd4d2eccb05d51eaa9d328e4150b26c2bfd0ebe674ec13c76852e674f53e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for transformer_nuggets-0.0.2.tar.gz:

Publisher: publish-to-pypi.yml on drisspg/transformer_nuggets

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

File details

Details for the file transformer_nuggets-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for transformer_nuggets-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d0a835d5a8784da4461a05919057d0c3abe7f3b2bfb1d875adc439045364953a
MD5 308e00237c58631c64daf8a29b2d98f4
BLAKE2b-256 cee676320e812c384779d00afab1d04fec552b69a833e6523aeed735c8190155

See more details on using hashes here.

Provenance

The following attestation bundles were made for transformer_nuggets-0.0.2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on drisspg/transformer_nuggets

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