PyTorch training framework built on experimaestro and Lightning Fabric.
The full documentation is at xpm-torch.readthedocs.io:
- Overview — what's in the package and how it fits together
- Module system —
Module,ModuleLoaderand safetensors serialization - Training —
Learner, trainers, checkpointing and validation - Optimization — optimizers, schedulers and gradient hooks
- HuggingFace Hub — export actions, pushing and loading models
- Several CUDA versions —
xpm-torch uv-cuda-sync, one environment per torch build, chosen on each SLURM node
- Module system:
Modulebase class combining experimaestroConfigwithtorch.nn.Module, with safetensors serialization - Training:
Learnertask with checkpointing, validation listeners, and TensorBoard logging - HuggingFace Hub: Upload/download models via
ExperimaestroHFHub(from experimaestro) - Distributed training: Lightning Fabric integration for multi-GPU/node training
- Several CUDA versions:
xpm-torch uv-cuda-synccreates one uv environment per torch build (e.g. cu126 and cu130), and experimaestro runs each job with the one matching the GPU of its node
pip install xpm-torchfrom xpm_torch.module import Module
from experimaestro import Param
import torch
import torch.nn as nn
class MyModel(Module):
input_dim: Param[int]
hidden_dim: Param[int]
def __initialize__(self):
self.fc1 = nn.Linear(self.input_dim, self.hidden_dim)
def forward(self, x):
return self.fc1(x)
# Create config, then instance
cfg = MyModel.C(input_dim=50, hidden_dim=100)
model = cfg.instance()
model.initialize()
# Save/load with safetensors
from pathlib import Path
model.save_model(Path("checkpoint/model"))
model.load_model(Path("checkpoint/model"))GPL-3.0