Repository navigation
GPUlayer 0.9.0
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_moduleisTrainer.module; the CLI parser'sadd_lightning_class_args
isadd_component_args;utilities.LightningEnumisutilities.CaseInsensitiveEnum;
LitLogger's default folder is./gpulayer_logs. The benchmark scripts moved from
benchmarks/lightning_comparison/tobenchmarks/trainer_comparison/. -
The training loop no longer calls
model.train()every epoch (frozen submodules stay in
eval mode); callmodel.train()beforefitif a model arrives in eval mode (fitwarns). -
PyTorchProfiler's positional arguments afterfilenamefollow the reference order; pass
them by keyword. -
WandbLogger(log_model=...)uploads checkpoints as W&B artifacts instead ofrun.save. -
A bare class name on the CLI (
--data Data) that matches classes in two modules is an error
naming both; givemodule.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;BitsandbytesPrecisionnf4 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) andLOCAL_RANK,
which the Trainer now provides for the run; and jobs did not have their Python'sbin
directory onPATH, so DeepSpeed could not findninjato 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,timeoutand 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
newscripts/compare_api.py. Highlights: SIGTERM saves a resumable checkpoint
and raisesSIGTERMException;trainer.init_module(); FSDP options (sharding strategies,
activation checkpointing, CPU offload, sharded checkpoints) andModelParallelStrategy
(tensor parallelism); DDP communication hooks and post-local SGD;BitsandbytesPrecision
andTransformerEnginePrecision;RichProgressBar,CometLogger,LitLogger,
XLAProfiler; Lightning's CLI hooks, argument links and saved configs; accelerator classes
andgpulayer.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.
fitwarns when the model is in eval mode at the start. -
Trainer:
accelerator="tpu"withdevices="auto"trains on every TPU device of a TPU VM,
as Lightning'sXLAStrategydoes (one process per device throughxmp.spawn, gradients
averaged byxm.optimizer_step, rank 0's checkpoint and metrics loaded in your process).
Batches go throughMpDeviceLoader; metrics, barriers andall_gatheruse 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 throughxm.optimizer_stepandxm.mark_step, and TPU
checkpoints hold CPU tensors. Tested with a simulatedtorch_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_backwardaverages 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.CombinedLoaderfor training; lists for validate/test/predict withdataloader_idx);
validate,testandpredicton 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,AsyncCheckpointIOand
TorchSyncBatchNorm;DeepSpeedStrategyandaccelerator="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'sinstall.sh). The home hero no longer shows agpulayer upbutton. -
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.