migraphx-benchmark / AMDMIGraphX

AMD's graph optimization engine.
https://rocmsoftwareplatform.github.io/AMDMIGraphX/doc/html/
MIT License
0 stars 1 forks source link

Mod failures #107

Open attila-dusnoki-htec opened 1 year ago

attila-dusnoki-htec commented 1 year ago

Failing tests:

attila-dusnoki-htec commented 1 year ago
ERROR: test_mod_mixed_sign_int32_cpu (__main__.OnnxBackendNodeModelTest) ``` ====================================================================== ERROR: test_mod_mixed_sign_int32_cpu (__main__.OnnxBackendNodeModelTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/onnx/backend/test/runner/__init__.py", line 290, in device_test_func return test_func(*args, device=device, **kwargs) File "/usr/local/lib/python3.8/dist-packages/onnx/backend/test/runner/__init__.py", line 382, in run prepared_model = self.backend.prepare(model, device) File "/code/AMDMIGraphX/build/lib/onnx_migraphx/backend.py", line 125, in prepare return cls.prepare(bin, device, **kwargs) File "/code/AMDMIGraphX/build/lib/onnx_migraphx/backend.py", line 116, in prepare inf.compile(migraphx.get_target(device.lower())) RuntimeError: /code/AMDMIGraphX/src/targets/gpu/compile_ops.cpp:175: benchmark: No configs to tune ```
ERROR: test_mod_mixed_sign_int8_cpu (__main__.OnnxBackendNodeModelTest) ``` ====================================================================== ERROR: test_mod_mixed_sign_int8_cpu (__main__.OnnxBackendNodeModelTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/onnx/backend/test/runner/__init__.py", line 290, in device_test_func return test_func(*args, device=device, **kwargs) File "/usr/local/lib/python3.8/dist-packages/onnx/backend/test/runner/__init__.py", line 382, in run prepared_model = self.backend.prepare(model, device) File "/code/AMDMIGraphX/build/lib/onnx_migraphx/backend.py", line 125, in prepare return cls.prepare(bin, device, **kwargs) File "/code/AMDMIGraphX/build/lib/onnx_migraphx/backend.py", line 116, in prepare inf.compile(migraphx.get_target(device.lower())) RuntimeError: /code/AMDMIGraphX/src/targets/gpu/compile_ops.cpp:175: benchmark: No configs to tune ```
gyulaz-htec commented 1 year ago

We get the following errors when compiling kernel for int32 mod:

/tmp/comgr-483e18/input/main.cpp:13:83: error: cannot convert between vector values of different size ('safe_vec<type, size>' (aka 'vec<conditional_t<is_same<double, bool>{}, uint8_t, double>, 2U>') and 'int __attribute__((ext_vector_type(2)))' (vector of 2 'int' values))
auto z2 = migraphx::convert<int32_t>(migraphx::fmod((migraphx::remainder(x0, x1)) + x1, x1));
                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~
/tmp/comgr-483e18/input/main.cpp:24:53: note: in instantiation of function template specialization 'migraphx::inner_pointwise<int __attribute__((ext_vector_type(2))), int __attribute__((ext_vector_type(2)))>' requested here
    pointwise(idx, vectorize<2, 0>())(MIGRAPHX_LIFT(inner_pointwise), private_p0,private_p1,private_p2);
                                                    ^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:66: note: while substituting deduced template arguments into function template 'operator()' [with private_lifts_xs:auto = <int & __attribute__((ext_vector_type(2))), int & __attribute__((ext_vector_type(2)))>]
                      [&](auto i) { out[i] = implicit_conversion(f(xs[i]...)); });
                                                                 ^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:160:64: note: in instantiation of function template specialization 'migraphx::pointwise_tensor(index, (lambda at /tmp/comgr-483e18/input/main.cpp:24:39), migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>)::(anonymous class)::operator()<unsigned int>' requested here
    static constexpr auto invoke_loop(F f, I i, D) -> decltype(f(i))
                                                               ^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:200:25: note: while substituting deduced template arguments into function template 'invoke_loop' [with F = (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), I = index_int, D = integral_constant<decltype(0), 0>]
                        invoke_loop(f, start, _c<0>);
                        ^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:228:9: note: in instantiation of function template specialization 'migraphx::index::for_stride<false, (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), migraphx::integral_constant<unsigned int, 3>, migraphx::integral_constant<unsigned int, 1024>>' requested here
        for_stride<false>(global, n, nglobal(), f);
        ^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:39:9: note: in instantiation of function template specialization 'migraphx::index::global_stride<(lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), migraphx::integral_constant<unsigned int, 3>>' requested here
    idx.global_stride(out.get_shape().elements(),
        ^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:48:36: note: in instantiation of function template specialization 'migraphx::pointwise_tensor<(lambda at /tmp/comgr-483e18/input/main.cpp:24:39), migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>>' requested here
        t(ps...)([&](auto... xs) { pointwise_tensor(idx, f, xs...); });
                                   ^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:66: error: no matching function for call to object of type '(lambda at /tmp/comgr-483e18/input/main.cpp:24:39)'
                      [&](auto i) { out[i] = implicit_conversion(f(xs[i]...)); });
                                                                 ^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:160:64: note: in instantiation of function template specialization 'migraphx::pointwise_tensor(index, (lambda at /tmp/comgr-483e18/input/main.cpp:24:39), migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>)::(anonymous class)::operator()<unsigned int>' requested here
    static constexpr auto invoke_loop(F f, I i, D) -> decltype(f(i))
                                                               ^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:200:25: note: while substituting deduced template arguments into function template 'invoke_loop' [with F = (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), I = index_int, D = integral_constant<decltype(0), 0>]
                        invoke_loop(f, start, _c<0>);
                        ^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:228:9: note: in instantiation of function template specialization 'migraphx::index::for_stride<false, (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), migraphx::integral_constant<unsigned int, 3>, migraphx::integral_constant<unsigned int, 1024>>' requested here
        for_stride<false>(global, n, nglobal(), f);
        ^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:39:9: note: in instantiation of function template specialization 'migraphx::index::global_stride<(lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), migraphx::integral_constant<unsigned int, 3>>' requested here
    idx.global_stride(out.get_shape().elements(),
        ^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:48:36: note: in instantiation of function template specialization 'migraphx::pointwise_tensor<(lambda at /tmp/comgr-483e18/input/main.cpp:24:39), migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>>' requested here
        t(ps...)([&](auto... xs) { pointwise_tensor(idx, f, xs...); });
                                   ^
/tmp/comgr-483e18/input/main.cpp:24:39: note: candidate template ignored: substitution failure [with private_lifts_xs:auto = <int & __attribute__((ext_vector_type(2))), int & __attribute__((ext_vector_type(2)))>]
    pointwise(idx, vectorize<2, 0>())(MIGRAPHX_LIFT(inner_pointwise), private_p0,private_p1,private_p2);
                                      ^
/tmp/comgr-483e18/include/migraphx/kernels/functional.hpp:35:5: note: expanded from macro 'MIGRAPHX_LIFT'
    [](auto&&... private_lifts_xs) MIGRAPHX_RETURNS( \
    ^
In file included from /tmp/comgr-483e18/input/main.cpp:2:
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:200:25: error: no matching function for call to 'invoke_loop'
                        invoke_loop(f, start, _c<0>);
                        ^~~~~~~~~~~
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:228:9: note: in instantiation of function template specialization 'migraphx::index::for_stride<false, (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), migraphx::integral_constant<unsigned int, 3>, migraphx::integral_constant<unsigned int, 1024>>' requested here
        for_stride<false>(global, n, nglobal(), f);
        ^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:39:9: note: in instantiation of function template specialization 'migraphx::index::global_stride<(lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), migraphx::integral_constant<unsigned int, 3>>' requested here
    idx.global_stride(out.get_shape().elements(),
        ^
/tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:48:36: note: in instantiation of function template specialization 'migraphx::pointwise_tensor<(lambda at /tmp/comgr-483e18/input/main.cpp:24:39), migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>, migraphx::tensor_view<int __attribute__((ext_vector_type(2))), migraphx::shape<migraphx::integral_const_array<unsigned int, 3>, migraphx::integral_const_array<unsigned int, 1>>>>' requested here
        t(ps...)([&](auto... xs) { pointwise_tensor(idx, f, xs...); });
                                   ^
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:154:27: note: candidate template ignored: substitution failure [with F = (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), I = index_int, D = integral_constant<decltype(0), 0>]: no matching function for call to object of type '(lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23)'
    static constexpr auto invoke_loop(F f, I i, D d) -> decltype(f(i, d))
                          ^                                      ~
/tmp/comgr-483e18/include/migraphx/kernels/index.hpp:160:27: note: candidate template ignored: substitution failure [with F = (lambda at /tmp/comgr-483e18/include/migraphx/kernels/pointwise.hpp:40:23), I = index_int, D = integral_constant<decltype(0), 0>]
    static constexpr auto invoke_loop(F f, I i, D) -> decltype(f(i))
                          ^
3 errors generated when compiling for gfx90a.

terminate called after throwing an instance of 'migraphx::version_2_7_0::exception'
  what():  /code/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:170: compile: hiprtc: HIPRTC_ERROR_COMPILATION: Compilation failed.
Aborted (core dumped)

The issue seems like that the conversion between safe_vec<type::douable, size> and vector of 2 'int32' values does not exist.

attila-dusnoki-htec commented 11 months ago

Tracking issue: https://github.com/ROCmSoftwarePlatform/AMDMIGraphX/issues/2268