Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add total_samples as a field to logs being emitted #326

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

RobotSail
Copy link
Member

Today we emit a number of important values in the logs, but we do not explicitly announce how many samples
we are planning on iterating through. This commit emits total_samples as a field in both the initial log
as well as the subsequent logs during training. This way, this value can be accessed consistently by
any program interested in displaying information about its progress for convenience.

Fixes #325

Signed-off-by: Oleg S [email protected]

Today we emit a number of important values in the logs, but we do not explicitly announce how many samples
we are planning on iterating through. This commit emits total_samples as a field in both the initial log
as well as the subsequent logs during training. This way, this value can be accessed consistently by
any program interested in displaying information about its progress for convenience.

Signed-off-by: Oleg S <[email protected]>
@mergify mergify bot added the one-approval label Nov 8, 2024
@JamesKunstle
Copy link
Contributor

I approved then put the hold- quick q, is len(dataloader.dataset) a cached length value or is it computed each time? we could cache it before we start the loop if it's not cached already.

@RobotSail
Copy link
Member Author

RobotSail commented Nov 11, 2024

@JamesKunstle What is your concern with the calculation of len(dataloader.dataset) if it's not cached? In Python, the __len__ implementation should be $O(1)$. If this isn't the case then it would be a bug that needs to be fixed elsewhere.

@JamesKunstle
Copy link
Contributor

@RobotSail that tends to be the case for inbuilt stuff but this would be a length calculation for our custom Dataset objects. I confirmed that it's O(1) as best as I can tell so this should be good

@JamesKunstle JamesKunstle merged commit ee14d11 into instructlab:main Nov 11, 2024
13 checks passed
@JamesKunstle JamesKunstle removed the hold label Nov 11, 2024
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.

Log the total number of samples
3 participants