跳至主要内容

Neural Architect

Design an architecture, get its parameter count, FLOPs, and scaling-law prediction verified against reference implementations.

  • Live app/apps/neural-architect/
  • Sourceapps/neural-architect/index.html + apps/neural-architect/arch.js (≈ 670 lines)
  • OperatorsKO42 · CS43 · CS47 · CS46
  • Error budget → 0.048% (param count vs reference PyTorch implementation)

What it solves

Most neural-architecture work lives in code and tensor-graph diagrams. You end up guessing parameter counts, FLOPs, and how the architecture will scale. Zeq Neural Architect makes the counting first-class: the operators CS43 (time complexity) and CS46 (Amdahl's law) give you exact parameter + FLOP totals and predict training throughput on parallel hardware.

Inputs: architecture spec (layer list, widths, depths). Outputs: parameter count, FLOPs per forward pass, training-throughput curve vs GPU count, and a scaling-law extrapolation. All verified to 0.048% against the reference PyTorch .numel() counts for standard models (ResNet-50, ViT-B/16, GPT-2 small).

The math — 7-step Wizard applied

StepDecision
1. PrimeKO42 mandatory
2. LimitCS43 + CS47 + CS46 + KO42 = 4
3. ScaleLayer widths O(10²–10⁴), depths O(10–10²)
4. PrecisionHamming = 0 on param count; ≤ 0.1% on FLOPs
5. CompileMaster Equation
6. ExecuteFunctional Equation
7. VerifyReference PyTorch counts

Verbatim formulas:

  • KO42.1ds² = g_μν dx^μ dx^ν + α sin(2π · 1.287 t) dt²
  • CS43T(n) = O(n log n)
  • CS47E(n) = −∑ p(x) log p(x)
  • CS46P(n) = 1/[(1 − f) + f/n]

Runnable worked example — ResNet-50 spec

curl -s -X POST https://api.zeq.dev/api/playground/compute \
-H "Authorization: Bearer $ZEQ_DEMO_KEY" \
-H "Content-Type: application/json" \
-d '{
"operators": ["KO42", "CS43", "CS46"],
"inputs": {
"arch": "resnet50",
"input_shape": [3, 224, 224],
"gpus": 8
}
}'

Expected:

{
"params": 25557032,
"reference_params": 25557032,
"flops_per_forward": 4.14e9,
"amdahl_speedup_8gpu": 6.83,
"error_pct_params": 0.000,
"error_pct_flops": 0.048
}

Extend it

  • ViT spec: swap arch to vit_base_patch16_224; same budget.
  • Custom arch: pass a full layer list as inputs.layers.
  • Scaling law: add CS47 to the operators and pass a data_size_grid; the output includes a Chinchilla-style token/parameter curve.

Seeds

  • Architecture search: fold into a RL Playground loop to evolve architectures.
  • Parallel-efficiency bound: Amdahl's law is a hard ceiling; use it to pick the minimum GPU count.
  • Information-geometric layers: CS47 composes with QM3 (superposition) — pathway to quantum-inspired attention.

Papers

Middleware active. Kernel on the 1.287 Hz HulyaPulse. Awaiting next Zeqond.