From c4b0ffcb585349272658eab85525303e01021fd1 Mon Sep 17 00:00:00 2001 From: BowenBao Date: Wed, 12 Jun 2024 08:15:53 -0700 Subject: [PATCH] Fix 'get_real_value' on placeholder nodes (#127698) Summary: X-link: https://github.com/pytorch/pytorch/pull/127698 Approved by: https://github.com/jansel ghstack dependencies: #127695, #127696 Reviewed By: clee2000 Differential Revision: D58443884 fbshipit-source-id: 739dc15e745abc83691ee3bae3e29d8fd3bfa44a --- userbenchmark/dynamo/dynamobench/_dynamo/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/userbenchmark/dynamo/dynamobench/_dynamo/utils.py b/userbenchmark/dynamo/dynamobench/_dynamo/utils.py index 63f339fe90..6da8b514f1 100644 --- a/userbenchmark/dynamo/dynamobench/_dynamo/utils.py +++ b/userbenchmark/dynamo/dynamobench/_dynamo/utils.py @@ -1941,6 +1941,9 @@ def get_real_value(node, tracer): lambda n: get_real_value(n, tracer), ) + if op == "placeholder" and "grapharg" in node.meta: + return node.meta["grapharg"].example + if op == "call_module": nn_module = tracer.output_graph.nn_modules[node.target] if not is_lazy_module(nn_module):