From de3da77cf7f51392be7c8ac9b9a0dab149be938d Mon Sep 17 00:00:00 2001 From: drisspg Date: Fri, 17 Oct 2025 20:26:45 +0000 Subject: [PATCH] Thread deterministic config vars to subproc compilation (#165729) # Summary TIL (AFTER WAYYYY TOO MUCH INSANITY), that we do not serialize the full set of configs for the subproc compilation. I found this while working on Flex-attention determinism: https://github.com/meta-pytorch/attention-gym/pull/168 might be good to audit if we need to thread through any more Pull Request resolved: https://github.com/pytorch/pytorch/pull/165729 Approved by: https://github.com/shunting314, https://github.com/eellison --- torch/_inductor/codegen/triton.py | 1 + torch/_inductor/runtime/triton_heuristics.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/torch/_inductor/codegen/triton.py b/torch/_inductor/codegen/triton.py index a7d29a2fb736..e8d7996460fe 100644 --- a/torch/_inductor/codegen/triton.py +++ b/torch/_inductor/codegen/triton.py @@ -4762,6 +4762,7 @@ class TritonKernel(SIMDKernel[TritonCSEVariable]): "spill_threshold": config.triton.spill_threshold, "store_cubin": config.triton.store_cubin, "deterministic": config.deterministic, + "force_filter_reduction_configs": config.test_configs.force_filter_reduction_configs, } if config.write_are_deterministic_algorithms_enabled: diff --git a/torch/_inductor/runtime/triton_heuristics.py b/torch/_inductor/runtime/triton_heuristics.py index 0dec399de318..44b567bf5ecd 100644 --- a/torch/_inductor/runtime/triton_heuristics.py +++ b/torch/_inductor/runtime/triton_heuristics.py @@ -2962,7 +2962,7 @@ def filter_reduction_configs_for_determinism( def _do_filter_due_to_inductor_config(): return ( inductor_meta.get("deterministic", False) - or torch._inductor.config.test_configs.force_filter_reduction_configs + or inductor_meta.get("force_filter_reduction_configs", False) ) or inductor_meta.get("are_deterministic_algorithms_enabled") if not _do_filter_due_to_inductor_config() or len(configs) == 1: