Skip to content

Releases

GPUlayer 0.11.2

Choose a tag to compare

@antonellof antonellof released this 09 Nov 12:33

Tested on NVIDIA L4 and H200 GPUs and against a real object store. That found one bug, fixed here. Results: benchmarks/results/2026-11-09-hf-strategies-speed/.

Fix

  • TensorFlow and ONNX Runtime jobs ran on the CPU. Both install CUDA libraries with pip but do not find them, even in a plain virtualenv (TensorFlow 2.21, ONNX Runtime 1.31). On Linux a job's LD_LIBRARY_PATH now starts with the nvidia/*/lib folders of its own packages, then the worker's (ADR-0022). Ask for tensorflow[and-cuda] and onnxruntime-gpu[cuda,cudnn]. JAX, CuPy, TensorFlow, ONNX Runtime and Transformers all ran as jobs on an L4, and PyTorch still worked next to TensorFlow in the same process. Upgrade workers to get this fix.

Validated

  • On the 4 GPUs of one machine (4× L4): FSDP (sharding strategies, activation checkpointing, CPU offload, sharded checkpoints with resume), DeepSpeed ZeRO 1 to 3 with offload, tensor parallelism, DDP communication hooks, sync_batchnorm, manual optimization, bitsandbytes and TensorRT. Until now these ran only across machines with one T4 each.
  • 2× H200 with NVLink: topology (NV18), GPU choice, NCCL, FSDP, tensor parallelism and DDP.
  • Notebook forks on 4 L4s: one process per GPU, the trained weights come back.
  • A private Hugging Face bucket (hf://) as the object store: checkpoints, CSV logs, resume, load_from_checkpoint and two DDP processes. Not yet S3, GCS or Azure. Saving waits for the upload.

Measured against PyTorch Lightning

The GPUlayer Trainer was faster in all 14 cases: 1.04 to 1.68x on 1 to 4 L4s, and 1.10 to 2.50x on 1 and 2 H200s. Small models take a few milliseconds per step on an H200, so CPU work per step decides the result, and it varies by host: the same case gave 2.50x on one host and 1.47x on another. The overall count is now 27 of 31 GPU cases.

New

  • scripts/validate_object_store.py <url>.
  • --devices N for validate_parallel.py, validate_deepspeed.py and validate_nccl.py.

Not covered

AMD ROCm and Ryzen AI NPUs, TPUs, and NCCL between multi-GPU machines.

GPUlayer 0.11.1

Choose a tag to compare

@antonellof antonellof released this 09 Nov 11:11

Validated on NVIDIA L4 (4 GPUs), H200 and RTX PRO 6000 Blackwell on Hugging Face Jobs. That found two bugs, both fixed here. Results: benchmarks/results/2026-11-09-hf-gpus/.

Fixes

  • Notebooks on CUDA: Trainer(devices=N) in a notebook failed in every forked process ("Cannot re-initialize CUDA in forked subprocess"), because the Trainer's own CUDA check asked the CUDA driver. It now asks NVML, as Lightning does. If a cell calls torch.cuda.is_available() before fit, the processes say how to avoid it.
  • Automatic resume: a retry could start from the checkpoint before the one saved on SIGTERM and train some steps again. The worker took a checkpoint written a few milliseconds after the previous one, with the same size, as already stored; it now compares contents. Upgrade workers to get this fix.

Validated on GPUs

  • The test suite (with the Lightning conformance tests), CUDA checks and the Trainer's GPU checks on L4, H200 and RTX PRO 6000.
  • TransformerEnginePrecision (FP8) on an L4: FP8 on in the forward pass, the loss within 2% of bf16-true. Transformer Engine 2.20 loads the FP8 state of a checkpoint only with NVTE_ALLOW_UNSAFE_PICKLE_EXTRA_STATE=1; set it only for checkpoints you trust.
  • Exact resume on one GPU (identical weights), resume and torchmetrics sync over NCCL on 4 L4s, notebook forks on 4 L4s.
  • JAX, CuPy and Transformers as GPUlayer jobs on an L4. TensorFlow and ONNX Runtime jobs did not find their CUDA libraries and ran on the CPU.

Not covered

AMD ROCm and Ryzen AI NPUs are still not run on their hardware. After the fix, the notebook check's own line parsing was corrected but not rerun, because no 4-GPU machine was free.

New validation scripts: scripts/validate_parity_gpu.py, scripts/validate_te_fp8.py, and scripts/validate_libraries.py again.

GPUlayer 0.11.0

Choose a tag to compare

@antonellof antonellof released this 07 Nov 19:08

Adds serving models on AMD Ryzen AI NPUs. It has not run on an NPU or with FastFlowLM itself: it
was built from FastFlowLM's source and tested with a stand-in flm. Expect rough edges, and
please report what you find.

  • New: serving models on AMD Ryzen AI NPUs through FastFlowLM (ADR-0026). gl.flm_service("model")
    builds a service with an OpenAI-compatible API; workers report an npu device when flm validate
    passes. Each replica takes an NPU for itself, listens on loopback unless expose=True
    (FastFlowLM has no authentication), and a machine can serve on its NPU while it trains on its GPU.
    The Trainer and launch refuse an NPU with an explanation: FastFlowLM does inference only.
    Implemented and tested with a stand-in flm, not on an NPU. Migration: a worker with a
    ready NPU needs a server of this version.

https://claude.ai/code/session_01JDdTtJNArexH5Jtvd6Bojr

GPUlayer 0.10.1

Choose a tag to compare

@antonellof antonellof released this 07 Nov 18:24

Prepares for AMD GPUs. Nothing here has run on AMD hardware yet: ROCm stays implemented, not
validated. A real ROCm wheel and the rocm/pytorch image were tested on x86 without a GPU.

  • Fix (AMD, found by reading the code; not run on AMD hardware): AMD GPUs had no memory when
    rocm-smi worked, so a job with gpu_memory_gb rejected them; names and memory now come
    from the ROCm build of torch, also where AMD no longer ships rocm-smi. accelerator="gpu"
    raised on a ROCm build and now means its GPUs. A fit on AMD asked for a CUDA capability and could
    say the GPU has NVIDIA's Tensor Cores. Machines with amd-smi or /dev/kfd and no ROCm torch
    now get a note.
  • New: scripts/validate_rocm.sh for the first AMD machine, which also records amd-smi and
    rocm-smi output, since AMD publishes neither JSON format; docs/guides/amd-rocm.md; Docker
    EXTRAS=base-torch for images on rocm/pytorch (built on x86 and started; not run on a GPU).
    The Dockerfile now also installs venv when a base image has Python without it.
  • Docs: ADR-0026 proposes how Ryzen AI NPUs fit in, as a service for inference.

https://claude.ai/code/session_01JDdTtJNArexH5Jtvd6Bojr

GPUlayer 0.10.0

Choose a tag to compare

@antonellof antonellof released this 07 Nov 17:00

Makes the Trainer behave like PyTorch Lightning, not only look like it: tests/conformance runs
the same code on both. Step time is unchanged on an M2 Pro CPU, -1.7% to +0.3% over four runs
(benchmarks/results/2026-11-07-m2pro-parity-fixes/). Read the Migration notes.

  • Fix: self.log(name, metric) with a torchmetrics.Metric raised TypeError. The Trainer
    now computes the metric once at the end of the epoch or evaluation and resets it; the
    metric syncs across processes itself. No new dependency, and no added cost for tensors.
  • Fix: Trainer(max_steps=N) and Trainer(max_time=...) silently stopped after one epoch,
    because max_epochs defaulted to 1; Trainer(min_epochs=5) stopped after one too. The
    default is now max_epochs=None: epochs are unlimited when max_steps or max_time is
    set, and otherwise one epoch (or min_epochs), as before. Migration: runs with
    max_steps larger than one epoch now train longer; max_epochs=None passed explicitly
    meant 1000 epochs and now follows these rules (pass max_epochs=1000); max_epochs=-1
    meant 1000 and now means no limit, as in Lightning.
  • Fix: fit(ckpt_path="last") and "best" raised FileNotFoundError. "last" is now the
    newest last*.ckpt of the Trainer, its ModelCheckpoint folders and the run folder (also
    on a rerun, and in launched jobs); with none, training starts from scratch, as in Lightning.
  • Fix: ModelCheckpoint() monitored val_loss by default, and failed in a model that logged
    another name. The default is now monitor=None (keep the latest), as in Lightning.
    Migration: pass monitor="val_loss" to keep the best by that name.
  • Fix: a URL as default_root_dir, ModelCheckpoint(dirpath=...) or save_checkpoint path
    was written to a local folder named s3:, with no error, so a checkpoint could vanish with
    the machine. Those paths, ckpt_path, load_from_checkpoint and CSVLogger(save_dir=...)
    now go through fsspec (new extra: gpulayer[remote]), and a URL that cannot be served is
    an error when the object is created. URLs with a password are refused. Tested with fsspec's
    in-memory filesystem, not yet against S3, GCS or Azure.
  • Fix: self.log options were ignored. on_step with on_epoch now gives <name>_step and
    <name>_epoch (so EarlyStopping("val_loss_epoch") works), logger=False keeps a value from
    the loggers, and trainer.progress_bar_metrics and logged_metrics hold what Lightning's do.
    Loggers get Lightning's rows: steps from 0 (a value logged at global_step 2 is step 1), an
    epoch column on every row, no epoch_seconds, and evaluation's per-step values under their
    own counter. Values logged in on_*_epoch_end are combined across processes.
    Migration: trainer.callback_metrics no longer has epoch and epoch_seconds, and a
    name logged per step in training_step holds its last value (Lightning's), not the epoch
    mean: log it with on_epoch=True and monitor <name>_epoch for the mean, or read
    trainer.history. callback_metrics is cleared when fit, validate or test starts.
  • Fix: with val_check_interval, validation also ran after the last batch of each epoch, and
    ending a run with max_steps within an epoch validated once more. Validation now runs at
    the interval's multiples only (with val_check_interval=3 and 10 batches: after 3, 6 and 9),
    as in Lightning.
  • New: automatic resume (ADR-0025). launch(max_attempts=N) and
    Trainer(launch_options={"max_attempts": N}) keep the job's newest last.ckpt on the control
    plane while it runs, without making training wait, and start the next attempt from it after a
    lost worker or a SIGTERM. Distributed jobs can now retry: the whole group restarts from the
    checkpoint, after every rank of the old attempt has stopped. New: JobSpec.resume, the retry
    reason preempted, and POST /v1/worker/tasks/{id}/checkpoint. A job with resume needs 0.10
    workers; other jobs run on any worker. Tested with real processes on one machine; not yet on
    a reclaimed cloud VM. from-lightning.md said SLURM's requeue was not needed, which
    overstated what 0.9 did: retries started over.
  • New: exact resume. Checkpoints hold the random number generators and, in one process, a
    resumed run gives bit-identical weights to one that never stopped (tested on CPU with dropout
    and shuffling, at epoch ends and within an epoch). A run resumed within an epoch used to read
    the trained batches again, in a new order, so some samples repeated and others were skipped;
    it now rebuilds the order and skips them in the sampler, without reading them. torchdata's
    StatefulDataLoader is saved and restored, as in Lightning. Across processes the data order
    is exact; each rank's own random numbers are not restored.
  • Fix: checkpoints work both ways with Lightning. A Lightning checkpoint saved within an epoch
    lost the rest of that epoch, and one saved after fit skipped an epoch; fit now reads
    Lightning's loop state. GPUlayer checkpoints load with Lightning's load_from_checkpoint, and
    gpulayer.pytorch.utilities.to_lightning_checkpoint writes one for Lightning's fit.
    Migration: after fit, and in on_train_end, trainer.current_epoch now counts the
    epochs run (Lightning's meaning): one more than before. New checkpoints have next_epoch.
  • Fix (Trainer, Lightning semantics):
    • training_step(self, dataloader_iter) raised TypeError; the step now pulls its own
      batches as (batch, batch_idx, dataloader_idx). In training_step only.
    • None from training_step skipped on_train_batch_end, which now runs with empty
      outputs, and the batch counts in global_step. Migration: step counts of models that
      skip batches go up; schedulers and max_steps count those steps too.
    • on_before_zero_grad ran after the optimizer step; it now runs before backward. When no
      model or callback overrides it or optimizer_zero_grad, gradients are still freed after
      on_train_batch_end, before the next forward pass, which Lightning does not do: peak memory
      stays lower and nothing can observe the difference except code reading .grad inside
      training_step.
    • A second fit with the same Trainer trained again. It now continues from where the first
      stopped, so with its limits reached it does nothing, as in Lightning. Migration: raise
      max_epochs, or use a new Trainer.
    • self.log errors as in Lightning: a tensor of several values (it was averaged), a call in
      a hook nothing collects from (setup, configure_optimizers, on_fit_start,
      on_fit_end, on_train_end, on_validation_end, on_test_end, teardown, ...), and the
      same name twice in a step with different options.
  • New: trainer.strategy has barrier, broadcast, reduce, all_gather,
    reduce_boolean_decision, root_device, the ranks, lightning_module and optimizers;
    trainer.fit_loop (max_epochs can be set), validate_loop, test_loop, predict_loop,
    val_check_batch, lightning_module; Module.hparams_initial, prepare_data_per_node.
    Migration: trainer.max_steps is -1 without a limit (was None); limit_*_batches default
    to 1.0 (were None); num_val_batches and num_test_batches are always lists; with one loader
    trainer.val_dataloaders is that loader, not a list.
  • Docs: "every public name has a counterpart" was overstated. scripts/compare_api.py reads
    source and missed instance attributes such as fit_loop, what classes inherit such as
    hparams_initial, and that trainer.strategy lacked 58 of the 60 attributes of Lightning's.
    Names are now compared on live objects in tests/conformance.
  • New: notebooks. Trainer(devices=N) in a Jupyter kernel forks one process per device and
    returns the weights, instead of packaging the folder of ipykernel_launcher.py (all of
    site-packages) as a job. launch() from a notebook now explains itself. ddp_notebook and
    ddp_fork are accepted. Linux only, tested in CI against a real Jupyter kernel on CPU; not
    run on a GPU. On macOS it stops with an explanation, because forks of a kernel crash there.
  • New: SLURM. Under srun, tasks train in place with SLURM's ranks and the first node as
    rendezvous, where each task used to submit its own job. An sbatch script or srun --pty bash is not taken for a task. Simulated with SLURM's variables on one machine; not run on a
    cluster. With --gpus-per-task, each task uses its only visible GPU.
  • New CI job and tests/conformance: the same code runs on PyTorch Lightning and on the
    Trainer and must behave the same; differences not fixed yet are listed as strict xfails.
    pip install -e '.[conformance]' adds what it needs.

https://claude.ai/code/session_01JDdTtJNArexH5Jtvd6Bojr

GPUlayer 0.9.2

Choose a tag to compare

@antonellof antonellof released this 04 Nov 12:14
  • Fix: a task the control plane's timeout backstop marked timed out kept running on its
    worker while its GPUs went to the next job, and a slow first environment build could
    trigger that backstop although the process had time left. The backstop now counts from
    process start (new worker call POST /v1/worker/tasks/{id}/executing; a worker without
    it gets preparation_allowance_seconds, default 3600, more), and timed-out tasks are
    cancelled on the worker at the next heartbeat. Mixed versions keep working.

  • Fix: a provider API error while reading a cloud instance's state (a 5xx, throttling)
    marked the instance failed and nothing ever terminated it, so the VM kept running and
    billing. State checks are now retried (5 in a row before giving up), and an instance that
    failed or could not be read is terminated, with retries.

  • Fix (Trainer, Lightning semantics):

    • With a loader without a length, the gradients of the last n % accumulate_grad_batches
      batches were carried into the next epoch; they are now applied at the epoch's end
      (one batch read ahead, only for such loaders).
    • Step schedulers with frequency=N stepped after optimizer steps 1, N+1, ... instead of
      N, 2N, ...; ReduceLROnPlateau with interval="step" never stepped. With manual
      optimization the Trainer stepped schedulers itself (Lightning leaves that to the model);
      it no longer does. Migration: manual-optimization models that relied on it call
      self.lr_schedulers().step() in training_step.
    • With check_val_every_n_epoch=None, an integer val_check_interval now counts batches
      across epochs (it could never trigger when longer than an epoch). Mid-epoch validation
      runs only on the epochs check_val_every_n_epoch selects.
    • EarlyStopping counted patience once per training epoch, also on epochs without
      validation, and ignored mid-epoch validations. It now checks after each validation
      unless validation runs exactly once per epoch, as in Lightning, and honours
      check_on_train_epoch_end.
    • Epoch values across processes follow reduce_fx (a "sum" was averaged; max and min
      too), and a mean is over all samples of all ranks. A name logged on only some ranks no
      longer hangs the reduction. Epoch means are weighted by the batch size inferred from the
      batch when batch_size= is not given (a smaller last batch counted as a full one).
    • ModelCheckpoint(every_n_train_steps=...) decided on each rank's own step values; with
      FSDP, where saving is a collective, ranks could decide apart and hang. The step values
      are now averaged across ranks first.
    • Step time unchanged: A/B on an M2 Pro CPU, mlp-cpu, -5.4% to +0.3% over four runs
      (benchmarks/results/2026-11-04-m2pro-loop-fixes/).
  • Home page: the six "What you get" cards show still, flat illustrations in the docs
    diagrams' style (the Trainer API, scaling from one GPU to two machines, the scheduler's
    per-machine reasons, validated hardware, run outputs, a custom loop with launch() and
    Runtime) in place of the animated wireframe scenes. They follow the light and dark theme.

GPUlayer 0.9.1

Choose a tag to compare

@antonellof antonellof released this 02 Nov 07:02
  • Fix: a worker with a nightly or release-candidate PyTorch (for example
    2.3.0.dev20240104) was rejected as "does not satisfy >=0" when packaging older than 25
    was installed, because those versions leave pre-releases out of version ranges by default.
    Pre-releases now count as their version (regression test added).
  • Fix: a job that called the Trainer more than once (fit, then predict or test) could fail
    intermittently with "Gloo connectFullMesh failed ... Connection refused": the process group
    was destroyed after each call, and a rank that finished first joined the next call through
    rank 0's old store. A multi-process group now stays up until the process exits (seen twice
    in CI; regression test added).
  • Home page: dark wireframe scenes for the six features, each a simple looping symbol of
    what the card describes (a still frame with reduced motion), and a dashboard section with
    screenshots of the overview, a distributed job and the workers in one row (click to
    enlarge). Feature cards show two per row on phones.
  • Site: charts and diagrams on the home page and in the docs open full size on a click.
  • Tests: every public name of the reference trainer API is exercised by at least one behaviour
    test (tests/pytorch/test_feature_coverage.py, test_speed_mechanisms.py); check it with
    python scripts/compare_api.py <reference-source> --tests. The speed-mechanism tests run on
    every accelerator present (CPU, Apple GPU, CUDA).
  • Fix: trainer.test_dataloaders, val_dataloaders and predict_dataloaders are set by
    test, validate and predict (they stayed None).

Install: pip install -U gpulayer==0.9.1. Docker: ghcr.io/antonellof/gpulayer:0.9.1 (and :0.9.1-torch).

GPUlayer 0.9.0

Choose a tag to compare

@antonellof antonellof released this 01 Nov 16:58

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.

GPUlayer 0.8.1

Choose a tag to compare

@antonellof antonellof released this 01 Nov 11:53
  • Benchmarks re-measured with the 0.8 Trainer (2026-11-01) and every Trainer chart regenerated:
    one T4 on AWS (GPUlayer Trainer 1.08 to 1.38x faster than Lightning), 4x RTX 3070 on Vast.ai
    (1.26 to 1.60x in 5 of 6 cases, 1.12x slower on the 1-GPU CNN), Apple M2 Pro (1.02 to
    1.80x), and a new chart, one T4 per machine on 2, 4 and 8 AWS machines over NCCL (MLP 1.08
    to 1.29x faster, CNN 1.01 to 1.09x slower), and strong scaling with gloo on 2, 4 and 8 AWS
    machines (17.8% faster on 8). multinode.py and scaling_run.py take the
    worker layout from MN_* variables.

  • Validated on hardware (2026-11-01, 8 AWS g4dn.xlarge, one Tesla T4 each,
    benchmarks/results/2026-11-01-aws-8xt4/): NCCL across machines (DDP on 2, 4 and 8 machines
    with 16-mixed and sync_batchnorm, identical weights on every rank; manual optimization on
    8; FSDP on 2 and 8), and on one T4 Inductor torch.compile, 16-mixed manual optimization,
    16-true/bf16-true, PyTorchProfiler CUDA columns, EMA and device stats.

  • Fix: clip_gradients with manual optimization and 16-mixed unscaled the gradients twice
    (it received the wrapper from self.optimizers()), so such runs did not learn. Found on the
    8-machine run; regression test added.

  • Docs: the NVIDIA guide explains CUDNN_STATUS_SUBLIBRARY_LOADING_FAILED from a system
    LD_LIBRARY_PATH (AWS Deep Learning AMIs) and how to start workers without it.

  • Docs: a generated PyTorch API reference with every public class,
    method, property and hook of gpulayer.pytorch (scripts/make_api_reference.py; a test
    fails when it is out of date or a public member has no docstring). The Trainer guide gains
    a hook-order diagram; callbacks, loggers, profilers and the tuner moved to
    their own page, and Moving from Lightning
    has a side-by-side example and a table of differences.

  • Docstrings for every public member of gpulayer.pytorch; hooks share one description of when
    they run (gpulayer.pytorch.hooks). BackboneFinetuning's default lambda_func is now the
    named function multiplicative, as in Lightning.

  • benchmarks/cloud/aws.sh: instances run in a VPC of their own (gpulayer-bench, with its
    own internet gateway; the default VPC is not used), install uv, PyTorch, Lightning and the
    current GPUlayer commit on first boot (user-data, aws-boot.sh; ready waits for it), and
    take GL_AWS_SPOT=1, GL_AWS_AZ=..., allow/revoke for one outside IP, ssh, ip,
    private-ip and down-network.

  • scripts/validate_trainer_gpu.py (one GPU: Inductor torch.compile, 16-mixed manual
    optimization, "-true" precisions, PyTorchProfiler CUDA columns, EMA, device stats) and
    scripts/validate_nccl.py (DDP with sync_batchnorm, manual optimization and FSDP across
    GPU machines over NCCL).

GPUlayer 0.8.0

Choose a tag to compare

@antonellof antonellof released this 01 Nov 09:25

Lightning feature parity for the GPUlayer Trainer (ADR-0024).

  • Module: every Lightning hook, manual optimization (automatic_optimization = False,
    optimizers(), manual_backward, clip_gradients, toggle_optimizer; also with DDP),
    several optimizers, all configure_optimizers forms including scheduler dicts with
    interval, frequency and monitor (ReduceLROnPlateau), save_hyperparameters/hparams
    (used by load_from_checkpoint), self.log options (reduce_fx, batch_size,
    prog_bar, on_step), log_dict, all_gather, freeze, to_onnx, to_torchscript,
    model-defined dataloaders, LightningModule alias.

  • DataModule (LightningDataModule): prepare_data once per machine, setup(stage),
    loaders, transfer hooks; fit/validate/test/predict(datamodule=...).

  • Trainer arguments: min_epochs, min_steps, limit_test_batches,
    limit_predict_batches, fractional limits, overfit_batches,
    reload_dataloaders_every_n_epochs, use_distributed_sampler, inference_mode (on for
    validate/test/predict), detect_anomaly, sync_batchnorm (CUDA/ROCm), barebones,
    logger, profiler, enable_progress_bar, enable_model_summary,
    deterministic="warn", devices="auto", max_time as a duration; precisions
    bf16-true, 16-true, 64-true and Lightning's short forms; strategy strings and
    DDPStrategy(find_unused_parameters, static_graph, gradient_as_bucket_view, ...);
    torch.compiled models train compiled with their own options.

  • Callbacks: ModelCheckpoint with Lightning's arguments (templates, every_n_train_steps,
    train_time_interval, save_last, save_top_k=-1/0, monitor=None), EarlyStopping
    thresholds, Timer, LambdaCallback, GradientAccumulationScheduler,
    ThroughputMonitor, DeviceStatsMonitor, SpikeDetection, ModelSummary,
    ProgressBar, BasePredictionWriter, OnExceptionCheckpoint,
    StochasticWeightAveraging, WeightAveraging, EMAWeightAveraging, BaseFinetuning,
    BackboneFinetuning, ModelPruning, LearningRateFinder, BatchSizeFinder.

  • Loggers CSVLogger, TensorBoardLogger, WandbLogger, MLFlowLogger; profilers
    SimpleProfiler, AdvancedProfiler, PyTorchProfiler; Tuner.lr_find and
    Tuner.scale_batch_size.

  • Checkpoints use Lightning's layout (optimizer_states, lr_schedulers, callbacks,
    hyper_parameters, scaler; optimizer is still written) and resume within an epoch from
    step checkpoints. Ctrl+C ends fit gracefully after on_exception hooks.

  • Speed: only overridden hooks are called, self.log has a fast path, epoch metrics are
    averaged across ranks in one all-reduce. Step time measured within 1.4% of 0.7.1 on an
    Apple M2 Pro CPU (A/B, benchmarks/results/2026-11-01-m2pro-parity/).

  • Migration: ModelCheckpoint's first positional argument is now dirpath, as in
    Lightning (pass monitor= by name). save_top_k=0 is now valid (keeps none).
    validate/test print their results (verbose=False to silence). Callbacks with the 0.7
    on_train_batch_end(trainer, model, loss, batch_idx) signature keep working.

  • Not validated on GPUs yet: sync_batchnorm, Inductor torch.compile, 16-mixed with manual
    optimization. TensorBoard, W&B and MLflow loggers are untested (optional packages).

  • Deprecated the jax-cuda and cupy-cuda runtime profiles (never run on a GPU). They still
    work and warn; they are removed in 0.9.0. Migration: replace profile="jax-cuda" with
    accelerator="cuda", frameworks={"jax": ">=0.4", "jaxlib": ">=0.4"} (and cupy>=12 for
    cupy-cuda).

  • Fix: gpulayer up --name NAME printed the hostname as the local worker's name; the banner
    now shows NAME, as gpulayer worker status does.

  • Docs and site: the home page terminal has a "Server + client" tab, and the quickstart (site,
    docs and README) walks through gpulayer up, a joined worker and a client training on two
    nodes, with output from a run on one Mac in three terminals.