Skip to content

GPUlayer 0.9.0

Choose a tag to compare

@antonellof antonellof released this 01 Nov 16:58
· 79 commits to main since this release

The Trainer now covers the rest of the reference training API, validated on Tesla T4s for
DeepSpeed, FSDP options, tensor parallelism, DDP hooks, quantized training and TensorRT.

Migrating from 0.8 (breaking changes):

  • GPUlayer's code carries no Lightning names. Removed aliases: glt.LightningModule (use
    glt.Module), glt.LightningDataModule (glt.DataModule), glt.LightningCLI
    (glt.GPULayerCLI), glt.LightningArgumentParser (glt.GPULayerArgumentParser). Renamed:
    Trainer.lightning_module is Trainer.module; the CLI parser's add_lightning_class_args
    is add_component_args; utilities.LightningEnum is utilities.CaseInsensitiveEnum;
    LitLogger's default folder is ./gpulayer_logs. The benchmark scripts moved from
    benchmarks/lightning_comparison/ to benchmarks/trainer_comparison/.

  • The training loop no longer calls model.train() every epoch (frozen submodules stay in
    eval mode); call model.train() before fit if a model arrives in eval mode (fit warns).

  • PyTorchProfiler's positional arguments after filename follow the reference order; pass
    them by keyword.

  • WandbLogger(log_model=...) uploads checkpoints as W&B artifacts instead of run.save.

  • A bare class name on the CLI (--data Data) that matches classes in two modules is an error
    naming both; give module.Class.

  • Validated on 2 Tesla T4 machines over NCCL: DDP communication hooks (fp16 compression, 11%
    faster steps than plain DDP on that network) and post-local SGD (21% faster; replicas
    identical after each averaging step) (benchmarks/results/2026-11-01-aws-2xt4-ddp-hooks/).

  • Home page: no Lightning names outside the benchmark comparisons.

  • Validated on 2 Tesla T4 machines over NCCL (benchmarks/results/2026-11-01-aws-2xt4-parallel/):
    FSDP sharding strategies, activation checkpointing, CPU offload and sharded checkpoints
    (merged across machines, resumed in a second job); tensor parallelism with
    ModelParallelStrategy; Module.to_tensorrt.

  • Fix: a task whose outputs passed the worker's 512 MiB cap returned none of them (the loop
    stopped at the first file over the cap, so an 800 MB checkpoint also dropped the small
    files after it) and said nothing. A file over a limit is now skipped and named in the task's
    system log; the others still upload. The default cap is 4 GiB per task
    (GPULAYER_MAX_OUTPUT_BYTES), 2 GiB per file. Found on AWS T4s with a 67M-parameter model.

  • Sharded checkpoints written on several machines are merged into one folder after the job,
    so they load and resume without a shared filesystem.

  • DeepSpeed validated on Tesla T4s (AWS): ZeRO stages 1 to 3, with and without CPU offload, on
    one machine and across two over NCCL; BitsandbytesPrecision nf4 and int8 on one T4
    (benchmarks/results/2026-11-01-aws-2xt4-deepspeed/). Three bugs found and fixed there:
    DeepSpeed in one process needs a process group (it tried MPI discovery) and LOCAL_RANK,
    which the Trainer now provides for the run; and jobs did not have their Python's bin
    directory on PATH, so DeepSpeed could not find ninja to build its CPU Adam. Workers now
    put it first, as an activated venv does.

  • Fix: sharding a DataLoader across processes dropped persistent_workers,
    prefetch_factor, worker_init_fn, generator, timeout and the multiprocessing context,
    so distributed runs lost the user's loader tuning. They are kept now, as in Lightning.

  • Trainer: Lightning's two speed hints (enable TF32 on Tensor Core GPUs; raise a low
    num_workers), once per process, silenced by
    gpulayer.pytorch.utilities.disable_possible_user_warnings().

  • Trainer: the rest of Lightning's public API (ADR-0024, "Full public API"), checked with the
    new scripts/compare_api.py. Highlights: SIGTERM saves a resumable checkpoint
    and raises SIGTERMException; trainer.init_module(); FSDP options (sharding strategies,
    activation checkpointing, CPU offload, sharded checkpoints) and ModelParallelStrategy
    (tensor parallelism); DDP communication hooks and post-local SGD; BitsandbytesPrecision
    and TransformerEnginePrecision; RichProgressBar, CometLogger, LitLogger,
    XLAProfiler; Lightning's CLI hooks, argument links and saved configs; accelerator classes
    and gpulayer.pytorch.utilities. Tested on CPU (two processes for the distributed parts);
    the GPU-only plugins and hosted loggers against fake packages.

  • Behaviour change, as in Lightning: the training loop no longer calls model.train() every
    epoch, so frozen submodules stay in eval mode; evaluation restores each submodule's mode.
    fit warns when the model is in eval mode at the start.

  • Trainer: accelerator="tpu" with devices="auto" trains on every TPU device of a TPU VM,
    as Lightning's XLAStrategy does (one process per device through xmp.spawn, gradients
    averaged by xm.optimizer_step, rank 0's checkpoint and metrics loaded in your process).
    Batches go through MpDeviceLoader; metrics, barriers and all_gather use XLA collectives,
    so a TPU pod is one run when the script is started on every host, as in Lightning. Manual
    optimization on TPUs steps through xm.optimizer_step and xm.mark_step, and TPU
    checkpoints hold CPU tensors. Tested with a simulated torch_xla (one VM and a two-host
    pod); not run on a TPU. accelerator="hpu" gives an error, as Lightning removed Habana.

  • Docs and site made shorter: the guides, architecture, reference, PyTorch and get-started
    pages lost 30 to 60% of their words with the same commands, settings and status; the
    Trainer page points to the API reference for the full argument list. The compare page is
    now one training-focused capability matrix (GPUlayer, Lightning, Accelerate, Ray, SkyPilot,
    dstack, Modal, Slurm/Kubernetes) with the measured speed against Lightning and when to choose
    something else. The home page drops the quickstart, placement and architecture sections.
    Corrected two stale statements: Trainer DDP on GPUs (validated on RTX 3070s and T4 machines)
    and NCCL across machines in the GPU compatibility matrix.

  • Fix: a worker that finished a task while the control plane was unreachable (a server pod
    restarting) lost the outcome on the refused connection, so the server kept the task running
    and the worker busy. Outcomes are now retried with backoff for up to 2 minutes; a rejection
    is final. Found by the Kubernetes CI job; regression test added.

  • Fix: manual optimization with DDP could hang (seen on a 2-vCPU CI runner). The step no
    longer relies on DDP's reducer internals: manual_backward averages the gradients across
    ranks in one coalesced all-reduce per dtype. Re-validated on 2 Tesla T4 machines over NCCL
    (identical weights on both ranks).

  • Trainer, the rest of Lightning's surface (ADR-0024 amendment): several dataloaders
    (glt.CombinedLoader for training; lists for validate/test/predict with dataloader_idx);
    validate, test and predict on several devices or machines (each rank on its shard,
    results back in the launching process); glt.GPULayerCLI (subcommands,
    --trainer.*/--model.*/--data.*, JSON/YAML configs, class_path); plugins= with
    precision plugins, CheckpointIO, TorchCheckpointIO, AsyncCheckpointIO and
    TorchSyncBatchNorm; DeepSpeedStrategy and accelerator="tpu" (implemented, not run on
    hardware). New guide page: Command line.

  • Install script at a short URL: curl -fsSL https://gpulayer.dev/install.sh | sh (the site
    proxies the repository's install.sh). The home hero no longer shows a gpulayer up button.

  • Site: the home page hero has an animated wireframe landscape (mountains, lakes, hills) behind
    the headline, drawn with three.js loaded after the page renders. It pauses offscreen and in
    hidden tabs, shows one still frame with reduced motion, uses a lighter grid on phones and
    follows the light/dark theme.