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

Check FP16 version of Mask-RCNN and Faster-RCNN #155

Open
gyulaz-htec opened this issue Nov 15, 2023 · 3 comments
Open

Check FP16 version of Mask-RCNN and Faster-RCNN #155

gyulaz-htec opened this issue Nov 15, 2023 · 3 comments

Comments

@gyulaz-htec
Copy link

gyulaz-htec commented Nov 15, 2023

This is related to ONNX zoo models #141
use the --fp16 flag

@gyulaz-htec gyulaz-htec converted this from a draft issue Nov 15, 2023
@gyulaz-htec gyulaz-htec moved this from 🔖 Ready to 🏗 In progress in MIGraphX ONNX support Nov 17, 2023
@gyulaz-htec
Copy link
Author

gyulaz-htec commented Nov 17, 2023

Faster-RCNN

According to the onnx zoo description of Faster-RCNN it can handle different image sizes, but it is recommended to resize the image such that both height and width are within the range of [800, 1333] and the image size must be a multiple of 32.

command used:
migraphx-driver compile --fp16 ./onnx_zoo_models/vision/object_detection_segmentation/faster-rcnn/model/FasterRCNN-12.onnx --input-dim @image 3 800 800

output:
terminate called after throwing an instance of 'migraphx::version_2_9_0::exception' what(): /code/AMDMIGraphX/src/include/migraphx/check_shapes.hpp:220: same_dims: mul: Dimensions do not match

@gyulaz-htec
Copy link
Author

gyulaz-htec commented Nov 22, 2023

Mask-RCNN

This works with the same demension as Faster-RCNN, see description

command used:
migraphx-driver compile --fp16 ./onnx_zoo_models/vision/object_detection_segmentation/faster-rcnn/model/FasterRCNN-12.onnx --input-dim @image 3 800 800

output:
Segmentation fault (core dumped)

According to the backtrace the error comes from the simplify_reshapes pass:

0x00007f2b8c0e24e6 in migraphx::version_2_9_0::find_concat_multibroadcasts::apply(migraphx::version_2_9_0::module&, migraphx::version_2_9_0::match::matcher_resul
t const&) const () from /code/AMDMIGraphX/build/lib/libmigraphx.so.2009000                                                                                       
(gdb) bt                                                                                                                                                         
#0  0x00007f2b8c0e24e6 in migraphx::version_2_9_0::find_concat_multibroadcasts::apply(migraphx::version_2_9_0::module&, migraphx::version_2_9_0::match::matcher_r
esult const&) const () from /code/AMDMIGraphX/build/lib/libmigraphx.so.2009000                                                                                   
#1  0x00007f2b8c0ab877 in auto migraphx::version_2_9_0::match::find_matches_for<migraphx::version_2_9_0::module, migraphx::version_2_9_0::find_where_op&, migraph
x::version_2_9_0::find_resize&, migraphx::version_2_9_0::find_nop_reshapes&, migraphx::version_2_9_0::find_reshaper&, migraphx::version_2_9_0::find_reshape_cont&
, migraphx::version_2_9_0::find_transpose&, migraphx::version_2_9_0::find_concat_transpose&, migraphx::version_2_9_0::find_concat_multibroadcasts&, migraphx::ver
sion_2_9_0::find_nested_convert&, migraphx::version_2_9_0::find_nested_slice&, migraphx::version_2_9_0::find_nested_concat&, migraphx::version_2_9_0::find_transp
ose_slice&, migraphx::version_2_9_0::find_broadcast_transpose&, migraphx::version_2_9_0::find_slice_transpose&, migraphx::version_2_9_0::find_transpose_contiguou
s_reshaper_unary&>(std::experimental::fundamentals_v2::source_location, migraphx::version_2_9_0::module&, std::_List_iterator<migraphx::version_2_9_0::instructio
n>, migraphx::version_2_9_0::find_where_op&, migraphx::version_2_9_0::find_resize&, migraphx::version_2_9_0::find_nop_reshapes&, migraphx::version_2_9_0::find_re
shaper&, migraphx::version_2_9_0::find_reshape_cont&, migraphx::version_2_9_0::find_transpose&, migraphx::version_2_9_0::find_concat_transpose&, migraphx::versio
n_2_9_0::find_concat_multibroadcasts&, migraphx::version_2_9_0::find_nested_convert&, migraphx::version_2_9_0::find_nested_slice&, migraphx::version_2_9_0::find_
nested_concat&, migraphx::version_2_9_0::find_transpose_slice&, migraphx::version_2_9_0::find_broadcast_transpose&, migraphx::version_2_9_0::find_slice_transpose
&, migraphx::version_2_9_0::find_transpose_contiguous_reshaper_unary&)::{lambda(auto:1&&)#1}::operator()<migraphx::version_2_9_0::find_concat_multibroadcasts&>(m
igraphx::version_2_9_0::module&&) const () from /code/AMDMIGraphX/build/lib/libmigraphx.so.2009000                                                               
#2  0x00007f2b8c0a848e in void migraphx::version_2_9_0::each_args<migraphx::version_2_9_0::match::find_matches_for<migraphx::version_2_9_0::module, migraphx::ver
sion_2_9_0::find_where_op&, migraphx::version_2_9_0::find_resize&, migraphx::version_2_9_0::find_nop_reshapes&, migraphx::version_2_9_0::find_reshaper&, migraphx
::version_2_9_0::find_reshape_cont&, migraphx::version_2_9_0::find_transpose&, migraphx::version_2_9_0::find_concat_transpose&, migraphx::version_2_9_0::find_con
cat_multibroadcasts&, migraphx::version_2_9_0::find_nested_convert&, migraphx::version_2_9_0::find_nested_slice&, migraphx::version_2_9_0::find_nested_concat&, m
igraphx::version_2_9_0::find_transpose_slice&, migraphx::version_2_9_0::find_broadcast_transpose&, migraphx::version_2_9_0::find_slice_transpose&, migraphx::vers
ion_2_9_0::find_transpose_contiguous_reshaper_unary&>(std::experimental::fundamentals_v2::source_location, migraphx::version_2_9_0::module&, std::_List_iterator<
migraphx::version_2_9_0::instruction>, migraphx::version_2_9_0::find_where_op&, migraphx::version_2_9_0::find_resize&, migraphx::version_2_9_0::find_nop_reshapes
&, migraphx::version_2_9_0::find_reshaper&, migraphx::version_2_9_0::find_reshape_cont&, migraphx::version_2_9_0::find_transpose&, migraphx::version_2_9_0::find_
concat_transpose&, migraphx::version_2_9_0::find_concat_multibroadcasts&, migraphx::version_2_9_0::find_nested_convert&, migraphx::version_2_9_0::find_nested_sli
ce&, migraphx::version_2_9_0::find_nested_concat&, migraphx::version_2_9_0::find_transpose_slice&, migraphx::version_2_9_0::find_broadcast_transpose&, migraphx::
version_2_9_0::find_slice_transpose&, migraphx::version_2_9_0::find_transpose_contiguous_reshaper_unary&)::{lambda(auto:1&&)#1}, migraphx::version_2_9_0::find_wh
ere_op&, migraphx::version_2_9_0::find_resize&, migraphx::version_2_9_0::find_nop_reshapes&, migraphx::version_2_9_0::find_reshaper&, migraphx::version_2_9_0::fi
nd_reshape_cont&, migraphx::version_2_9_0::find_transpose&, migraphx::version_2_9_0::find_concat_transpose&, migraphx::version_2_9_0::find_concat_multibroadcasts
&, migraphx::version_2_9_0::find_nested_convert&, migraphx::version_2_9_0::find_nested_slice&, migraphx::version_2_9_0::find_nested_concat&, migraphx::version_2_
9_0::find_transpose_slice&, migraphx::version_2_9_0::find_broadcast_transpose&, migraphx::version_2_9_0::find_slice_transpose&, migraphx::version_2_9_0::find_tra
--Type <RET> for more, q to quit, c to continue without paging--                                                                                                 
nspose_contiguous_reshaper_unary&>(migraphx::version_2_9_0::match::find_matches_for<migraphx::version_2_9_0::module, migraphx::version_2_9_0::find_where_op&, mig
raphx::version_2_9_0::find_resize&, migraphx::version_2_9_0::find_nop_reshapes&, migraphx::version_2_9_0::find_reshaper&, migraphx::version_2_9_0::find_reshape_cont&, migraphx::version_2_9_0::find_transpose&, migraphx::version_2_9_0::find_concat_transpose&, migraphx::version_2_9_0::find_concat_multibroadcasts&, migraphx::version_2_9_0::find_nested_convert&, migraphx::version_2_9_0::find_nested_slice&, migraphx::version_2_9_0::find_nested_concat&, migraphx::version_2_9_0::find_transpose_slice&, migraphx::version_2_9_0::find_broadcast_transpose&, migraphx::version_2_9_0::find_slice_transpose&, migraphx::version_2_9_0::find_transpose_contiguous_reshaper_unary&>(std::experimental::fundamentals_v2::source_location, migraphx::version_2_9_0::module&, std::_List_iterator<migraphx::version_2_9_0::instruction>, migraphx::version_2_9_0::find_where_op&, migraphx::version_2_9_0::find_resize&, migraphx::version_2_9_0::find_nop_reshapes&, migraphx::version_2_9_0::find_reshaper&, migraphx::version_2_9_0::find_reshape_cont&, migraphx::version_2_9_0::find_transpose&, migraphx::version_2_9_0::find_concat_transpose&, migraphx::version_2_9_0::find_concat_multibroadcasts&, migraphx::version_2_9_0::find_nested_convert&, migraphx::version_2_9_0::find_nested_slice&, migraphx::version_2_9_0::find_nested_concat&, migraphx::version_2_9_0::find_transpose_slice&, migraphx::version_2_9_0::find_broadcast_transpose&, migraphx::version_2_9_0::find_slice_transpose&, migraphx::version_2_9_0::find_transpose_contiguous_reshaper_unary&)::{lambda(auto:1&&)#1}, migraphx::version_2_9_0::find_where_op&, migraphx::version_2_9_0::find_resize&, migraphx::version_2_9_0::find_nop_reshapes&, migraphx::version_2_9_0::find_reshaper&, migraphx::version_2_9_0::find_reshape_cont&, migraphx::version_2_9_0::find_transpose&, migraphx::version_2_9_0::find_concat_transpose&, migraphx::version_2_9_0::find_concat_multibroadcasts&, migraphx::version_2_9_0::find_nested_convert&, migraphx::version_2_9_0::find_nested_slice&, migraphx::version_2_9_0::find_nested_concat&, migraphx::version_2_9_0::find_transpose_slice&, migraphx::version_2_9_0::find_broadcast_transpose&, migraphx::version_2_9_0::find_slice_transpose&, migraphx::version_2_9_0::find_transpose_contiguous_reshaper_unary&) () from /code/AMDMIGraphX/build/lib/libmigraphx.so.2009000
#3  0x00007f2b8c0a8309 in void migraphx::version_2_9_0::match::find_matches_for<migraphx::version_2_9_0::module, migraphx::version_2_9_0::find_where_op&, migraphx::version_2_9_0::find_resize&, migraphx::version_2_9_0::find_nop_reshapes&, migraphx::version_2_9_0::find_reshaper&, migraphx::version_2_9_0::find_reshape_cont&, migraphx::version_2_9_0::find_transpose&, migraphx::version_2_9_0::find_concat_transpose&, migraphx::version_2_9_0::find_concat_multibroadcasts&, migraphx::version_2_9_0::find_nested_convert&, migraphx::version_2_9_0::find_nested_slice&, migraphx::version_2_9_0::find_nested_concat&, migraphx::version_2_9_0::find_transpose_slice&, migraphx::version_2_9_0::find_broadcast_transpose&, migraphx::version_2_9_0::find_slice_transpose&, migraphx::version_2_9_0::find_transpose_contiguous_reshaper_unary&>(std::experimental::fundamentals_v2::source_location, migraphx::version_2_9_0::module&, std::_List_iterator<migraphx::version_2_9_0::instruction>, migraphx::version_2_9_0::find_where_op&, migraphx::version_2_9_0::find_resize&, migraphx::version_2_9_0::find_nop_reshapes&, migraphx::version_2_9_0::find_reshaper&, migraphx::version_2_9_0::find_reshape_cont&, migraphx::version_2_9_0::find_transpose&, migraphx::version_2_9_0::find_concat_transpose&, migraphx::version_2_9_0::find_concat_multibroadcasts&, migraphx::version_2_9_0::find_nested_convert&, migraphx::version_2_9_0::find_nested_slice&, migraphx::version_2_9_0::find_nested_concat&, migraphx::version_2_9_0::find_transpose_slice&, migraphx::version_2_9_0::find_broadcast_transpose&, migraphx::version_2_9_0::find_slice_transpose&, migraphx::version_2_9_0::find_transpose_contiguous_reshaper_unary&) () from /code/AMDMIGraphX/build/lib/libmigraphx.so.2009000
#4  0x00007f2b8c0a589f in migraphx::version_2_9_0::simplify_reshapes::apply(migraphx::version_2_9_0::module&) const ()
   from /code/AMDMIGraphX/build/lib/libmigraphx.so.2009000
#5  0x00007f2b8bea2dd2 in migraphx::version_2_9_0::module_pm::run_pass(migraphx::version_2_9_0::pass const&) ()
   from /code/AMDMIGraphX/build/lib/libmigraphx.so.2009000
#6  0x00007f2b8bea10c1 in migraphx::version_2_9_0::optimize_module::apply(migraphx::version_2_9_0::module_pass_manager&) const ()
   from /code/AMDMIGraphX/build/lib/libmigraphx.so.2009000
#7  0x00007f2b8bea2dd2 in migraphx::version_2_9_0::module_pm::run_pass(migraphx::version_2_9_0::pass const&) ()
   from /code/AMDMIGraphX/build/lib/libmigraphx.so.2009000
#8  0x00007f2b8bea2549 in migraphx::version_2_9_0::run_passes(migraphx::version_2_9_0::program&, migraphx::version_2_9_0::module*, std::vector<migraphx::version_2_9_0::pass, std::allocator<migraphx::version_2_9_0::pass> > const&, migraphx::version_2_9_0::tracer) () from /code/AMDMIGraphX/build/lib/libmigraphx.so.2009000
#9  0x00007f2b8bee0ab7 in migraphx::version_2_9_0::quantize_fp16(migraphx::version_2_9_0::program&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) ()
   from /code/AMDMIGraphX/build/lib/libmigraphx.so.2009000
#10 0x000000000026b463 in migraphx::driver::version_2_9_0::compiler::compile() ()
#11 0x000000000026b319 in migraphx::driver::version_2_9_0::compile::run() ()
#12 0x000000000026af93 in void migraphx::driver::version_2_9_0::run_command<migraphx::driver::version_2_9_0::compile>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, bool) ()
#13 0x000000000026a941 in migraphx::driver::version_2_9_0::auto_register_command<migraphx::driver::version_2_9_0::compile>()::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)#1}::operator()(std::__cxx11::basic_string<char, std::char_traits<cha--Type <RET> for more, q to quit, c to continue without paging--
r>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >) const ()
#14 0x000000000026a83d in std::_Function_handler<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >), migraphx::driver::version_2_9_0::auto_register_command<migraphx::driver::version_2_9_0::compile>()::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)#1}>::_M_invoke(std::_Any_data const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&&) ()
#15 0x000000000024514b in main ()

The crash comes from this line, op.axis has a negative value and the iterator reads unknown memory

@attila-dusnoki-htec
Copy link

The Mask-RCNN crash was fixed with ROCm#2678

@attila-dusnoki-htec attila-dusnoki-htec moved this from 🏗 In progress to 🔖 Ready in MIGraphX ONNX support Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔖 Ready
Development

No branches or pull requests

2 participants