• Stefy Lanza (nextime / spora )'s avatar
    longcat: block-sparse attention is additive, not a replacement (v0.2.74) · df816c76
    Stefy Lanza (nextime / spora ) authored
    v0.2.69 turned the dense backend OFF when enabling BSA, reasoning that
    _process_attn tests enable_bsa first so anything else would be a silent second
    opinion. That is true of SELF-attention and wrong about the model:
    
        attention.py:248, _process_cross_attn
          elif self.enable_xformers: ...
          else: raise RuntimeError("Unsupported attention operations.")
    
    Cross-attention has no enable_bsa branch at all. With the dense backend off,
    every cross-attention call in all 48 blocks raised — the first real BSA run died
    on step 0 of the first generation.
    
    So enable_bsa is now set alongside the chosen dense backend: BSA wins for
    self-attention on video because it is tested first, and cross-attention keeps a
    path to run on.
    
    Measured on the 3090, 29 frames, warm steady-state per step:
      dense  480x832 (30 latent rows)  8.13 s/it
      BSA    448x832 (28 latent rows)  6.34 s/it
    Adjusting for the 6.7% token difference the two geometries force (BSA needs
    sides divisible by 64), that is roughly 10-15% per step — well short of the 16x
    the 0.9375 sparsity suggests, because at this size attention is not the
    dominant cost; the weight-only INT8 linears are. BSA should matter more at 93
    frames and 720p, where attention grows quadratically. It also pays a one-time
    Triton compile of about four minutes per service.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_0185zEBiy3KWB37xNGSrxL7w
    df816c76
Name
Last commit
Last update
codai Loading commit data...
docs Loading commit data...
packaging Loading commit data...
samples Loading commit data...
tests Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.dockerignore Loading commit data...
.gitignore Loading commit data...
AI.PROMPT Loading commit data...
CODERAI_API_DOCUMENTATION.md Loading commit data...
CoderAI.gif Loading commit data...
DISTRIBUTION.md Loading commit data...
LICENSE.md Loading commit data...
MULTIMODAL_CAPABILITIES.md Loading commit data...
MULTIMODAL_UI_EXAMPLES.md Loading commit data...
README.md Loading commit data...
REQUEST-geoclip-embeddings.md Loading commit data...
REQUEST-vpr-embeddings.md Loading commit data...
amdgpu-coredump-05000.bin Loading commit data...
build-oci.sh Loading commit data...
build.ps1 Loading commit data...
build.sh Loading commit data...
coderai Loading commit data...
coderai-broker-implementation-reference.md Loading commit data...
coderai-integration.md Loading commit data...
commands Loading commit data...
osxbuild.sh Loading commit data...
package-oci.sh Loading commit data...
package-tarball.sh Loading commit data...
requirements-crisperwhisper.txt Loading commit data...
requirements-h3.txt Loading commit data...
requirements-longcat-train.txt Loading commit data...
requirements-longcat.txt Loading commit data...
requirements-melotts.txt Loading commit data...
requirements-nemo.txt Loading commit data...
requirements-nvidia.txt Loading commit data...
requirements-ocr-paddle.txt Loading commit data...
requirements-ocr.txt Loading commit data...
requirements-pyannote.txt Loading commit data...
requirements-surya.txt Loading commit data...
requirements-vllm.txt Loading commit data...
requirements-vulkan.txt Loading commit data...
requirements.txt Loading commit data...
run-oci.sh Loading commit data...
smoke-test-oci.sh Loading commit data...
todo.md Loading commit data...