MCPcopy
hub / github.com/deepspeedai/DeepSpeed / random_dataloader

Function random_dataloader

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

Source from the content-addressed store, hash-verified

273
274
275def random_dataloader(model, total_samples, hidden_dim, device, dtype=preferred_dtype()):
276 batch_size = model.train_micro_batch_size_per_gpu()
277 train_dataset = random_dataset(total_samples, hidden_dim, device, dtype=dtype)
278 train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=batch_size)
279 return train_loader
280
281
282def 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…