Skip to content

Conversation

ravi-mosaicml
Copy link
Contributor

No description provided.

For the timing abstraction (#146), the `DataloaderSpec` needed two addition functions -- `get_num_samples_in_batch` and `get_num_tokens_in_batch`. It was getting messy to pass around function pointers in a named tuple, so instead converted `DataloaderSpec` from a NamedTuple into a regular class called `DataSpec`. Custom datasets can inherit the base `DataSpec` class and override functionality as needed.

Moved the `DataSpec` class to `composer.core`, as the `DataSpec` is now bound directly to the state. #120 will also need this change.

Renamed `train_dataloader` and `eval_dataloader` in the trainer and state to `train_data` and `eval_data`, since it encompasses more than the dataloader.

This PR implements part 3 and 4 of the timing abstraction (#146). The implementation differs from the GH issue by adding `num_tokens`, `num_samples`, `get_batch_size`, and `get_num_tokens` to the new `DataSpec` rather than the pytorch dataset class.
Base automatically changed from ravi/fix_yapf to dev December 27, 2021 21:34
@ravi-mosaicml ravi-mosaicml merged commit 2907bf0 into dev Jan 4, 2022
@ravi-mosaicml ravi-mosaicml deleted the ravi/ddp_broadcast branch January 4, 2022 23:58
coryMosaicML pushed a commit to coryMosaicML/composer that referenced this pull request Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants