__init__.py 1.3 KB

123456789101112131415161718192021
  1. """Pure-PyTorch stand-in for the parts of `mamba-ssm` that Mage-VL needs.
  2. `microsoft/Mage-VL`'s remote code (`streammind_gate.py`) does
  3. from mamba_ssm.models.mixer_seq_simple import create_block
  4. at module level, and `transformers.dynamic_module_utils.check_imports` imports
  5. every top-level dependency of every remote file before it will load the model —
  6. so `mamba_ssm` must be importable even though only the StreamMind cognition gate
  7. uses it.
  8. The real `mamba-ssm` ships CUDA extensions (`selective_scan_cuda`,
  9. `causal_conv1d_cuda`) with no wheel for the ZeroGPU Blackwell (sm_120) /
  10. torch-2.11 / cp312 runtime, and compiling them from source is not viable inside
  11. a Space build. This package therefore provides a faithful pure-PyTorch port of
  12. Mamba-1 (`mamba_ssm.modules.mamba_simple.Mamba` + `mamba_ssm.modules.block.Block`
  13. with the defaults `create_block` uses: rms_norm=False, fused_add_norm=False,
  14. residual_in_fp32=False, d_intermediate=0) built on the upstream
  15. `selective_scan_ref` reference recurrence, with identical parameter names and
  16. shapes so `streammind_gate.safetensors` loads with `strict=True`.
  17. The gate runs over a handful of EPFE tokens (one per codec canvas), so the slow
  18. sequential scan costs milliseconds — the CUDA kernel buys nothing here.
  19. """
  20. __version__ = "2.2.6.mage-vl-pure-torch"