MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / random_dataloader

Function random_dataloader

tests/unit/simple_model.py:252–256  ·  view source on GitHub ↗
(model, total_samples, hidden_dim, device, dtype=preferred_dtype())

Source from the content-addressed store, hash-verified

250
251
252def random_dataloader(model, total_samples, hidden_dim, device, dtype=preferred_dtype()):
253 batch_size = model.train_micro_batch_size_per_gpu()
254 train_dataset = random_dataset(total_samples, hidden_dim, device, dtype=dtype)
255 train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=batch_size)
256 return train_loader
257
258
259def sequence_dataloader(model, total_samples, hidden_dim, device, seq_len: int = 32, dtype=preferred_dtype()):

Calls 3

preferred_dtypeFunction · 0.85
random_datasetFunction · 0.85