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 @@ -1266,6 +1266,8 @@ class conv_tuner_t {
1266
1266
params_gen_.move_next ();
1267
1267
}
1268
1268
1269
+ int cur_index () const { return params_gen_.cur_index (); }
1270
+
1269
1271
void print_all () const { params_gen_.print_all (); }
1270
1272
1271
1273
static const primitive_info_t &get_primitive_info (
@@ -1452,6 +1454,16 @@ class conv_tiler_impl_t {
1452
1454
return params_gen_.can_move_next ();
1453
1455
}
1454
1456
1457
+ int cur_index () const {
1458
+ if (is_tuning_mode ()) return tuner_->cur_index ();
1459
+ return params_gen_.cur_index ();
1460
+ }
1461
+
1462
+ void set_cur_index (int idx) {
1463
+ ir_assert (!is_tuning_mode ());
1464
+ return params_gen_.set_cur_index (idx);
1465
+ }
1466
+
1455
1467
void set_params (conv_config_t &cfg) {
1456
1468
init_regs (cfg);
1457
1469
if (is_tuning_mode ()) {
@@ -1599,6 +1611,14 @@ bool conv_tiler_t::can_move_next() const {
1599
1611
return impl_->can_move_next ();
1600
1612
}
1601
1613
1614
+ int conv_tiler_t::cur_index () const {
1615
+ return impl_->cur_index ();
1616
+ }
1617
+
1618
+ void conv_tiler_t::set_cur_index (int idx) {
1619
+ impl_->set_cur_index (idx);
1620
+ }
1621
+
1602
1622
void conv_tiler_t::set_params (conv_config_t &cfg) {
1603
1623
impl_->set_params (cfg);
1604
1624
}
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 @@ -565,6 +565,11 @@ class params_generator_t {
565
565
566
566
int cur_index () const { return cur_idx_; }
567
567
568
+ void set_cur_index (int idx) {
569
+ ir_assert (idx < configs ());
570
+ cur_idx_ = idx;
571
+ }
572
+
568
573
const blocking_params_t &cur_params () const { return at (cur_idx_); }
569
574
570
575
const blocking_params_t &at (int idx) const {
You can’t perform that action at this time.
0 commit comments