From 193c2ba12cd4ba68d28bda78a03eebec57c76250 Mon Sep 17 00:00:00 2001 From: Menglu Yu Date: Tue, 27 Aug 2024 16:26:29 -0700 Subject: [PATCH] Fix group fusion stride layout (#2441) Summary: Pull Request resolved: https://github.com/pytorch/benchmark/pull/2441 X-link: https://github.com/pytorch/pytorch/pull/122839 context: https://fb.workplace.com/groups/1075192433118967/permalink/1401282167176657/ moving the changes to the group gemm op has compilation errors, see details in D55606636 Differential Revision: D55449814 --- userbenchmark/dynamo/dynamobench/_dynamo/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/userbenchmark/dynamo/dynamobench/_dynamo/utils.py b/userbenchmark/dynamo/dynamobench/_dynamo/utils.py index c8b2ac7a95..d0b9cd59ad 100644 --- a/userbenchmark/dynamo/dynamobench/_dynamo/utils.py +++ b/userbenchmark/dynamo/dynamobench/_dynamo/utils.py @@ -3203,3 +3203,9 @@ def get_user_object_from_id(obj_id): def store_user_object_weakref(obj): obj_id = id(obj) user_obj_id_to_weakref[obj_id] = weakref.ref(obj) + + +def realize_inputs(inputs: List[torch.fx.Node]): + for inp in inputs: + if isinstance(inp, torch.fx.node.Node): + inp.meta["inductor_realize_to_strides"] = True