A lightweight engine for slicing a PyTorch tensor into parallel shards
TorchShard TorchShard is a lightweight engine for slicing a PyTorch tensor into parallel shards. It can reduce GPU memory and scale up the training when the model has massive linear layers (e.g., ViT, BERT and GPT) or huge classes (millions). It has the same API design as PyTorch. Installation pip install torchshard More options in INSTALL.md. Usage import torchshard as ts ts.init_process_group(group_size=2) # init parallel groups m = torch.nn.Sequential( torch.nn.Linear(20, 30, bias=True), ts.nn.ParallelLinear(30, 30, bias=True, dim=None), # equal to nn.Linear() […]
Read more 
			 
			 
			 
			 
			 
			 
			 
			 
			