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

Xcloud #27

Merged
merged 5 commits into from
Feb 2, 2023
Merged

Xcloud #27

merged 5 commits into from
Feb 2, 2023

Conversation

Hanjun-Dai
Copy link
Collaborator

stablize jobs

  • xm train/load
  • fix grad explosion issue

@Hanjun-Dai Hanjun-Dai requested a review from kensens January 27, 2023 05:56
Copy link
Collaborator

@kensens kensens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Hanjun! I left a few comments

@@ -48,8 +48,8 @@ def main(argv) -> None:
uname = getpass.getuser()

with xm_abc.create_experiment(experiment_title=_EXP_NAME.value) as experiment:
job_requirements = xm.JobRequirements(ram=26 * FLAGS.num_gpus * xm.GiB,
cpu=7 * FLAGS.num_gpus,
job_requirements = xm.JobRequirements(ram=8 * FLAGS.num_gpus * xm.GiB,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it needed to reduce our resource consumption here? We can request the amount we were using before: https://g3doc.corp.google.com/company/teams/brain-frameworks/xcloud/guide.md?cl=head

@@ -191,7 +191,8 @@ def _gather_eval_info(rank, device, local_acc, local_num):


def train_eval_loop(args, device, model, train_files, eval_tasks,
task_gen, trace_gen):
task_gen, trace_gen, checkpoint):
random.shuffle(train_files)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't shuffle train_files so that training runs are more consistent/reproducible

if checkpoint is not None:
model.load_state_dict(checkpoint['model'])
optimizer.load_state_dict(checkpoint['optimizer'])
starting_step = checkpoint['step']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we skip starting_step batches from the training dataset, so that we don't train on the same data again upon restart? I think this is just:

for _ in range(starting_step):
  next(train_gen)

@Hanjun-Dai Hanjun-Dai merged commit 3d6d921 into main Feb 2, 2023
@kensens kensens deleted the xcloud branch December 8, 2023 08:30
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