Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix attn fusion when trailing pointwise has literal #3758

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/targets/gpu/fuse_mlir.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -872,7 +872,10 @@ struct find_mlir_standalone_attention_op
if(contains(r.instructions, "trailing_pm"))
{
auto trailing_pm_ins = r.instructions["trailing_pm"];
auto lit_map = create_param_map_with_literals(
&m_attn, trailing_pm_ins->module_inputs().front(), trailing_pm_ins->get_shape());
m_attn.add_params(trailing_pm_ins->inputs(), &map_main_to_mattn);
map_main_to_mattn.insert(lit_map.begin(), lit_map.end());
std::unordered_map<instruction_ref, instruction_ref> map_pm_to_mattn(map_main_to_mattn);
auto fused_pw_outs = m_attn
.fuse(*trailing_pm_ins->module_inputs().front(),
Expand Down
Loading