Skip to content

Commit

Permalink
Intel GPU: specify the tolerance for torchbench models (#125213)
Browse files Browse the repository at this point in the history
We encountered some model accuracy failures as the tolerance is critical. In general, we align with CUDA practice. This PR intends to adjust the tolerance for Torchbench models for training mode on Intel GPU devices and aligns with CUDA.

Pull Request resolved: #125213
Approved by: https://github.com/desertfire
  • Loading branch information
weishi-deng authored and pytorchmergebot committed May 1, 2024
1 parent e3627d0 commit c8d2a55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion benchmarks/dynamo/torchbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def get_tolerance_and_cosine_flag(self, is_training, current_device, name):
if name in self._tolerance["higher_bf16"]:
return 1e-2, cosine

if is_training and current_device == "cuda":
if is_training and (current_device == "cuda" or current_device == "xpu"):
tolerance = 1e-3
if name in self._tolerance["cosine"]:
cosine = True
Expand Down

0 comments on commit c8d2a55

Please sign in to comment.