Skip to main content

Modular transformer blocks built in PyTorch

Project description

Stackformer logo

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.ymltests/modules, tests/utils
  • model-tests.ymltests/models
  • trainer-tests.ymltests/trainer
  • integration-tests.ymltests/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.py
  • examples/simple_trainer_v2.py
  • examples/train_ddp.py

Installation

pip install .

For development:

pip install ".[dev]"

License

MIT License. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stackformer-0.1.8.tar.gz (48.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stackformer-0.1.8-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

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

Hashes for stackformer-0.1.8.tar.gz
Algorithm Hash digest
SHA256 8d00e92144f04b332d18f829043dec35388ea02419899eaba334d369ad582205
MD5 8740af0f647ef718a3b24245e939f2c1
BLAKE2b-256 484642e0420b6e5fd0c7fdfdff870305b882a302bfaa6bd5296c9fe60dccd2fe

See more details on using hashes here.

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

Hashes for stackformer-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 2775de6828656102baf4228ef5918ef275aaf6a48192a4f1fc95e205d42d7c00
MD5 77977a014303e9998307927f120cf5d4
BLAKE2b-256 f78f808a0c062bbdd2e1d0b3d90a17878a7505f906f493a2050db22a300bbe34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page