docsfaqfaq
FAQ

Frequently Asked Questions (FAQ)

Answers to common architectural, benchmark, and contribution questions about Dark Forest and Entropy Research Lab.

Frequently Asked Questions

Why build Dark Forest in Rust and CUDA?

Production deep learning frameworks ship as multi-gigabyte Python distributions with dynamic caching allocators and deep dispatch layers. Dark Forest explores a compact alternative:

  1. Standalone native binaries (< 12 MB) that compile and execute without a Python interpreter or virtual environment.
  2. Pre-allocated static GPU arenas that claim model weights, activations, gradients, and AdamW moments once at startup, eliminating per-step cudaMalloc/cudaFree jitter.
  3. Explicit strided buffers & iterative tape autograd small enough to inspect end-to-end from high-level layer calls down to host and CUDA kernels.

How does Dark Forest verify numerical parity with PyTorch?

Operators and optimizers run against automated PyTorch 2.4 reference checks before optimizing throughput. In Milestone 1 (tests/milestone1_mlp.py), both runtimes execute a 200-step training loop from identical initial weights and batches; maximum absolute step loss divergence stays within 2.38e-7 across all 200 steps for both SGD and AdamW.

What is Project Maximus?

Project Maximus is the 4-phase roadmap for Dark Forest:

  1. Phase 1: Parity with PyTorch — Eager strided tensors, iterative tape autograd, CUDA kernels, and parity checks for MLP, ResNet-18, and causal transformers.
  2. Phase 2: Parity with TensorFlow — Static computational graph IR, elementwise operator fusion, and standalone binary export.
  3. Phase 3: Parity with JAX — Composable functional transformations (vmap, grad, pmap) and multi-device SPMD sharding.
  4. Phase 4: Native Compilation & Kernel Optimization — [PENDING: Exit criteria to be defined once Phase 1–3 parity milestones complete.]

Is Dark Forest faster than PyTorch?

On small CPU MLP steps (128 → 64 → 1 on Ryzen 9 x86_64) and short-context static FP32/TF32 GPT-2 steps (S = 128), Dark Forest matches or slightly leads PyTorch eager mode. At longer sequence lengths (S = 1,024–4,096), PyTorch SDPA with bf16 mixed precision and activation checkpointing is currently 5x–10x faster and uses less VRAM. Closing that gap (bf16, checkpointing, Tensor Core attention) is the active engineering focus.

How can external contributors get involved?

Review open kernel, parity, and compiler tasks in the Contribution Guide, read the RFC Workflow, or reach out at swasthik@entropy.surf.