Home / Function/ setup_determinism_for_accuracy_test() — pytorch Function Reference

setup_determinism_for_accuracy_test() — pytorch Function Reference

Architecture documentation for the setup_determinism_for_accuracy_test() function in common.py from the pytorch codebase.

Entity Profile

Dependency Diagram

graph TD
  38450aa4_71f1_69e7_9cbc_303c60b75b96["setup_determinism_for_accuracy_test()"]
  c9be2096_e6d7_2374_ad2e_a6e33f435ada["run()"]
  c9be2096_e6d7_2374_ad2e_a6e33f435ada -->|calls| 38450aa4_71f1_69e7_9cbc_303c60b75b96
  style 38450aa4_71f1_69e7_9cbc_303c60b75b96 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

benchmarks/dynamo/common.py lines 3832–3867

def setup_determinism_for_accuracy_test(args):
    if args.only is not None and args.only not in {
        "alexnet",
        "Background_Matting",
        "pytorch_CycleGAN_and_pix2pix",
        "pytorch_unet",
        "Super_SloMo",
        "vgg16",
        # https://github.com/pytorch/pytorch/issues/96724
        "Wav2Vec2ForCTC",
        "Wav2Vec2ForPreTraining",
        "sam",
        "sam_fast",
        "resnet50_quantized_qat",
        "mobilenet_v2_quantized_qat",
        "detectron2_maskrcnn",
        "detectron2_maskrcnn_r_101_c4",
        "detectron2_maskrcnn_r_101_fpn",
        "detectron2_maskrcnn_r_50_c4",
        "detectron2_maskrcnn_r_50_fpn",
        "detectron2_fasterrcnn_r_101_c4",
        "detectron2_fasterrcnn_r_101_dc5",
        "detectron2_fasterrcnn_r_101_fpn",
        "detectron2_fasterrcnn_r_50_c4",
        "detectron2_fasterrcnn_r_50_dc5",
        "detectron2_fasterrcnn_r_50_fpn",
    }:
        # some of the models do not support use_deterministic_algorithms
        torch.use_deterministic_algorithms(True)

    if args.devices == ["rocm"]:
        torch.use_deterministic_algorithms(True, warn_only=True)

    torch.backends.cudnn.deterministic = True
    torch.backends.cudnn.benchmark = False
    torch.backends.mkldnn.deterministic = True

Subdomains

Called By

Frequently Asked Questions

What does setup_determinism_for_accuracy_test() do?
setup_determinism_for_accuracy_test() is a function in the pytorch codebase.
What calls setup_determinism_for_accuracy_test()?
setup_determinism_for_accuracy_test() is called by 1 function(s): run.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free