From 4087d1cccfd3aad8a76da81e126406f8c3a2e6e3 Mon Sep 17 00:00:00 2001 From: Riley Dulin Date: Fri, 15 Nov 2024 13:52:55 -0800 Subject: [PATCH] Remove assert for ArgSchema (#6638) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: In python 3.12, there were a few changes to runtime_checkable: https://docs.python.org/3/whatsnew/3.12.html#typing > The members of a runtime-checkable protocol are now considered “frozen” at runtime as soon as the class has been created. Monkey-patching attributes onto a runtime-checkable protocol will still work, but will have no impact on isinstance() checks comparing objects to the protocol I'm not sure what was monkey-patched here, but EdgeDialectOverloadPacket no longer passes the assert. I'm not sure how to fix this for real, but I just deleted it under the assumption it's not helpful enough to be worth breaking tests. Differential Revision: D65316894 --- exir/pass_base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/exir/pass_base.py b/exir/pass_base.py index 9c97921f51b..a4b5e65263c 100644 --- a/exir/pass_base.py +++ b/exir/pass_base.py @@ -726,7 +726,6 @@ def update(key: K, args: MutableMapping[K, PyTree], schema: ArgSchema) -> None: args[key] = fn(args[key], schema) for i, schema in enumerate(op._schema.arguments): - assert isinstance(schema, ArgSchema) if schema.name in kwargs: update(schema.name, kwargs, schema) elif not schema.kwarg_only and i < len(args):