Skip to content

Commit 9e41835

Browse files
generatedunixname499836121facebook-github-bot
authored andcommitted
Add GPT2ForSequenceClassification to use_larger_multiplier_for_smaller_tensor list (#160001)
Summary: GPT2ForSequenceClassification Hugging Face (HF) model fails on ROCm for bfloat16. The failure is numerically small. This PRs adds this model to an exception list for small tensors. The exception list already includes two models. This increases the multiplier factor to 10.0 instead of 3 (default) for this model used in `torch/_dynamo/utils.py`. In the PR comment below, I include a short analysis of the numerics. X-link: pytorch/pytorch#160001 Approved by: https://github.com/anijain2305, https://github.com/jataylo, https://github.com/jeffdaily Reviewed By: seemethere Differential Revision: D80465664 fbshipit-source-id: 986a0cc2f9e23c73c9ed9e714020ae785c7b4a58
1 parent 6da75d1 commit 9e41835

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

userbenchmark/dynamo/dynamobench/huggingface.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ def use_larger_multiplier_for_smaller_tensor(self, name):
370370
return name in [
371371
"ElectraForQuestionAnswering",
372372
"MegatronBertForQuestionAnswering",
373+
"GPT2ForSequenceClassification",
373374
]
374375

375376
def _get_model_cls_and_config(self, model_name):

0 commit comments

Comments
 (0)