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

[BUG] print tensor<half> error #1877

Closed
luliyucoordinate opened this issue Oct 17, 2024 · 2 comments
Closed

[BUG] print tensor<half> error #1877

luliyucoordinate opened this issue Oct 17, 2024 · 2 comments
Labels
? - Needs Triage bug Something isn't working

Comments

@luliyucoordinate
Copy link
Contributor

An error occurred when I printed a tensor of type half using the program below.

#include <cute/tensor.hpp>
using namespace cute;

void test_print_half() {
  auto x = make_tensor<half>(Int<1024>{});
  print_tensor(x);
}
/mnt/d/cuda/cutlass/include/cute/util/print.hpp(258): error: more than one instance of overloaded function "cute::print" matches the argument list:
            function "cute::print(char)" (declared at line 66)
            function "cute::print(signed char)" (declared at line 72)
            function "cute::print(unsigned char)" (declared at line 78)
            function "cute::print(short)" (declared at line 84)
            function "cute::print(unsigned short)" (declared at line 90)
            function "cute::print(int)" (declared at line 96)
            function "cute::print(cutlass::uint1b_t)" (declared at line 102)
            function "cute::print(cutlass::int2b_t)" (declared at line 108)
            function "cute::print(cutlass::uint2b_t)" (declared at line 114)
            function "cute::print(cutlass::int4b_t)" (declared at line 120)
            function "cute::print(cutlass::uint4b_t)" (declared at line 126)
            function "cute::print(cutlass::bin1_t)" (declared at line 132)
            function "cute::print(unsigned int)" (declared at line 138)
            function "cute::print(long)" (declared at line 144)
            function "cute::print(unsigned long)" (declared at line 150)
            function "cute::print(long long)" (declared at line 156)
            function "cute::print(unsigned long long)" (declared at line 162)
            function "cute::print(float)" (declared at line 168)
            argument types are: (half)
    printf("  "); print(t);
                  ^
/mnt/d/cuda/cutlass/include/cute/util/print.hpp(187): note #3326-D: function "cute::print(const char *)" does not match because argument #1 does not match parameter
  print(char const* format) {
  ^
/mnt/d/cuda/cutlass/include/cute/util/print.hpp(181): note #3326-D: function template "cute::print(const char *, const T &...)" does not match because argument #1 does not match parameter
  print(char const* format, T const&... t) {
  ^
/mnt/d/cuda/cutlass/include/cute/numeric/numeric_types.hpp(106): note #3326-D: function "cute::print(cutlass::float_e5m2_t)" does not match because argument #1 does not match parameter
  print(float_e5m2_t a) {
  ^
/mnt/d/cuda/cutlass/include/cute/numeric/numeric_types.hpp(100): note #3326-D: function "cute::print(cutlass::float_e4m3_t)" does not match because argument #1 does not match parameter
  print(float_e4m3_t a) {
  ^
/mnt/d/cuda/cutlass/include/cute/numeric/numeric_types.hpp(94): note #3326-D: function "cute::print(cutlass::tfloat32_t)" does not match because argument #1 does not match parameter
  print(tfloat32_t a) {
  ^
/mnt/d/cuda/cutlass/include/cute/numeric/numeric_types.hpp(87): note #3326-D: function "cute::print(cutlass::bfloat16_t)" does not match because argument #1 does not match parameter
  print(bfloat16_t a) {
  ^
/mnt/d/cuda/cutlass/include/cute/numeric/numeric_types.hpp(81): note #3326-D: function "cute::print(cutlass::half_t)" does not match because argument #1 does not match parameter
  print(half_t a) {
  ^
          detected during:
            instantiation of "void cute::pretty_print(T) [with T=half]" at line 1112 of /mnt/d/cuda/cutlass/include/cute/tensor_impl.hpp
            instantiation of "void cute::print_tensor(const cute::Tensor<Engine, Layout> &, __nv_bool) [with Engine=cute::ArrayEngine<half, 1024UL>, Layout=cute::Layout<cute::C<1024>, cute::_1>]" at line 6 of /mnt/d/cuda/mykernels/test_cute/test_print_half.cu

1 error detected in the compilation of "/mnt/d/cuda/mykernels/test_cute/test_print_half.cu".
ninja: build stopped: subcommand failed.
@ccecka
Copy link

ccecka commented Oct 17, 2024

Should probably be using half_t rather than half for functionality and compatibility.

@luliyucoordinate
Copy link
Contributor Author

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
? - Needs Triage bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants