Skip to content

Laptop fine-tuning (Mac and Linux), backbone policy and order - #3

Merged
akanyaani merged 1 commit into
mainfrom
readme-local
Oct 23, 2026
Merged

akanyaani merged 1 commit into
mainfrom
readme-local

Conversation

@akanyaani

Copy link
Copy Markdown
Contributor

Fine-tuning on a laptop, and a clearer statement of which backbones are supported.

  • Device choice. DECISIONFORMER_DEVICE (cuda, mps, cpu) when set; otherwise CUDA, then Apple silicon (MPS) for single-process runs, then CPU. Loading a model for inference follows the same order. MPS and CPU train in float32. Tests pin the CPU.
  • Training prompts that don't fit have the end of their state truncated by default (data.overflow: truncate_state_end), so one long row no longer stops a run. Loaded and served models still refuse rather than truncate, as the Decision Index requires.
  • New recipe configs/recipes/local_smollm2.yaml: SmolLM2-135M-Instruct on deciformer-15k. It uses micro-batches of 4, a 4,096-token budget per micro-batch, gradient checkpointing, and checkpoints every 100 steps.
  • README:
    • Backbones are the architectures built into transformers; models that need trust_remote_code are not supported.
    • The backbone table is ordered dense, mixture of experts, hybrid, then encoders.
    • New section: "On a laptop (Mac or Linux)".
  • The training log names the device and precision.

Testing

All on Linux (Python 3.12, CPU only, GPU hidden):

  • Full suite: 265 passed, 12 skipped.
  • Laptop recipe forced onto the CPU (DECISIONFORMER_DEVICE=cpu): trained, evaluated, exported, reloaded and answered a request. Peak memory 3.7 GB, about 15 s per step on 6 cores.
  • MPS device selection is covered by a unit test with a mocked device; no run on Apple hardware.

…one order

- Device choice: DECISIONFORMER_DEVICE (cuda, mps, cpu) when set, else CUDA,
  then Apple silicon (MPS) for single-process runs, then CPU. Loading for
  inference follows the same order. Tests stay on CPU.
- data.overflow defaults to truncate_state_end for training and evaluation
  data; loaded and served models still refuse what does not fit.
- configs/recipes/local_smollm2.yaml: SmolLM2-135M-Instruct on
  deciformer-15k with low-memory settings (3.7 GB peak on CPU).
- README: backbones are architectures built into transformers (no
  trust_remote_code models); table ordered dense, mixture of experts,
  hybrid, encoders; new section for fine-tuning on a laptop.
- The training log names the device and precision.
@akanyaani
akanyaani merged commit 7a541dc into main Oct 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant