> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/automodel/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/automodel/_mcp/server.

# nemo_automodel.components.datasets.llm.mock_iterable_dataset

## Module Contents

### Classes

| Name                                                                                                                   | Description                                                       |
| ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| [`MockIterableDataset`](#nemo_automodel-components-datasets-llm-mock_iterable_dataset-MockIterableDataset)             | Mock dataset that generates synthetic data for benchmarking.      |
| [`MockIterableDatasetConfig`](#nemo_automodel-components-datasets-llm-mock_iterable_dataset-MockIterableDatasetConfig) | Construction-time configuration for :class:`MockIterableDataset`. |

### API

```python
class nemo_automodel.components.datasets.llm.mock_iterable_dataset.MockIterableDataset(
    vocab_size: int = 1024,
    seq_len: int = 1024,
    num_samples: int = 1000000,
    batch_size: int = 1
)
```

**Bases:** `IterableDataset`

Mock dataset that generates synthetic data for benchmarking.

This dataset generates random tokens similar to the benchmarking script,
creating input\_ids, labels, and position\_ids for each sample.

```python
nemo_automodel.components.datasets.llm.mock_iterable_dataset.MockIterableDataset.__iter__()
```

Generate synthetic batches.

```python
nemo_automodel.components.datasets.llm.mock_iterable_dataset.MockIterableDataset.__len__()
```

Return the number of samples.

```python
class nemo_automodel.components.datasets.llm.mock_iterable_dataset.MockIterableDatasetConfig(
    vocab_size: int = 1024,
    seq_len: int = 1024,
    num_samples: int = 1000000,
    batch_size: int = 1
)
```

Dataclass

Construction-time configuration for :class:`MockIterableDataset`.

Batch size to yield (1 for unbatched samples).

Total number of samples to generate (1M for an infinite-like dataset).

Sequence length for each sample.

Size of the vocabulary for generating random tokens.

```python
nemo_automodel.components.datasets.llm.mock_iterable_dataset.MockIterableDatasetConfig.build() -> 'MockIterableDataset'
```

Build a :class:`MockIterableDataset` from this :class:`MockIterableDatasetConfig`.