benchmark icon indicating copy to clipboard operation
benchmark copied to clipboard

Fix amp_bf16 train with staged_train_test

Open yanbing-j opened this issue 1 year ago • 3 comments

This PR is to fix the issue of amp_bf16 train with staged_train_test in CPU. Need set forward_contexts correctly with torch.cpu.amp.autocast(dtype=torch.bfloat16), otherwise, in staged_train_test, model cannot run into bf16 successfully.

yanbing-j avatar Mar 15 '24 01:03 yanbing-j

Hi @yanbing-j!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

facebook-github-bot avatar Mar 15 '24 01:03 facebook-github-bot

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

facebook-github-bot avatar Mar 15 '24 02:03 facebook-github-bot

Hi @xuzhao9 @chuanqi129 , could you please help review this PR? Thanks!

yanbing-j avatar Mar 15 '24 02:03 yanbing-j

@xuzhao9 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Mar 27 '24 16:03 facebook-github-bot

@xuzhao9 merged this pull request in pytorch/benchmark@7cf8cb911c43cddad05c3fcd85d953143bf6f4c0.

facebook-github-bot avatar Mar 27 '24 22:03 facebook-github-bot