Skip to content

Commit 89b7863

Browse files
Fix 1m enablement for herk/her2k/syrk/syr2k. (#743)
Details: - Ever since 28b0982, herk, her2k, syrk, and syr2k have been implemented in terms of the gemmt expert API. And since the decision of which induced method to use (1m or native) is made *below* the level of the expert API, executing any of {herk,her2k,syrk,syr2k} results in BLIS checking the enablement status for gemmt. - This commit applies a band-aid of sorts to this issue by modifying bli_l3_ind_oper_get_enable() and bli_l3_ind_oper_set_enable() so that any attempts to query or modify the internal enablement status for herk, her2k, syrk, or syr2k instead does so for gemmt. - This solution isn't perfect since, in theory, the user could enable 1m for, say, herk but then disable it for syrk, and then be confused when herk runs via native execution. But we don't anticipate that users modify 1m enablement at the operation level, and so in practice this solution is likely fine for now.
1 parent 138de3b commit 89b7863

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

frame/3/bli_l3_ind.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,18 @@ void bli_l3_ind_oper_set_enable( opid_t oper, ind_t method, num_t dt, bool statu
201201
if ( !bli_is_complex( dt ) ) return;
202202
if ( !bli_opid_is_level3( oper ) ) return;
203203

204+
// BLIS currently implements herk/her2k/syrk/syr2k in terms of the user-
205+
// level gemmt (expert) API, and so those operations choose to execute
206+
// 1m (or not) based on the induced method enablement status of gemmt.
207+
// In other words, changing the enablement status of those operations
208+
// would have no effect. Therefore, we redirect queries/accesses to those
209+
// operations' induced method enablement statuses to that of gemmt.
210+
if ( method != BLIS_NAT && ( oper == BLIS_HERK ||
211+
oper == BLIS_HER2K ||
212+
oper == BLIS_SYRK ||
213+
oper == BLIS_SYR2K ) )
214+
oper = BLIS_GEMMT;
215+
204216
// Disallow changing status of native execution.
205217
if ( method == BLIS_NAT ) return;
206218

@@ -224,6 +236,18 @@ bool bli_l3_ind_oper_get_enable( opid_t oper, ind_t method, num_t dt )
224236
num_t idt = bli_ind_map_cdt_to_index( dt );
225237
bool r_val;
226238

239+
// BLIS currently implements herk/her2k/syrk/syr2k in terms of the user-
240+
// level gemmt (expert) API, and so those operations choose to execute
241+
// 1m (or not) based on the induced method enablement status of gemmt.
242+
// In other words, changing the enablement status of those operations
243+
// would have no effect. Therefore, we redirect queries/accesses to those
244+
// operations' induced method enablement statuses to that of gemmt.
245+
if ( method != BLIS_NAT && ( oper == BLIS_HERK ||
246+
oper == BLIS_HER2K ||
247+
oper == BLIS_SYRK ||
248+
oper == BLIS_SYR2K ) )
249+
oper = BLIS_GEMMT;
250+
227251
{
228252
r_val = bli_l3_ind_oper_st[ method ][ oper ][ idt ];
229253
}

0 commit comments

Comments
 (0)