From 8475ff7f850fac1afd91b7da9d65d5739acebf96 Mon Sep 17 00:00:00 2001 From: Masaki Kozuki Date: Sat, 30 Nov 2024 16:01:32 +0900 Subject: [PATCH] more meticulous bsym check to tell if the trace is bwd Signed-off-by: Masaki Kozuki --- thunder/transforms/tensor_subclasses.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thunder/transforms/tensor_subclasses.py b/thunder/transforms/tensor_subclasses.py index d5473b26f4..5eb2e24119 100644 --- a/thunder/transforms/tensor_subclasses.py +++ b/thunder/transforms/tensor_subclasses.py @@ -257,8 +257,8 @@ def __post_init__(self) -> None: is_backward_trace = maybe_unpack_C0_bsym.args and maybe_unpack_C1_bsym.args and ( maybe_unpack_C0_bsym.sym.id, maybe_unpack_C1_bsym.sym.id, - maybe_unpack_C0_bsym.args[0].name, - maybe_unpack_C1_bsym.args[0].name, + getattr(maybe_unpack_C0_bsym.args[0], "name", ""), + getattr(maybe_unpack_C1_bsym.args[0], "name", ""), ) == ( prims.PrimIDs.UNPACK_SEQUENCE, prims.PrimIDs.UNPACK_SEQUENCE,