Modular transformer blocks built in PyTorch
Project description
Stackformer
Project Overview
Stackformer is a modular deep learning training framework built on PyTorch for transformer-based experimentation and production-style training loops. It combines reusable model building blocks with a trainer/engine stack designed for stability, extensibility, and CPU/GPU portability.
Features
- Modular trainer architecture with separated state, engine, and trainer APIs.
- AMP mixed precision training support.
- Distributed training support via DDP.
- Flexible logging backends (CSV, TensorBoard, Weights & Biases).
- Metrics system for tracking and aggregation.
- Checkpointing and resume support.
- Modular model architecture (OpenAI/Meta/Google-style models + encoder-decoder transformer).
- Robust CI testing pipeline with split workflows.
V3 Milestone
V3 introduces a stronger training infrastructure focused on practical deep learning workflows:
- AMP support.
- DDP support.
- Centralized metrics system.
- Modular training engine (state + step execution + high-level trainer orchestration).
CI & Testing
Stackformer now uses a multi-workflow CI pipeline:
core-tests.yml→tests/modules,tests/utilsmodel-tests.yml→tests/modelstrainer-tests.yml→tests/trainerintegration-tests.yml→tests/integration
Highlights:
- Python version matrix for 3.9, 3.10, and 3.11.
- CPU-safe training tests for portability.
- Integration coverage for model training, save/load, and checkpoint resume.
Examples
Available training examples:
examples/simple_train.pyexamples/simple_trainer_v2.pyexamples/train_ddp.py
Installation
pip install .
For development:
pip install ".[dev]"
License
MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stackformer-0.1.8.tar.gz.
File metadata
- Download URL: stackformer-0.1.8.tar.gz
- Upload date:
- Size: 48.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d00e92144f04b332d18f829043dec35388ea02419899eaba334d369ad582205
|
|
| MD5 |
8740af0f647ef718a3b24245e939f2c1
|
|
| BLAKE2b-256 |
484642e0420b6e5fd0c7fdfdff870305b882a302bfaa6bd5296c9fe60dccd2fe
|
File details
Details for the file stackformer-0.1.8-py3-none-any.whl.
File metadata
- Download URL: stackformer-0.1.8-py3-none-any.whl
- Upload date:
- Size: 63.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2775de6828656102baf4228ef5918ef275aaf6a48192a4f1fc95e205d42d7c00
|
|
| MD5 |
77977a014303e9998307927f120cf5d4
|
|
| BLAKE2b-256 |
f78f808a0c062bbdd2e1d0b3d90a17878a7505f906f493a2050db22a300bbe34
|