Skip to content

Commit

Permalink
Update tokens_per_sec to tokens_per_sec_per_gpu (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikayk committed May 11, 2024
1 parent cb8e65a commit dc2b991
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion recipes/full_finetune_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def train(self) -> None:
log_dict = {
"loss": loss_to_log,
"lr": self._optimizer.param_groups[0]["lr"],
"tokens_per_second": num_tokens / time_per_step,
"tokens_per_second_per_gpu": num_tokens / time_per_step,
}
if self._log_peak_memory_stats:
log_dict.update(utils.get_memory_stats(device=self._device))
Expand Down
2 changes: 1 addition & 1 deletion recipes/full_finetune_single_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def train(self) -> None:
if self._optimizer_in_bwd
else self._optimizer.param_groups[0]["lr"]
),
"tokens_per_second": num_tokens / time_per_step,
"tokens_per_second_per_gpu": num_tokens / time_per_step,
}
if self._device.type == "cuda" and self._log_peak_memory_stats:
log_dict.update(utils.get_memory_stats(device=self._device))
Expand Down
2 changes: 1 addition & 1 deletion recipes/lora_dpo_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ def train(self) -> None:
log_dict = {
"loss": loss_to_log,
"lr": self._optimizer.param_groups[0]["lr"],
"tokens_per_second": num_tokens / time_per_step,
"tokens_per_second_per_gpu": num_tokens / time_per_step,
"rewards/chosen": chosen_rewards.mean().cpu(),
"rewards/rejected": rejected_rewards.mean().cpu(),
"rewards/accuracies": reward_accuracies.mean().cpu(),
Expand Down
2 changes: 1 addition & 1 deletion recipes/lora_dpo_single_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def train(self) -> None:
log_dict = {
"loss": loss_to_log,
"lr": self._optimizer.param_groups[0]["lr"],
"tokens_per_second": num_tokens / time_per_step,
"tokens_per_second_per_gpu": num_tokens / time_per_step,
"rewards/chosen": chosen_rewards.mean().cpu(),
"rewards/rejected": rejected_rewards.mean().cpu(),
"rewards/accuracies": reward_accuracies.mean().cpu(),
Expand Down
2 changes: 1 addition & 1 deletion recipes/lora_finetune_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def train(self) -> None:
log_dict = {
"loss": loss_to_log,
"lr": self._optimizer.param_groups[0]["lr"],
"tokens_per_second": num_tokens / time_per_step,
"tokens_per_second_per_gpu": num_tokens / time_per_step,
}
if self._log_peak_memory_stats:
log_dict.update(utils.get_memory_stats(device=self._device))
Expand Down
2 changes: 1 addition & 1 deletion recipes/lora_finetune_single_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def train(self) -> None:
log_dict = {
"loss": loss_to_log,
"lr": self._optimizer.param_groups[0]["lr"],
"tokens_per_second": num_tokens / time_per_step,
"tokens_per_second_per_gpu": num_tokens / time_per_step,
}
if (
self._device.type == "cuda"
Expand Down

0 comments on commit dc2b991

Please sign in to comment.