-
Notifications
You must be signed in to change notification settings - Fork 11
feature: log number of seen sequence and frames during training for throughput #230
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -506,7 +506,15 @@ def calculate_validation_metrics(val_dataloader, lam): | |||||||||
| # --- Logging --- | ||||||||||
| if args.log: | ||||||||||
| if step % args.log_interval == 0 and jax.process_index() == 0: | ||||||||||
| log_dict = {"loss": loss, "step": step, **metrics} | ||||||||||
| sequences_seen = step * args.batch_size | ||||||||||
| frames_seen = step * args.seq_len * args.batch_size | ||||||||||
|
Comment on lines
+509
to
+510
|
||||||||||
| sequences_seen = step * args.batch_size | |
| frames_seen = step * args.seq_len * args.batch_size | |
| sequences_seen = step * args.batch_size * jax.process_count() | |
| frames_seen = step * args.seq_len * args.batch_size * jax.process_count() |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -482,7 +482,15 @@ def calculate_validation_metrics(val_dataloader, tokenizer): | |||||||||
| # --- Logging --- | ||||||||||
| if args.log: | ||||||||||
| if step % args.log_interval == 0 and jax.process_index() == 0: | ||||||||||
| log_dict = {"loss": loss, "step": step, **metrics} | ||||||||||
| sequences_seen = step * args.batch_size | ||||||||||
| frames_seen = step * args.seq_len * args.batch_size | ||||||||||
|
Comment on lines
+485
to
+486
|
||||||||||
| sequences_seen = step * args.batch_size | |
| frames_seen = step * args.seq_len * args.batch_size | |
| sequences_seen = step * args.batch_size * jax.process_count() | |
| frames_seen = step * args.seq_len * args.batch_size * jax.process_count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These calculations count each sequence and frame multiple times in distributed training scenarios. When using data parallelism across multiple devices, each device processes its own batch independently, but
stepincrements on all devices. This means the totals will be multiplied by the number of processes. Consider multiplying byjax.process_count()to get accurate global counts, or divide by process count if tracking per-process metrics.