Registry / ai-ml / dsalt
library0.4.34pypypiunverified

dsalt (Dynamic Sparse Attention with Landmark Tokens) is a high-performance Triton-based implementation of sparse attention for transformers. Version 0.4.34 supports PyTorch and provides fused kernels for landmark token selection and sparse attention computation, targeting long-context LLM inference and training. Released monthly.

pip install dsalt
INSTALL
IMPORT
SIG · DSALT
D
dsalt
ai-mlpythonv0.4.34
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DynamicSparseAttention
✓ from dsalt import DynamicSparseAttention
✗ from dsalt.dynamic_sparse_attention import DynamicSparseAttention
Top-level import is the canonical way. Nested submodule path changed in 0.4.x.

Initialize the sparse attention module with model dimensions and run a forward pass.

import torch from dsalt import DynamicSparseAttention model = DynamicSparseAttention( d_model=1024, n_heads=8, landmark_ratio=0.1, sparse_topk=32 ).cuda() x = torch.randn(2, 512, 1024).cuda() # compute dynamic sparse attention output = model(x) print(output.shape)
Debug
Known issues
breakingIn dsalt 0.4.x, the module import path changed from `dsalt.dynamic_sparse_attention` to `dsalt`. Existing code using the old import will break.
fix
Update import to `from dsalt import DynamicSparseAttention`.
affects: <0.4.0
gotchadsalt requires GPU with compute capability >=7.0 (Volta) and Triton installed. Running on CPU will raise a RuntimeError during kernel compilation.
fix
Ensure a compatible NVIDIA GPU and install Triton via `pip install triton`.
affects: all
gotchaThe `landmark_ratio` parameter must be a float between 0 and 1. Values >=1 will silently fall back to dense attention, which may cause unexpected memory usage.
fix
Ensure `landmark_ratio` < 1.0, e.g., 0.1.
affects: all
deprecatedThe `num_landmarks` argument in the constructor is deprecated in 0.4.x and will be removed in 0.5. Use `landmark_ratio` instead.
fix
Replace `num_landmarks=64` with `landmark_ratio=64/seq_len`.
affects: >=0.4.0
Upgrade
Version history
0.4.34latest on PyPI · released Jun 6, 2026
Audit
Dependencies
torchrequiredCore dependency for tensor operations and autograd.
tritonrequiredRequired for GPU kernel compilation and execution.
Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
dsalt — pip install dsalt · libregistry