Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no JIT kernels produced? #227

Open
victorstewart opened this issue Jul 5, 2023 · 3 comments
Open

no JIT kernels produced? #227

victorstewart opened this issue Jul 5, 2023 · 3 comments

Comments

@victorstewart
Copy link

i compiled like so: make static -j CMAKE_OPTIONS='-DCOMPACT=1'

got the ~11.8 MB static library file

root@clr-b5df9984821e4d129387e172044f5754~/xxx/libraries/lib # stat libgraphblas.a
File: libgraphblas.a
Size: 11829168  	Blocks: 23104      IO Block: 4096   regular file

compiled and ran the below code:

g++ -O3 -I/root/xxx/libraries/include /root/xxx/test/factoryKernelExtractor.cpp -L/root/xxx/libraries/lib -Wl,-Bstatic -lgraphblas -lgomp -Wl,-Bdynamic -o factoryKernelExtractor.test
rm -rf GB_JIT_Cache && ./factoryKernelExtractor.test
#include <stdlib.h>
#include <random>

extern "C" {
#include <GraphBLAS/GraphBLAS.h>
}

static void test1()
{
   GrB_Info result;

   uint32_t dimension = 1'000;

   std::random_device rd;
   std::mt19937 gen(rd());
   std::uniform_int_distribution<> dis(0, dimension);

   GrB_Matrix A;
   GrB_Matrix_new(&A, GrB_UINT8, dimension, dimension);
   GxB_Matrix_Option_set(A, GxB_HYPER_SWITCH, GxB_ALWAYS_HYPER);

   for (uint32_t index = 0; index < 5'000; index++)
   {
      uint32_t randomRow = dis(gen);
      uint32_t randomColumn = dis(gen);

      GrB_Matrix_setElement_UINT8(A, uint8_t(1), randomRow, randomColumn);
   }

   GrB_Descriptor invertMaskAndTransposeMatrixFirstThenReplaceOutput;
   GrB_Descriptor_new(&invertMaskAndTransposeMatrixFirstThenReplaceOutput);
   GrB_Descriptor_set(invertMaskAndTransposeMatrixFirstThenReplaceOutput, GrB_MASK, GrB_COMP); // invert the mask
   GrB_Descriptor_set(invertMaskAndTransposeMatrixFirstThenReplaceOutput, GrB_INP0, GrB_TRAN);
   GrB_Descriptor_set(invertMaskAndTransposeMatrixFirstThenReplaceOutput, GrB_OUTP, GrB_REPLACE);

   GrB_Vector mask;
   GrB_Vector_new(&mask, GrB_UINT8, dimension); // column vector

   for (uint32_t index = 0; index < 70; index++)
   {
      uint32_t randomRow = dis(gen);

      GrB_Vector_setElement_UINT8(mask, uint8_t(1), randomRow);
   }

   GrB_Vector input;
   GrB_Vector_new(&input, GrB_UINT8, dimension);

   for (uint32_t index = 0; index < 150; index++)
   {
      uint32_t randomRow = dis(gen);

      GrB_Vector_setElement_UINT8(input, uint8_t(1), randomRow);
   }

   GrB_Vector output;
   GrB_Vector_new(&output, GrB_UINT8, dimension);

   result = GrB_mxv(output, mask, GrB_NULL, GxB_LOR_LAND_BOOL, A, input, invertMaskAndTransposeMatrixFirstThenReplaceOutput);
}

int main()
{
   setenv("GxB_JIT_ERROR_LOG", "/root/GB_JIT.error", 1);
   setenv("GRAPHBLAS_CACHE_PATH", "/root/GB_JIT_Cache", 1);

   GrB_init(GrB_NONBLOCKING);

   test1();

   return 0;
}

GrB_mxv returned GrB_Sucess. no error output. the directory structure was created in GB_JIT_Cache... but no files outputted into /c or libraries created. weird? clearly i'm missing something.

@DrTimothyAldenDavis
Copy link
Owner

If I can't run the JIT (because of a compiler error in user code, unable to write to the cache folder, etc), then I punt to the generic kernel and return GrB_SUCCESS.

Turn on the burble and see what it says.

@DrTimothyAldenDavis
Copy link
Owner

The error log comes from the stderr of the compiler command. If the compiler finds a syntax error or has some other error, the error might not get logged in the error log file.

@victorstewart
Copy link
Author

sorry i'll get to this this week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants