Skip to content

Commit 7727610

Browse files
generatedunixname499836121guangyey
authored andcommitted
always set deterministic for xpu accuracy test (#149028)
Summary: 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. X-link: pytorch/pytorch#149028 Approved by: https://github.com/guangyey, https://github.com/desertfire Reviewed By: clee2000 Differential Revision: D72218565 fbshipit-source-id: ecf3fc337c48dc9e16d124ffc50ab444c1af763a Co-authored-by: Yu, Guangye <[email protected]>
1 parent cf97e29 commit 7727610

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

userbenchmark/dynamo/dynamobench/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)