Skip to content

Custom plugin "pack schema"/partitioning error with naive GEMM ref_kernels #866

Open
@Zoragna

Description

@Zoragna

Description

I have initialized a plugin as in https://github.com/flame/blis/blob/master/docs/PluginHowTo.md

I was able to get the dsyrkd kernel running - with a few modifications ( p is both the pointer to the packed matrix and the variable that iterate over the panel_len dimension).

If I remove the custom packing and switch to BLI_GEMM as bli_op for the control tree i.e. I implement the following reference kernel (this is essentially just GEMM)

void naive_gemm
     (
       const obj_t*  alpha,
       const obj_t*  a,
       const obj_t*  b,
       const obj_t*  beta,
       const obj_t*  c,
       const cntx_t* cntx,
       const rntm_t* rntm
     )
{
    bli_init_once();

    if ( bli_error_checking_is_enabled() )
        bli_gemm_check( alpha, a, b, beta, c, cntx );

    if ( bli_l3_return_early_if_trivial( alpha, a, b, beta, c ) == BLIS_SUCCESS )
        return;

    num_t dt = bli_obj_dt( c );
    ind_t im = BLIS_NAT;

    obj_t a_local;
    obj_t b_local;
    obj_t c_local;
    bli_obj_alias_submatrix(  a, &a_local );
    bli_obj_alias_submatrix(  b, &b_local );
    bli_obj_alias_submatrix(  c, &c_local );

    if ( cntx == NULL ) cntx = bli_gks_query_cntx();
    gemm_cntl_t cntl;
    bli_gemm_cntl_init
    (
      im,
      BLIS_GEMM,
      alpha,
      &a_local,
      &b_local,
      beta,
      &c_local,
      cntx,
      &cntl
    );

    bli_gemm_cntl_finalize
    (
      BLIS_GEMM,
      &a_local,
      &b_local,
      &c_local,
      &cntl
    );

    bli_l3_thread_decorator
    ( &a_local, &b_local, &c_local, cntx, ( cntl_t* )&cntl, rntm );
}

I can use the function in the following code

#include <blis.h>

int main(int argc, char** argv) {
	num_t dt_r, dt_c;
	num_t dt_s, dt_d;
	num_t dt_a, dt_b;
	dim_t m, n, k;
	inc_t rs, cs;

	obj_t a, b, D, c_s, c;

	// Create some matrix operands to work with.
	m = 4; n = 5; rs = 0; cs = 0;
	bli_obj_create( BLIS_DOUBLE, m, m, 1, m, &c );
	bli_obj_create( BLIS_DOUBLE, m, n, 1, m, &a );
	bli_obj_create( BLIS_DOUBLE, n, m, 1, n, &b );

	const obj_t* alpha = &BLIS_ONE;
	const obj_t* beta  = &BLIS_ONE;

	bli_randm( &a );
	bli_randm( &b );
	bli_setm( &BLIS_ZERO, &c );

	naive_gemm(alpha, &a, &b, beta, &c, NULL, NULL);

	// Free the objects.
	bli_obj_free( &a );
	bli_obj_free( &b );
	bli_obj_free( &c );
	return 0;
}

However I get the following error upon calling naive_gemm.

libblis: frame/base/bli_part.c (line 354):
libblis: Pack schema not yet supported/implemented for use with partitioning.
libblis: Aborting.

Commit

5d9e110

Environment

I'm not sure it is relevant

  • Hardware : Intel(R) Xeon(R) Platinum 8358 CPU
  • Software : List of modules:
    1. cmake/3.23.3_gcc-10.4.0
    2. intel-oneapi-compilers/2023.0.0_gcc-10.4.0
    3. intel-oneapi-mpi/2021.8.0_gcc-10.4.0
    4. intel-oneapi-mkl/2023.0.0_gcc-10.4.0-intelmpi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions