File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,11 @@ status_t brgemm_t::finalize() {
122
122
// compensation on their own as a binary post-op.
123
123
brgemm_desc_.req_s8s8_compensation = false ;
124
124
125
+ // Precompute the pallette
126
+ // If status isn't successful, it means tiles configuration is not required.
127
+ status = brgemm_init_tiles (brgemm_desc_, palette_);
128
+ palette_initialized_ = (status == status::success);
129
+
125
130
return status::success;
126
131
}
127
132
@@ -153,11 +158,8 @@ bool brgemm_t::is_execute_postops_valid() const {
153
158
}
154
159
155
160
status_t brgemm_t::set_hw_context () const {
156
- char palette[AMX_PALETTE_SIZE] = {};
157
- auto status = brgemm_init_tiles (brgemm_desc_, palette);
158
- // If status isn't successful, it means tiles configuration is not required.
159
- if (status == status::success) {
160
- status = amx_tile_lazy_configure (palette);
161
+ if (palette_initialized_) {
162
+ auto status = amx_tile_lazy_configure (palette_);
161
163
VCHECK_BRGEMM_STATUS (
162
164
status, status == status::success, " amx_tile_configure failed" );
163
165
}
Original file line number Diff line number Diff line change 19
19
20
20
#include " cpu/ukernel/c_types_map.hpp"
21
21
22
+ #include " cpu/x64/amx_tile_configure.hpp"
22
23
#include " cpu/x64/brgemm/brgemm_types.hpp"
23
24
24
25
#include " cpu/x64/ukernel/attr_params.hpp"
@@ -95,6 +96,9 @@ struct dnnl_brgemm : public dnnl::impl::c_compatible {
95
96
// it during execute(). This is done to avoid string re-creation.
96
97
dnnl::impl::status_t create_verbose_info ();
97
98
std::string verbose_info_;
99
+
100
+ bool palette_initialized_ = false ;
101
+ char palette_[dnnl::impl::cpu::x64::AMX_PALETTE_SIZE] = {};
98
102
};
99
103
100
104
namespace dnnl {
You can’t perform that action at this time.
0 commit comments