simpler_flash
[][tests]
[
][documentation]
a full on suite of fast flash attention mechanisms, flashattention, flash-hyperattention, flash-softpick attention, flash-adasplash, flash criss-cross attention. just pip install it with conda or with uv, have a compatible gpu and it should work.
installs in 1 sec without anything complex.
Installation
You need to use Python 3.10+.
There are several alternative options to install simpler_flash:
- Install the latest release of
simpler_flashfrom [PyPI][]:
pip install simpler_flash
- Install the latest development version:
pip install git+https://github.com/jkobject/simpler_flash.git@main
in some old GPUs, you might need to use a lower block dim, for now it just has to be updated in the source code directly e.g. setting MAX_BLOCK_SIZE=64 instead of 128. it will reduce your max head size to 64
Usage
from simpler_flash import FlashTransformer
self.transformer = FlashTransformer(
d_model=1024,
nhead=16,
nlayers=12,
dropout=0.1,
use_flash_attn=True,
num_heads_kv=4, # option to do Grouped Attention
checkpointing=True, # option to use checkpointing
prenorm=True, # option to use prenorm
drop_path_rate=0.1, # option to use drop path
)
transformer_output = self.transformer(
encoding,
return_qkv=get_attention_layer, #option to get the q,k,v matrices (to extract attention scores for example)
bias=bias if do_bias else None, # option to add attention bias
bias_layer=list(range(self.nlayers - 1)), # option to add attention bias to specific layers
)
Metadata
Release files for simpler-flash 1.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simpler_flash-1.3.5.tar.gz | 3.0 MB | Without provenance | Details for simpler_flash-1.3.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simpler_flash-1.3.5-py3-none-any.whl | Python 3 | none | any | Details for simpler_flash-1.3.5-py3-none-any.whl |
Total release size: 3.0 MB
Release files / simpler_flash-1.3.5.tar.gz
| Download URL | simpler_flash-1.3.5.tar.gz |
|---|---|
| Size | 3.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e7a13d12ac45ef3512b311b90c621f35a9a346ccb7db949bf28e1f92212ee005
|
|
BLAKE2b-256 checksum How to use checksums |
3843c268df3f3ec529cb253211a82784fe468f638dbd533cb66532772cb484b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / simpler_flash-1.3.5-py3-none-any.whl
| Download URL | simpler_flash-1.3.5-py3-none-any.whl |
|---|---|
| Size | 63.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18c4dbc64d45c4eff388b62592a3711ebe3bc93f0d6e590ceaab4a31d227e43b
|
|
BLAKE2b-256 checksum How to use checksums |
bdc72de661892a07664729edca89858dcd1037600cd0dcfa535fa2a647a0b7da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for simpler-flash 1.3.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.