Skip to content

Add host lib#1134

Merged
illsilin merged 31 commits intodevelopfrom
host-lib
Mar 6, 2024
Merged

Add host lib#1134
illsilin merged 31 commits intodevelopfrom
host-lib

Conversation

@pfultz2
Copy link
Contributor

@pfultz2 pfultz2 commented Jan 18, 2024

This adds the host lib which can generate instances and can be used for runtime compilation.

@junliume
Copy link
Contributor

@JehandadKhan could you help to review this? And maybe ask @atamazov

@JehandadKhan
Copy link
Contributor

@pfultz2 I am unable to run the tests in the host directory
Here is what I get

# make check
[ 96%] Built target embed_lib_ck_headers
[ 98%] Built target ck_host
[ 99%] Built target ck_rtc
[ 99%] Building CXX object test/CMakeFiles/test_host_gemm_multiple_d.dir/gemm_multiple_d.cpp.o
/data/repos/composable_kernel/host/test/gemm_multiple_d.cpp:115:64: error: call to 'isnan' is ambiguous
        if(std::any_of(x.begin(), x.end(), [](auto y) { return std::isnan(y); }))
                                                               ^~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/predefined_ops.h:283:16: note: in instantiation of function template specialization 'check_all<_Float16>::operator()(const rtc::buffer<_Float16> &)::(anonymous class)::operator()<_Float16>' requested here
        { return bool(_M_pred(*__it)); }
                      ^
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_algo.h:120:8: note: in instantiation of function template specialization '__gnu_cxx::__ops::_Iter_pred<(lambda at /data/repos/composable_kernel/host/test/gemm_multiple_d.cpp:115:44)>::operator()<const _Float16 *>' requested here
          if (__pred(__first))
              ^
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_algo.h:161:14: note: in instantiation of function template specialization 'std::__find_if<const _Float16 *, __gnu_cxx::__ops::_Iter_pred<(lambda at /data/repos/composable_kernel/host/test/gemm_multiple_d.cpp:115:44)>>' requested here
      return __find_if(__first, __last, __pred,
             ^
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_algo.h:3969:19: note: in instantiation of function template specialization 'std::__find_if<const _Float16 *, __gnu_cxx::__ops::_Iter_pred<(lambda at /data/repos/composable_kernel/host/test/gemm_multiple_d.cpp:115:44)>>' requested here
      return std::__find_if(__first, __last,
                  ^
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_algo.h:526:40: note: in instantiation of function template specialization 'std::find_if<const _Float16 *, (lambda at /data/repos/composable_kernel/host/test/gemm_multiple_d.cpp:115:44)>' requested here
    { return __last == _GLIBCXX_STD_A::find_if(__first, __last, __pred); }
                                       ^
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_algo.h:544:20: note: in instantiation of function template specialization 'std::none_of<const _Float16 *, (lambda at /data/repos/composable_kernel/host/test/gemm_multiple_d.cpp:115:44)>' requested here
    { return !std::none_of(__first, __last, __pred); }
                   ^
/data/repos/composable_kernel/host/test/gemm_multiple_d.cpp:115:17: note: in instantiation of function template specialization 'std::any_of<const _Float16 *, (lambda at /data/repos/composable_kernel/host/test/gemm_multiple_d.cpp:115:44)>' requested here
        if(std::any_of(x.begin(), x.end(), [](auto y) { return std::isnan(y); }))
                ^
/data/repos/composable_kernel/host/test/gemm_multiple_d.cpp:181:37: note: in instantiation of member function 'check_all<_Float16>::operator()' requested here
        CHECK(report(solution, check(rtc::from_gpu(c))));
                                    ^
/opt/rocm-5.7.0/llvm/lib/clang/17.0.0/include/__clang_cuda_math_forward_declares.h:110:17: note: candidate function
__DEVICE__ bool isnan(double);
                ^
/opt/rocm-5.7.0/llvm/lib/clang/17.0.0/include/__clang_cuda_math_forward_declares.h:111:17: note: candidate function
__DEVICE__ bool isnan(float);
                ^
1 error generated when compiling for gfx90a.
make[3]: *** [test/CMakeFiles/test_host_gemm_multiple_d.dir/build.make:76: test/CMakeFiles/test_host_gemm_multiple_d.dir/gemm_multiple_d.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:1009: test/CMakeFiles/test_host_gemm_multiple_d.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:885: CMakeFiles/check.dir/rule] Error 2
make: *** [Makefile:544: check] Error 2

If you can help test the branch as well as provide some example on how to run the driver that would be helpful as well

@pfultz2 pfultz2 requested a review from aosewski as a code owner January 26, 2024 16:05
@pfultz2
Copy link
Contributor Author

pfultz2 commented Jan 26, 2024

@JehandadKhan It should be fixed now.

@zjing14
Copy link
Contributor

zjing14 commented Feb 22, 2024

The PR looks good, but we have the following items to do:

  1. We need to add CI for this PR @illsilin
  2. We need a better name than "host", e.g., "codegen"

@illsilin
Copy link
Collaborator

illsilin commented Mar 1, 2024

Moved the code from "host" to "codegen" folder, synced with the develop branch, fixed the item pointed by Adam.
Waiting for Astha's suggestions what kind of tests we want to run in the CI.

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

Successfully merging this pull request may close these issues.

6 participants