OjasX 0.6.1: Training a 1B-Parameter LLM in 6.35GB of RAM

OjasX uses system-level memory optimization to let consumer hardware train billion-parameter-scale LLMs.
OjasX v0.6.1 is an open-source project aimed at breaking the "memory wall" in large model training. Through techniques like eliminating activation tapes, online softmax streaming attention, 1-bit ballot masks, and zero persistent gradient buffers, it trains a 1.04B model in FP32 with just 6.35GB RAM vs. PyTorch's 21.1GB. It supports NVIDIA, AMD, Intel, Apple Silicon, and CPU via an MLIR compiler pipeline. A 7B model in BF16 LoRA fine-tuning needs only ~15.5GB.
When it comes to training large language models on local hardware, what's the biggest obstacle? Not enough VRAM. When you try to train a model with over a billion parameters on a consumer GPU or laptop, standard PyTorch often crashes with an out-of-memory error right at startup. The open-source project OjasX, recently sparking discussion in the Reddit community, is trying to break through this bottleneck from the ground up.

The Memory Wall: The Invisible Ceiling of LLM Training
Developer mkrishna793 shared on Reddit his motivation for building OjasX—solving one of the most critical bottlenecks in AI today: the memory wall. In his early versions, OjasX already demonstrated the ability to squeeze a 534M-parameter model into the 9.5GB VRAM of a Tesla T4 for training, while standard PyTorch would crash at 16.4GB.
The latest release, OjasX v0.6.1, pushes this capability further: training a 1.04B-parameter Transformer model in full FP32 precision requires only 6.35GB RAM (standard PyTorch needs 21.1GB). Switching to BF16/FP16 half-precision brings full training down to about 3.25GB, and LoRA fine-tuning down to just 2.6GB.
What does this number mean? A MacBook with 24GB of RAM could, in theory, complete training tasks that previously required an A100.
Core Technology: Eliminating the Activation Tape and Backward Recomputation
The key breakthrough in OjasX v0.6.1 lies in redesigning the memory lifecycle and backpropagation math. Standard PyTorch acts like a hoarder during the forward pass, writing all intermediate activations, attention matrices, and prediction tables into memory, only to reuse them during backpropagation. Even using gradient checkpointing to save memory comes at the cost of recomputing matrix multiplications.
OjasX's approach is to make these intermediate states non-existent in the first place:
Zero-byte attention score matrices: Through online softmax techniques, attention tiles are streamed directly through hardware registers and SRAM, never materializing the massive [B, H, S, S] attention matrix in DRAM.
Zero-byte vocabulary logic tables: When computing cross-entropy over a 32K-128K vocabulary, the standard approach allocates several GB for the final output layer. OjasX chunks the projection and loss computation into streaming operations, automatically skipping padding tokens.
Backward recomputation-free GEMM: ReLU/ReLU2 states are packed into 1-bit hardware ballot masks (32x smaller than FP32), and smooth activations like SiLU/GELU are reconstructed directly in registers.
Zero-byte persistent .grad buffers: Directly hooking into PyTorch's gradient accumulation callback, weights are updated and gradients released immediately after each layer's backward pass, eliminating the need to retain full .grad copies for all parameters.
O(1) memory for deep models: For very deep networks, reversible Hamiltonian coupling chains save only the final boundary state—a 64-layer model uses the same activation tape memory as a 1-layer model.
The developer reveals that the repository contains 558 machine-verified Lean 4 theorems, 28 Rocq 9.2 proof files, and 840 automated PyTorch tests, providing formal guarantees for this non-standard backpropagation mechanism.
Activation Tape is a core concept in deep learning automatic differentiation. During backpropagation, to compute gradients for each layer's parameters, the framework needs the intermediate activations produced during the forward pass. The traditional approach keeps all these activations in memory, forming a "tape" from input to output that is read layer by layer during the backward pass. The memory footprint of this tape is proportional to network depth and batch size, and is the primary cause of VRAM explosions when training large models. Gradient checkpointing compresses the tape by saving only some activations and recomputing the rest, but at the cost of extra compute. OjasX's approach is more radical: by redesigning the mathematical form of the forward and backward passes, it prevents these intermediate states from being materialized at all, effectively decoupling memory usage from model depth.
Online Softmax is the key algorithm behind efficient attention implementations like FlashAttention. Standard Softmax requires traversing an entire row of attention scores, finding the maximum and the sum of exponentials before normalization, thus necessitating the full [B, H, S, S] matrix in memory. Online Softmax rewrites this as a recurrent, streamable update: each tile processed dynamically corrects the existing maximum and normalization factor, achieving identical results while keeping only a few accumulators. Combined with tiling strategies, the attention computation completes entirely within GPU SRAM and registers, never writing the massive score matrix back to DRAM. OjasX leverages this technique to achieve its "zero-byte attention score matrix."
Breaking CUDA Lock-in: Not by FLOPs, but by Memory Efficiency
OjasX is called "open-source CUDA" by its developer, but the logic here deserves careful examination. mkrishna793 admits he cannot beat cuBLAS in raw compute. The real CUDA monopoly isn't about FLOPs—it's that the software ecosystem assumes you have data center-grade VRAM.
OjasX's strategy is to reduce the amount of data that must reside in memory, rather than relying on specific hardware. It integrates a three-stage MLIR compiler pipeline with native C++17/GPU kernels, running on a variety of hardware: NVIDIA GPUs (CUDA/PTX Tensor Cores), AMD GPUs (ROCm/HIP Matrix Cores), Intel GPUs (XPU/SPIR-V/SYCL), Apple Silicon (MPS/Metal 4 SIMDgroup matrices), and multi-core CPUs (AVX2/FMA and ARM64 NEON).
For students, independent developers, and small labs, this hardware agnosticism may be more practically meaningful than pure performance gains.
MLIR (Multi-Level Intermediate Representation) is a next-generation compiler infrastructure within the LLVM ecosystem, designed for building reusable domain-specific compilers. It allows developers to define custom multi-level intermediate representations and dialects, progressively lowering high-level operators (like matrix multiplication, reductions) to target hardware instructions. OjasX's "three-stage MLIR compiler pipeline" uses this framework to automatically rewrite Attention, MLP, Norm, and other layers from PyTorch models into forms suitable for streaming computation, generating corresponding code for different backends—CUDA, ROCm, SPIR-V, Metal, or CPU vector instructions. This enables the same model to run across multiple hardware platforms without modification, and is the key engineering support for achieving "hardware agnosticism."
From 500M to 34B Parameters: Memory Scaling Table and Verification Boundaries
OjasX is not limited to 1B-parameter models. The developer provides a detailed memory scaling table showing the memory requirements for models from 0.5B to 34B in full precision.
Taking a 7B-8B model as an example, standard PyTorch FP32+AdamW requires 140-160GB, while OjasX full training (FP32+Grad-Free SGD) needs only about 35.5-40GB, and LoRA fine-tuning about 31-35GB. In BF16 precision, these numbers roughly halve—meaning a 7B model with Grad-Free SGD training needs only about 17.8GB, and LoRA only about 15.5GB, fitting into a single 24GB GPU or MacBook.
It's important to note the verification status. The developer explicitly labels which results are "verified" and which are "math exact." FP32 training results for 0.5B, 1.04B, and 1.5B have been verified on a 24GB MacBook and a 16GB Colab T4. However, the 3B to 34B data is based on exact mathematical calculations from OjasX's per-tensor memory formulas—because running standard PyTorch comparison tests would require 140GB to 255GB of memory, which would crash his 24GB MacBook.
This level of transparency is rare in open-source projects. The developer also provides a single-command automated benchmark script, inviting community members with 24GB/48GB/80GB+ GPUs or Mac Studios to verify larger model tiers on their own devices.
Formal Verification refers to mathematically proving that a program or algorithm satisfies specific properties under all possible inputs, rather than relying solely on test case coverage. The 558 Lean 4 theorems and 28 Rocq (formerly Coq) proof files in the OjasX repository are a practice of this philosophy. Because OjasX rewrites the mathematical mechanisms of backpropagation and discards many implicit assumptions in standard frameworks, traditional unit testing cannot guarantee its correctness. Formal proofs can confirm at the mathematical level key properties such as the equivalence of gradient computation and the safety of memory lifecycles, providing stronger credibility for this non-standard implementation than testing alone—a distinctive feature of this project compared to ordinary open-source optimization libraries.
Three Lines of Code to Integrate into Existing PyTorch Workflows
Using OjasX is quite straightforward—no need to rewrite model definitions:
import ojasx2
from ojasx2.grad_free_optimizer import HolonomicGradFreeOptimizer
# 1. Automatically rewrite Attention, MLP, Norm, Conv, and Loss layers, lowering to MLIR
model, report = ojasx2.optimize_model(model, prefer_unified_mlp=True, compile_mlir=True)
# 2. Attach the zero persistent gradient optimizer ("adamw" or "sgd")
optimizer = HolonomicGradFreeOptimizer(model.parameters(), lr=3e-4, algorithm="adamw")
# 3. Train normally—weights update in-place during backward(), .grad is released immediately
loss = model(inputs, targets)
loss.backward()
optimizer.step()
This interface hides the underlying complex memory management logic, preserving PyTorch's native training paradigm for users. The model is automatically rewritten during the forward pass into a form suitable for streaming computation, and weights update in real-time during backpropagation.
For researchers and developers constrained by hardware yet eager to deeply engage in large model training, OjasX represents a pragmatic technical path: not pursuing peak compute superiority over existing solutions, but through system-level memory optimization, making previously unattainable training scales accessible to more people. Of course, the actual performance of model tiers above 3B parameters still awaits community verification on larger hardware.
One-line Summary
OjasX uses system-level memory optimization to let consumer hardware train billion-parameter-scale LLMs.
Paragraph Summary
OjasX v0.6.1 is an open-source project aimed at breaking the "memory wall" in large model training, built by developer mkrishna793. Through techniques such as eliminating the activation tape, using online softmax streaming attention, 1-bit ballot masks replacing backward recomputation, and zero persistent gradient buffers, it can train a 1.04B-parameter model in full FP32 precision with only 6.35GB RAM, far below standard PyTorch's 21.1GB. The project supports multiple platforms including NVIDIA, AMD, Intel, Apple Silicon, and CPU, and integrates an MLIR compiler pipeline for hardware agnosticism. A 7B model in BF16 half-precision LoRA fine-tuning requires about 15.5GB, fitting on a single 24GB GPU or MacBook. Data for models above 3B is mathematically exact rather than empirically measured, and the developer invites the community to verify on larger hardware.
Related articles

A Single Prompt Triggers a Global PHP Security Storm: Is AI a Savior or a Hidden Risk?
A single AI prompt triggered a global PHP security crisis affecting Wikipedia and the Internet Archive. This article reviews the incident, analyzes the OpenAI-Amazon controversy, and explores the security paradox of lowered vulnerability discovery barriers in the AI era and developer response strategies.

When AI Is Taken Away: How Reliance on Shortcuts Undermines Your Problem-Solving Resilience
A study of 1,222 people found that after using AI to answer questions, once AI was removed, people gave up on more problems than a control group that never used AI. The article analyzes the impact of AI reliance on learning resilience and metacognition, and explores design implications for AI learning tools.

Carta and NewView Partner to Let Startup Employees Cash Out Equity Early
Carta and NewView Capital partner to simplify startup tender offers, helping employees sell equity early. Analysis of the mechanism, liquidity pain points, and impact.