THE OPEN NOTEBOOK · v1.7.3
A book for the curious.
112 chapters inside the Welvet AI engine, including NativeCPU, Qualcomm Hexagon HTP, Apple Metal, Apple MLX, NVIDIA CUDA, AMD ROCm, Vulkan, and Python C-ABI. Start with why it exists, then follow the ideas into layers, learning, and the systems that connect them.
welvet.qnn path — see the Android QNN lab PDF and /welvet. Code examples and reported results below are preserved from the source edition. Read the complete book on one page →18 entries · Clear filters
III · Layers
layers/dense: MatVec microkernel
Most FLOPs are W@x. One Dense stack owns FormatNone×34 and all quants × three backends so every composite proj shares one correctness surface: including native in-dtype SGD.
Read moreIII · Layers
layers/mha: attention
Transformers need multi-head attention with masks, RoPE/ALiBi, GQA/MQA, and cross-attn: without forking MatVec for every projection.
Read moreIII · Layers
layers/swiglu: gated FFN
Modern decoder FFNs are SiLU(gate)⊙up → down. Projections must share Dense’s quant/backend matrix.
Read moreIII · Layers
layers/rmsnorm
Llama-style blocks normalize by RMS, not mean+var. Needs native fwd/bwd and WebGPU shaders.
Read moreIII · Layers
layers/layernorm
Classic mean+var normalization with γ/β: still required for many HF architectures.
Read moreIII · Layers
layers/embedding
Token IDs must gather rows from a table: not a Dense MatVec: with scatter grads on backward.
Read moreIII · Layers
layers/softmax
Classification heads and attention need stable softmax variants, including sparse/Gumbel/Entmax for research paths.
Read moreIII · Layers
layers/sequential
Some cells need an ordered Dense chain without burning grid hops.
Read moreIII · Layers
layers/residual
Skip connections stabilize deep stacks: y = F(x) + x with correct skip grads.
Read moreIII · Layers
layers/cnn1 · cnn2 · cnn3
Conv nets must sit on the same dtype×quant×backend matrix as Dense. im2col → Dense GEMV is the intentional first cut.
Read moreIII · Layers
layers/rnn · lstm
Sequence models before transformers still need vanilla RNN and LSTM with BPTT on the shared MatVec stack.
Read moreIII · Layers
layers/seqmix: mixer contract
Attention, SSM, linear attn, and conv mixers must not be accidental forks of mha. Naming the contract keeps packages honest.
Read moreIII · Layers
layers/gdn: gated delta net
Linear attention / decode-first mixers (Gated DeltaNet) need a first-class package under KindLinearAttn.
Read moreIII · Layers
layers/mamba: selective SSM
SSM mixers (KindSSM) are not MHA clones: they need their own selective-scan path.
Read moreIII · Layers
layers/convt1 · convt2 · convt3
Generators and U-Nets need transposed convolution as a peer of CNN, on the same Dense proj surface.
Read moreIII · Layers
layers/kmeans
Soft clustering as a differentiable layer lets topology experiments sit inside the same train loop.
Read moreIII · Layers
layers/parallel: MoE + cameral
Mixture-of-experts and multi-path cells need concat/add/avg/filter combines. Cameral graphs need sibling hemispheres that share input, merge outputs, and optionally train under distinct mode
Read moreIII · Layers
layers/metacognition
Observed layers can apply heuristic stability rules (gate/scale/reset) without dtype morph/QAT.
Read more