﻿# LoFT CPU LoRA: the laptop experiment and its memory caveat

LoFT reports TinyLlama adaptation on an 8 GB laptop, but its code records endpoint RSS rather than a continuous memory peak.

Author: Retrivium editorial team
Updated: 2026-11-05
Canonical URL: https://retrivium.ai/journal/loft-cpu-lora-laptop-memory-measurement/
Language: en

LoFT is a small CPU-oriented workflow for adapting TinyLlama and exporting a model for local inference. Its interesting result is a laptop proof of concept with inspectable code. The published memory table needs a substantial qualification: the training script does not measure a continuous peak.

## What the laptop demonstration establishes

The [LoFT README](https://github.com/diptanshu1991/LoFT) reports a MacBook Air with 8 GB RAM, a 20-example instruction dataset and 23 minutes for adapter training. A separate 300-example run reportedly took 1.5 hours for 2 epochs. These are author observations, without a controlled held-out quality comparison. They establish a reported working path through a small experiment, rather than a general laptop capacity guarantee.

The current repository also says development stopped in 2025. That matters when assessing whether old dependency combinations, conversion tools and model-loading behavior remain reproducible. The code is research material to inspect, with maintenance status preserved alongside the experiment.

## Why the RAM column is not a measured peak

In [train.py](https://github.com/diptanshu1991/LoFT/blob/main/loft/train.py), the process reads its resident memory before loading the model and again after training and saving. It prints the larger endpoint under a peak-memory label. Intermediate allocations are never sampled by that calculation. Thus the README's 308 MB training figure cannot establish maximum process RSS, maximum system memory use or a complete training requirement.

A replication would need a recorder spanning model loading, forward and backward passes, optimizer updates and saving. Child processes and system pressure should be accounted for separately where relevant. Recording that trace would answer the memory question; subtracting or relabeling the published endpoint cannot reconstruct missing observations. The general [LoRA memory guide](/journal/lora-qlora-memory/) explains why adapter size alone is insufficient.

## The training objective is unusually short

The inspected script constructs instruction, optional input and response as a plain text sequence. It truncates and pads to 128 tokens, then copies input identifiers into labels. This is not an explicitly implemented answer-only mask. Long instructions can leave little room for a response, and padding targets deserve inspection before interpreting the loss.

These details make the supplied examples part of the experiment's specification. A successful optimizer run cannot show that a longer document or a different conversation format will train correctly. [Answer-only supervision](/journal/supervised-finetuning-answer-loss/) provides the relevant distinction between context visibility and which predictions receive loss.

## Export quantization is a separate stage

LoFT separates adapters, a merged Hugging Face checkpoint, GGUF export and Q4_0 inference quantization. A small final file does not prove that training used a quantized base. The reviewed loading path does not configure such base quantization. Likewise, a CPU demonstration does not mean every library automatically selects identical devices on another machine.

The [PEFT explanation of LoRA](https://huggingface.co/docs/peft/main/en/conceptual_guides/lora) describes frozen base weights and trainable low-rank updates. The base still participates in computation. Merging and conversion therefore need their own storage, memory and output checks, distinct from the small adapter artifact.

## What would turn the example into stronger evidence

Preserve the repository revision, base checkpoint, tokenizer, dependency versions and actual serialized examples. Compare the original model, reloaded adapter, merged model and quantized deployment on the same held-out task. Record failures as well as successful responses. That would separate learning effects from export or quantization changes and make a laptop adaptation claim substantially more useful than completion of the pipeline alone.
