Skip to content

Commit 0f12951

Browse files
jianyizhguangyey
authored andcommitted
[Intel gpu] always set deterministic for xpu accuracy test (pytorch#149028)
On Intel Max 1550, models like Super_SloMo can actually pass accuracy test after set deterministic, because we do not use atomic in upsampling bilinear backward in some cases when running on XPU. Furthermore, I guess the only reason not to set deterministic on these models is just avoiding errors. We should use warn_only = True. Pull Request resolved: pytorch#149028 Approved by: https://github.com/guangyey, https://github.com/desertfire Co-authored-by: Yu, Guangye <[email protected]>
1 parent 7ab8532 commit 0f12951

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

benchmarks/dynamo/common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3542,6 +3542,8 @@ def run(runner, args, original_dir=None):
35423542
}:
35433543
# some of the models do not support use_deterministic_algorithms
35443544
torch.use_deterministic_algorithms(True)
3545+
if args.devices == ["xpu"]:
3546+
torch.use_deterministic_algorithms(True, warn_only=True)
35453547
os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8"
35463548
# TODO(eqy): revisit when cuBLASLt workspace size is bumped
35473549
# if args.only is not None and args.only in {

0 commit comments

Comments
 (0)