Skip to content

videocortex spark.stub

Nicolas Cravino edited this page Aug 30, 2026 · 1 revision

id: videocortex-spark name: videocortex-spark repo_path: ~/Documents/sw30labs/repos/videocortex-spark remote_url: https://github.com/sw30labs/videocortex-spark.git primary_language: Python framework: TRIBE v2 + nilearn (renderer) / PyTorch cu130 (predict extra) category: miscellaneous-research stacks: [cli, neuroscience, dgx] ingested: 2026-08-30 last_commit_date: 2026-08-30

videocortex-spark

Purpose

DGX Spark (GB10) sibling of videocortex. Same encoding instrument around Meta TRIBE v2 — stimulus in, predicted fMRI out, average subject — shaped for Grace Blackwell: CUDA 13, aarch64, 128 GB unified memory. Not a drop-in for the Mac tree. Not a decoder.

Honesty contract

  • Same contract as the laptop tree: average subject, TR ≈ 1.49 s, haemodynamic lag ~5 s, run-wide colour limits. Read output as "this clip drives these cortical regions", never as "this is what someone is thinking".
  • Encoding is not attention. A counting-task clip still drives visual cortex during an unexpected walker; the gorilla is on the retina. Recipe lives in examples/encode-is-not-attention/ — film your own clip, do not vendor anyone else's footage.
  • Wrapper MIT. TRIBE v2 weights CC-BY-NC-4.0. meta-llama/Llama-3.2-3B gated.

Architecture

Eight CLI verbs (doctor, fetch, render, draw, overlay, export, serve, sonify) around the same split install as the Mac tree — renderer (nilearn only) vs .[predict] (tribev2 + cu130 torch, never a bare pip install torch on aarch64).

Spark-shaped differences, not a silent fork of the science:

  • device.py — CUDA else CPU. Refuses a CUDA-12 / CPU aarch64 wheel that imports, reports no GPU, and burns an hour on twenty Arm cores.
  • spark.py / doctor — UMA headroom from /proc/meminfo (MemAvailable), never nvidia-smi (GB10 prints Memory-Usage: Not Supported). Defaults batch_size=4, feature_batch_size=2, num_workers=4. Triton ptxas pinned to CUDA 13 (TRITON_PTXAS_PATH) so the bundled 12.8 assembler does not die on sm_121a. --fast overlay is NVENC, with libx264 fallback.
  • patches.py — whisperx via uvx is pinned --torch-backend cpu / int8 because that env does not inherit the cu130 wheel. Llama 3.2 on CUDA uses SDPA + bfloat16 (Metal's fused SDPA aborts on GQA; CUDA does not).
  • export.pyvideocortex-spark export --run … writes a single self-contained brain.html (fsaverage5 mesh, uint8-quantised prediction, Destrieux table, dependency-free WebGL). No server, no CDN. Colour limits inherited from manifest.json.
  • sonify.py|predicted BOLD| as loudness on one shared scale; occipital / fusiform / parahippocampal Destrieux stand-ins. Overlay --sonify / --sonify-only. Stdlib wave, no librosa.
  • Command deck (web/) — same stdlib loopback :8730 posture. CIRC fix: loadRun used to call show("runs"), which called loadRun back; every visit to the runs view stacked nested invocations, rebuilt the detail pane, and destroyed the <video> mid-load (player flickered at 0:00). show() is now the only place that triggers loadRun. A doctor check absent from a scoped response renders as skipped, not as ?.

Dependencies

Python 3.12 recommended (3.11 works; DGX OS 3.14 on PATH will not import pyannote / whisperx). Renderer: numpy, nilearn, nibabel, matplotlib, scipy, pillow, huggingface_hub. Predict extra: tribev2 from facebookresearch; torch comes from the cu130 index via setup_and_run.sh --predict, not from that extra (tribev2's own deps would otherwise steal a PyPI CPU/CUDA-12 wheel). Dev: pytest. Do not pip install flash-attn (CUDA 12 wheels). MIT wrapper; model is not.

CI/CD

No GitHub Actions. ./setup_and_run.sh (venv + tests + synthetic sample; --predict / --deck). NGC path: nvcr.io/nvidia/pytorch:25.12-py3 (older tags warn GB10 unsupported and hang). make sample / pytest -m "not slow" same as the laptop tree.

Entities and topics

  • videocortex — Apple Silicon / laptop sibling (Metal, GQA eager/float32, VideoToolbox)
  • screen-lens-dgx — the org's other Spark video-in instrument (captions, not cortex)
  • Upstream: TRIBE v2 (d'Ascoli et al., Meta FAIR Brain & AI, 2026; arxiv:2605.04326)
  • Tags: [python, cuda, video, cli, neuroscience, fmri, docker]

Clone this wiki locally