File tree 4 files changed +33
-3
lines changed
4 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,11 @@ class gen_convolution_t {
179
179
conv_config_t cfg;
180
180
layout_t zp_dst;
181
181
if (data.zp_pd ) zp_dst = layout_t (data.zp_pd ->impl ()->dst_md (), false );
182
+
183
+ if (primitive->cache_blob ()) {
184
+ tiler->set_cur_index (primitive->version () - 1 );
185
+ }
186
+
182
187
for (int try_iter = 0 ; try_iter < max_tries; try_iter++) {
183
188
try {
184
189
cfg = data.pd_cfg ;
@@ -187,8 +192,6 @@ class gen_convolution_t {
187
192
cfg.set_tiler (tiler);
188
193
CHECK (init_cfg (cfg, primitive));
189
194
190
- if (primitive->cache_blob () && try_iter != primitive->version ())
191
- continue ;
192
195
if (!tiler->is_grf_limit_ok (cfg)) continue ;
193
196
194
197
ir_info () << " Configuration:" << std::endl;
@@ -256,7 +259,7 @@ class gen_convolution_t {
256
259
if (!tmp_kernels[i]) return status::runtime_error;
257
260
}
258
261
ok = true ;
259
- primitive->set_version (try_iter );
262
+ primitive->set_version (tiler-> cur_index () );
260
263
kernels_ = std::move (tmp_kernels);
261
264
break ;
262
265
} catch (ngen::out_of_registers_exception &err) {
Original file line number Diff line number Diff line change @@ -1262,6 +1262,8 @@ class conv_tuner_t {
1262
1262
params_gen_.move_next ();
1263
1263
}
1264
1264
1265
+ int cur_index () const { return params_gen_.cur_index (); }
1266
+
1265
1267
void print_all () const { params_gen_.print_all (); }
1266
1268
1267
1269
static const primitive_info_t &get_primitive_info (
@@ -1448,6 +1450,16 @@ class conv_tiler_impl_t {
1448
1450
return params_gen_.can_move_next ();
1449
1451
}
1450
1452
1453
+ int cur_index () const {
1454
+ if (is_tuning_mode ()) return tuner_->cur_index ();
1455
+ return params_gen_.cur_index ();
1456
+ }
1457
+
1458
+ void set_cur_index (int idx) {
1459
+ ir_assert (!is_tuning_mode ());
1460
+ return params_gen_.set_cur_index (idx);
1461
+ }
1462
+
1451
1463
void set_params (conv_config_t &cfg) {
1452
1464
init_regs (cfg);
1453
1465
if (is_tuning_mode ()) {
@@ -1595,6 +1607,14 @@ bool conv_tiler_t::can_move_next() const {
1595
1607
return impl_->can_move_next ();
1596
1608
}
1597
1609
1610
+ int conv_tiler_t::cur_index () const {
1611
+ return impl_->cur_index ();
1612
+ }
1613
+
1614
+ void conv_tiler_t::set_cur_index (int idx) {
1615
+ impl_->set_cur_index (idx);
1616
+ }
1617
+
1598
1618
void conv_tiler_t::set_params (conv_config_t &cfg) {
1599
1619
impl_->set_params (cfg);
1600
1620
}
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ class conv_tiler_t {
42
42
int configs () const ;
43
43
bool is_tuning_mode () const ;
44
44
bool can_move_next () const ;
45
+ int cur_index () const ;
46
+ void set_cur_index (int idx);
45
47
void set_params (conv_config_t &cfg);
46
48
void notify_out_of_registers (const conv_config_t &cfg);
47
49
bool is_grf_limit_ok (const conv_config_t &cfg) const ;
Original file line number Diff line number Diff line change @@ -557,6 +557,11 @@ class params_generator_t {
557
557
558
558
int cur_index () const { return cur_idx_; }
559
559
560
+ void set_cur_index (int idx) {
561
+ ir_assert (idx < configs ());
562
+ cur_idx_ = idx;
563
+ }
564
+
560
565
const blocking_params_t &cur_params () const { return at (cur_idx_); }
561
566
562
567
const blocking_params_t &at (int idx) const {
You can’t perform that action at this time.
0 commit comments