{"id":44793,"library":"dsalt","title":"dsalt","description":"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.","status":"active","version":"0.4.34","language":"python","source_language":"en","source_url":"https://github.com/LeonardoCofone/dsalt-library","tags":["sparse-attention","triton","long-context","transformers"],"install":[{"cmd":"pip install dsalt","lang":"bash","label":"PyPI"},{"cmd":"pip install dsalt[dev]","lang":"bash","label":"Install with dev dependencies"}],"dependencies":[{"reason":"Core dependency for tensor operations and autograd.","package":"torch","optional":false},{"reason":"Required for GPU kernel compilation and execution.","package":"triton","optional":false}],"imports":[{"note":"Top-level import is the canonical way. Nested submodule path changed in 0.4.x.","wrong":"from dsalt.dynamic_sparse_attention import DynamicSparseAttention","symbol":"DynamicSparseAttention","correct":"from dsalt import DynamicSparseAttention"}],"quickstart":{"code":"import torch\nfrom dsalt import DynamicSparseAttention\n\nmodel = DynamicSparseAttention(\n    d_model=1024,\n    n_heads=8,\n    landmark_ratio=0.1,\n    sparse_topk=32\n).cuda()\n\nx = torch.randn(2, 512, 1024).cuda()\n# compute dynamic sparse attention\noutput = model(x)\nprint(output.shape)","lang":"python","description":"Initialize the sparse attention module with model dimensions and run a forward pass."},"warnings":[{"fix":"Update import to `from dsalt import DynamicSparseAttention`.","message":"In dsalt 0.4.x, the module import path changed from `dsalt.dynamic_sparse_attention` to `dsalt`. Existing code using the old import will break.","severity":"breaking","affected_versions":"<0.4.0"},{"fix":"Ensure a compatible NVIDIA GPU and install Triton via `pip install triton`.","message":"dsalt requires GPU with compute capability >=7.0 (Volta) and Triton installed. Running on CPU will raise a RuntimeError during kernel compilation.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure `landmark_ratio` < 1.0, e.g., 0.1.","message":"The `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.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace `num_landmarks=64` with `landmark_ratio=64/seq_len`.","message":"The `num_landmarks` argument in the constructor is deprecated in 0.4.x and will be removed in 0.5. Use `landmark_ratio` instead.","severity":"deprecated","affected_versions":">=0.4.0"}],"env_vars":null,"search_vec":"'0.4.34':24 'attent':5,20,37,51 'base':16 'comput':38 'context':42,55 'dsalt':1,2 'dynam':3 'fuse':29 'high':12 'high-perform':11 'implement':17 'infer':44 'kernel':30 'landmark':7,32 'llm':43 'long':41,54 'long-context':40,53 'month':48 'perform':13 'provid':28 'pytorch':26 'releas':47 'select':34 'spars':4,19,36,50 'sparse-attent':49 'support':25 'target':39 'token':8,33 'train':46 'transform':22,56 'triton':15,52 'triton-bas':14 'version':23","created_at":"2026-06-07T12:51:52.186954+00:00","updated_at":"2026-06-07T12:51:52.186954+00:00","problems":{"verify_error":"/tmp/tmpv1e4f4am/venv/lib/python3.12/site-packages/torch/_subclasses/functional_tensor.py:362: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at /pytorch/torch/csrc/utils/tensor_numpy.cpp:84.)\n  cpu = _conversion_method_template(device=torch.device(\"cpu\"))\n/tm"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/LeonardoCofone/dsalt-library","github":"https://github.com/LeonardoCofone/dsalt-library","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"install_fail","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-09","install_tag":null}}