Skip to content

The Awakening

Pre-release
Pre-release

Choose a tag to compare

@qwatts-dev qwatts-dev released this 22 Feb 06:39
c0457f6

This release marks the successful completion of the core Proof of Concept. The custom WebGPU runtime is now running the full 30-layer microsoft/bitnet-b1.58-2B-4T model natively in the browser, outputting coherent, context-aware English at ~5 tokens per second.

Key Architectural Updates:

  • Full Neural Stack: Upgraded the engine from a single layer to the complete 30-layer architecture.
  • Llama 3 RoPE: Fixed the Rotary Positional Embedding (RoPE) implementation to correctly use Llama-style rotate_half dimension pairing (paired within heads) and updated the base frequency (ROPE_THETA) to 500000.0.
  • BitLinear Weight Scales: Extracted and implemented the floating-point weight_scale for all 210 ternary matrices, preventing activation explosion during integer math.
  • Sub-Layer Normalization (SubLN): Extracted and wired the 60 learned SubLN vectors required to stabilize the 1.58-bit architecture.
  • Bit-Packing Alignment: Fixed a critical bug in the Python extraction script to correctly interpret Hugging Face's uint8 offset ternary encoding (0b00 -> -1, 0b10 -> +1), restoring the AI's semantic reasoning.
  • Squared ReLU: Swapped the standard SiLU activation for the BitNet-specific ReLU² function.

Performance Benchmarks (Warmed-up Inference):

  • MacBook Pro M2 Max: ~190 ms/token (~5.2 tokens/sec) for the full 2B parameter pipeline.