Skip to content

Commit 8026a33

Browse files
authored
[BugFix] Update AttnFusionPass cache key (vllm-project#21947)
Signed-off-by: Richard Zou <zou3519@gmail.com>
1 parent a59cd9d commit 8026a33

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

vllm/compilation/fusion_attn.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,6 @@ def __call__(self, graph: torch.fx.graph.Graph) -> None:
164164
logger.debug("Fused quantization onto %s attention nodes", count)
165165
self.dump_graph(graph, "after_attn_fusion")
166166
self.end_and_log()
167+
168+
def uuid(self):
169+
return VllmInductorPass.hash_source(self, AttentionStaticQuantPattern)

vllm/compilation/inductor_pass.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ def hash_source(*srcs: Union[str, Any]):
7676
for src in srcs:
7777
if isinstance(src, str):
7878
src_str = src
79-
elif isinstance(src, types.FunctionType):
79+
elif isinstance(src, (types.FunctionType, type)):
8080
src_str = inspect.getsource(src)
8181
else:
82+
# object instance
8283
src_str = inspect.getsource(src.__class__)
8384
hasher.update(src_str.encode("utf-8"))
8485
return hasher.hexdigest()

0 commit comments

Comments
 (0)