Commit 8e8d7603 authored by Jared Casper's avatar Jared Casper
Browse files

Merge branch 'github_small_prs' into 'main'

minor changes from github issues

See merge request ADLR/megatron-lm!308
parents bd315c35 60078cf3
...@@ -674,7 +674,7 @@ def get_samples_mapping(indexed_dataset, ...@@ -674,7 +674,7 @@ def get_samples_mapping(indexed_dataset,
# Build samples mapping # Build samples mapping
verbose = torch.distributed.get_rank() == 0 verbose = torch.distributed.get_rank() == 0
start_time = time.time() start_time = time.time()
print_rank_0(' > building sapmles index mapping for {} ...'.format( print_rank_0(' > building samples index mapping for {} ...'.format(
name)) name))
# First compile and then import. # First compile and then import.
from megatron.data import helpers from megatron.data import helpers
...@@ -688,7 +688,7 @@ def get_samples_mapping(indexed_dataset, ...@@ -688,7 +688,7 @@ def get_samples_mapping(indexed_dataset,
seed, seed,
verbose, verbose,
2 if binary_head else 1) 2 if binary_head else 1)
print_rank_0(' > done building sapmles index maping') print_rank_0(' > done building samples index maping')
np.save(indexmap_filename, samples_mapping, allow_pickle=True) np.save(indexmap_filename, samples_mapping, allow_pickle=True)
print_rank_0(' > saved the index mapping in {}'.format( print_rank_0(' > saved the index mapping in {}'.format(
indexmap_filename)) indexmap_filename))
......
...@@ -549,7 +549,7 @@ def training_log(loss_dict, total_loss_dict, learning_rate, iteration, ...@@ -549,7 +549,7 @@ def training_log(loss_dict, total_loss_dict, learning_rate, iteration,
if iteration % args.log_interval == 0: if iteration % args.log_interval == 0:
elapsed_time = timers('interval-time').elapsed() elapsed_time = timers('interval-time').elapsed()
elapsed_time_per_iteration = elapsed_time / total_iterations elapsed_time_per_iteration = elapsed_time / total_iterations
if writer and torch.distributed.get_rank() == 0: if writer:
if args.log_timers_to_tensorboard: if args.log_timers_to_tensorboard:
writer.add_scalar('iteration-time', writer.add_scalar('iteration-time',
elapsed_time_per_iteration, iteration) elapsed_time_per_iteration, iteration)
...@@ -760,7 +760,7 @@ def evaluate_and_print_results(prefix, forward_step_func, ...@@ -760,7 +760,7 @@ def evaluate_and_print_results(prefix, forward_step_func,
string += '{} value: {:.6E} | '.format(key, total_loss_dict[key].item()) string += '{} value: {:.6E} | '.format(key, total_loss_dict[key].item())
ppl = math.exp(min(20, total_loss_dict[key].item())) ppl = math.exp(min(20, total_loss_dict[key].item()))
string += '{} PPL: {:.6E} | '.format(key, ppl) string += '{} PPL: {:.6E} | '.format(key, ppl)
if writer and is_last_rank(): if writer:
writer.add_scalar('{} validation'.format(key), writer.add_scalar('{} validation'.format(key),
total_loss_dict[key].item(), total_loss_dict[key].item(),
iteration) iteration)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment