Skip to content

Commit

Permalink
Enable deterministic support for oneDNN (#127277)
Browse files Browse the repository at this point in the history
Summary:
This PR is a part of RFC pytorch/pytorch#114848.
For the request for Torchbenchmark models, this PR enables the deterministic attribute for the oneDNN operators for XPU backends, like convolution, deconvolution and matmult.

X-link: pytorch/pytorch#127277
Approved by: https://github.com/jgong5, https://github.com/EikanWang, https://github.com/desertfire, https://github.com/gujinghui

Reviewed By: fbgheith

Differential Revision: D58918395

fbshipit-source-id: 333cde99143d7e20ca838c82f5ffc0eb63f33a7c
  • Loading branch information
weishi-deng authored and facebook-github-bot committed Jun 24, 2024
1 parent 4449892 commit a4ad760
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions userbenchmark/dynamo/dynamobench/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3791,6 +3791,8 @@ def run(runner, args, original_dir=None):
torch.backends.cudnn.benchmark = False
torch.backends.cuda.matmul.allow_tf32 = False

torch.backends.mkldnn.deterministic = True

# Remove randomeness when torch manual seed is called
patch_torch_manual_seed()

Expand Down

0 comments on commit a4ad760

Please sign in to comment.