Directional spatial scan
Patch tokens follow configurable cross, horizontal, vertical, or raster scan order. Local spatial work stays on the canonical image grid; the mixer sees an ordered visual sequence.
DEFAULT VISUAL ENGINEVISUAL ENTANGLED STATE ATTENTION
Turn image patches into spatial sequences, then let state carry information through the visual field.
VESA brings Entangled State Attention into a shared visual runtime. Choose how image structure is presented—directional scans, ViT-style patches, local convolution, diffusion, or autoregressive visual tokens—while ESA remains the underlying state mixer.
[ ONE VISUAL SURFACE ]
MLBricks separateshow spatial structure is presentedfromwhich sequence mixer processes it. That keeps the visual API consistent while the computational core stays ESA-based.
Patch tokens follow configurable cross, horizontal, vertical, or raster scan order. Local spatial work stays on the canonical image grid; the mixer sees an ordered visual sequence.
DEFAULT VISUAL ENGINEUse a ViT-style image-token path. Withposition="auto", MLBricks resolves to 2-D sinusoidal position for this engine.
A depthwise local convolution handles nearby spatial structure before the ESA mixer processes the ordered patch sequence.
LOCAL + GLOBALPatch-based image input and output with timestep conditioning. The engine exposesforward(images, timesteps)and a benchmark sampling loop.
Visual token IDs are processed causally and can be extended throughgenerate(), giving the same family an autoregressive visual-token mode.
[ VISUAL COMPUTE PATH ]
The classifier path makes the separation explicit: patch creation and spatial policy belong to the visual engine; sequence interaction belongs to the mixer.
[B,C,H,W]
Conv2d → visual tokens
scan / position / local context
state recurrence
standard or MLBricks bricks
classify / denoise / generate
The engine controls scan order, positional representation and local spatial work independently from the sequence-mixing family.
VESA uses ESA state mixing across visual tokens.
Classification returns class logits, Diffusion returns images, and AR returns visual-token logits / generated IDs.
[ COMPOSABLE VISUAL BLOCKS ]
The visual configuration can replace the standard FFN or residual path with MLBricks components without changing the high-level image engine.
Use the conventional MLP path when you want the simplest visual block.
ffn="standard"Carry FFN state across physical visual blocks and condition updates on the current and previous mixer signal.
ffn="ffnbrick"Choose shared virtual refinement or compact micro-refinement paths when the model needs extra iterative computation.
virtual_ffnbrick · micro_ffnbrickReplace raw residual addition with RMS-aware control of update energy and candidate stream growth.
residual="rescontroller"[ RUNTIME ]
Both visual families use the MLBricks backend surface:auto,native, orpytorch. Auto can calibrate a representative inference workload and reuse the selected execution plan.
Use the MLBricks execution planner on representative inputs and keep the selected routes stable for inference.
Use supported native visual operations and mixer kernels when explicitly requested or selected.
Keep a readable PyTorch execution route for compatibility, training, debugging, and parity checks.
model.prepare_execution(images)→model.execution_plan()→model.predict(images)[ SAME VISUAL RUNTIME · DIFFERENT MIXER ]
Use the same visual engine surface with Bolt as the sequence mixer.
[ INSTALLATION · MLBRICKS KIT 1.0.0B1 ]
mlbricks.This component ships inside the unifiedmlbricks-kitdistribution. Python imports continue to use themlbricksnamespace.
pip install mlbricks-kit==1.0.0b1[ QUICK START ]
The same constructor can target classification, diffusion, or autoregressive visual-token work.
import torch
from mlbricks import Vesa
model = Vesa(
image_size=32,
patch_size=4,
num_classes=10,
dim=192,
depth=6,
engine="Serpentine",
position=None,
scan="cross",
backend="auto",
)
images = torch.randn(2, 3, 32, 32)
logits = model(images)[ API · MLBRICKS KIT 1.0.0B1 ]
UseVesafor the high-level visual family. Runtime planning methods are shared across classifier, diffusion, and autoregressive engines where applicable.
from mlbricks import Vesa, VesaConfig
model = Vesa(
image_size=32,
patch_size=4,
num_classes=10,
dim=192,
depth=6,
engine="Serpentine",
backend="auto",
)set_backend(...)Switch the requested runtime policy.
backend_report()Inspect component backend routes.
execution_plan()Read the current hierarchical execution plan.
prepare_execution(...) / predict(...)Calibrate representative inference and run optimized prediction.
generate(...)Available whenengine="AR".
benchmark_sample_loop(...)Available whenengine="Diffusion".
[ POWERED BY ESA ]
Use one visual API across spatial classification, local-plus-sequence models, image denoising, and autoregressive visual tokens.