fla-core is a Python library providing efficient, Triton-based implementations of core operations and kernels for state-of-the-art linear attention and state-space models. It serves as a minimal-dependency subset of the larger 'flash-linear-attention' project, focusing on the fundamental computational building blocks. It is currently at version 0.4.2 and follows a regular release cadence, often in conjunction with its parent project, flash-linear-attention.
Install & Compatibility
Where this runs
tested against v0.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.10
✕ build_error
✓ 71.23s
py 3.11
✕ build_error
✓ 69.13s
py 3.12
✕ build_error
✓ 65.83s
py 3.13
✕ build_error
✓ 64.18s
py 3.9
✕ build_error
✕ build_error
4787MB installed
● package 4787MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
from fla import extend_path
from fla import importlib
This quickstart demonstrates the use of a fused normalization module from `fla-core`. It initializes `FusedRMSNormGated` and applies it to a dummy tensor on a CUDA-enabled GPU. This illustrates how to integrate low-level, optimized operations provided by `fla-core`.
import torch
from fla.modules import FusedRMSNormGated
import os
# fla-core operations require a CUDA-enabled GPU
if not torch.cuda.is_available():
raise RuntimeError("CUDA not available. fla-core requires a CUDA-enabled GPU.")
device = torch.device("cuda")
# Define model parameters
hidden_size = 768
batch_size = 4
sequence_length = 512
# Initialize FusedRMSNormGated module from fla-core
norm_layer = FusedRMSNormGated(hidden_size).to(device)
# Create a dummy input tensor
input_tensor = torch.randn(batch_size, sequence_length, hidden_size, device=device, dtype=torch.float16)
# Perform a forward pass
output_tensor = norm_layer(input_tensor)
print(f"Input tensor shape: {input_tensor.shape}")
print(f"Output tensor shape: {output_tensor.shape}")
print("FusedRMSNormGated operation successful, demonstrating fla-core usage.")
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.