openvino icon indicating copy to clipboard operation
openvino copied to clipboard

[TF FE]: Support complex tensors for SegmentSum operations

Open hegdeadithyak opened this issue 10 months ago • 13 comments

Details:

  • Edited Tests for Segment Sum

Resolves #23241

hegdeadithyak avatar Mar 26 '24 07:03 hegdeadithyak

@rkazants I have updated the tests based on your review

Thanks, Adithya Hegde Kota

hegdeadithyak avatar Apr 05 '24 12:04 hegdeadithyak

Hey @rkazants ,I'm not sure wether the variables names data_real and data_imag will be appropriate

hegdeadithyak avatar Apr 14 '24 09:04 hegdeadithyak

build_jenkins

rkazants avatar Apr 14 '24 13:04 rkazants

build_jenkins

rkazants avatar Apr 14 '24 19:04 rkazants

build_jenkins

rkazants avatar Apr 14 '24 19:04 rkazants

build_jenkins

rkazants avatar Apr 14 '24 19:04 rkazants

@hegdeadithyak, please fix build issue. Check locally on your machine:

2024-04-14T19:50:03.8004298Z In file included from /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:25:
2024-04-14T19:50:03.8007871Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/allocator.h:173:24: error: no matching constructor for initialization of 'ov::frontend::ComplexTypeMark'
2024-04-14T19:50:03.8010253Z   173 |     ::new ((void*)__p) _Up(std::forward<_Args>(__args)...);
2024-04-14T19:50:03.8014720Z       |                        ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-04-14T19:50:03.8019961Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/allocator_traits.h:296:9: note: in instantiation of function template specialization 'std::allocator<ov::frontend::ComplexTypeMark>::construct<ov::frontend::ComplexTypeMark, ov::Output<Node>>' requested here
2024-04-14T19:50:03.8023144Z   296 |     __a.construct(__p, std::forward<_Args>(__args)...);
2024-04-14T19:50:03.8023987Z       |         ^
2024-04-14T19:50:03.8027455Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:265:33: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<ov::frontend::ComplexTypeMark>>::construct<ov::frontend::ComplexTypeMark, ov::Output<Node>, void>' requested here

rkazants avatar Apr 14 '24 19:04 rkazants

@hegdeadithyak, please fix build issue. Check locally on your machine:

2024-04-14T19:50:03.8004298Z In file included from /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:25:
2024-04-14T19:50:03.8007871Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/allocator.h:173:24: error: no matching constructor for initialization of 'ov::frontend::ComplexTypeMark'
2024-04-14T19:50:03.8010253Z   173 |     ::new ((void*)__p) _Up(std::forward<_Args>(__args)...);
2024-04-14T19:50:03.8014720Z       |                        ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-04-14T19:50:03.8019961Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/allocator_traits.h:296:9: note: in instantiation of function template specialization 'std::allocator<ov::frontend::ComplexTypeMark>::construct<ov::frontend::ComplexTypeMark, ov::Output<Node>>' requested here
2024-04-14T19:50:03.8023144Z   296 |     __a.construct(__p, std::forward<_Args>(__args)...);
2024-04-14T19:50:03.8023987Z       |         ^
2024-04-14T19:50:03.8027455Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:265:33: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<ov::frontend::ComplexTypeMark>>::construct<ov::frontend::ComplexTypeMark, ov::Output<Node>, void>' requested here

Hi @hegdeadithyak, please clarify - did you fix build issue?

rkazants avatar Apr 23 '24 07:04 rkazants

@hegdeadithyak, please fix build issue. Check locally on your machine:

2024-04-14T19:50:03.8004298Z In file included from /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:25:
2024-04-14T19:50:03.8007871Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/allocator.h:173:24: error: no matching constructor for initialization of 'ov::frontend::ComplexTypeMark'
2024-04-14T19:50:03.8010253Z   173 |     ::new ((void*)__p) _Up(std::forward<_Args>(__args)...);
2024-04-14T19:50:03.8014720Z       |                        ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-04-14T19:50:03.8019961Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/allocator_traits.h:296:9: note: in instantiation of function template specialization 'std::allocator<ov::frontend::ComplexTypeMark>::construct<ov::frontend::ComplexTypeMark, ov::Output<Node>>' requested here
2024-04-14T19:50:03.8023144Z   296 |     __a.construct(__p, std::forward<_Args>(__args)...);
2024-04-14T19:50:03.8023987Z       |         ^
2024-04-14T19:50:03.8027455Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:265:33: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<ov::frontend::ComplexTypeMark>>::construct<ov::frontend::ComplexTypeMark, ov::Output<Node>, void>' requested here

Hi @hegdeadithyak, please clarify - did you fix build issue?

No Not yet, I am unable to find solution ,I'm On it do you have some kinda solution?

hegdeadithyak avatar Apr 23 '24 08:04 hegdeadithyak

@rkazants Hey I have fixed the build Issue , and built it on my local system it is perfectly working fine.The error was to add the complex part type for the Complex Mark Type.

Thanks Adithya Hegde

hegdeadithyak avatar Apr 26 '24 15:04 hegdeadithyak

build_jenkins

rkazants avatar Apr 30 '24 05:04 rkazants

@hegdeadithyak, please fix code-style issues and test failure:

E       TypeError: TestSegmentSumComplex.create_segment_sum_net() got an unexpected keyword argument 'data_type'

install\tests\layer_tests\tensorflow_tests\test_tf_SegmentSum.py:123: TypeError
_ TestSegmentSumComplex.test_segment_sum[ ie_device:CPU - precision:FP16 - params:{'data_shape': [4, 2, 1], 'segment_ids_shape': [4], 'data_type': <class 'numpy.float32'>, 'segment_ids_type': <class 'numpy.int32'>} ] _
[gw2] win32 -- Python 3.11.9 C:\actions-runner\_work\_tool\Python\3.11.9\x64\python3.exe

self = <test_tf_SegmentSum.TestSegmentSumComplex object at 0x000001F742301950>
params = {'data_shape': [4, 2, 1], 'data_type': <class 'numpy.float32'>, 'segment_ids_shape': [4], 'segment_ids_type': <class 'numpy.int32'>}
ie_device = 'CPU', precision = 'FP16', ir_version = 11
temp_dir = 'C:\\actions-runner\\_work\\openvino\\openvino\\install\\tests\\layer_tests\\common\\out\\CPU_test_segment_sum00nav1gn'
use_legacy_frontend = False

    @pytest.mark.parametrize("params", test_data_basic)
    @pytest.mark.precommit
    @pytest.mark.nightly
    def test_segment_sum(self, params, ie_device, precision, ir_version, temp_dir,
                         use_legacy_frontend):
        if use_legacy_frontend:
            pytest.skip("SegmentSum operation is not supported via legacy frontend.")
>       self._test(*self.create_segment_sum_net(**params),
                   ie_device, precision, ir_version, temp_dir=temp_dir,
                   use_legacy_frontend=use_legacy_frontend)
E       TypeError: TestSegmentSumComplex.create_segment_sum_net() got an unexpected keyword argument 'data_type'

install\tests\layer_tests\tensorflow_tests\test_tf_SegmentSum.py:[123](https://github.com/openvinotoolkit/openvino/actions/runs/8889542927/job/24409518498?pr=23676#step:15:124): TypeError
============================== warnings summary ===============================
install\tests\layer_tests\common\utils\tf_utils.py:42
  C:\actions-runner\_work\openvino\openvino\install\tests\layer_tests\common\utils\tf_utils.py:42: DeprecationWarning: invalid escape sequence '\.'
    restorer.restore(sess, re.sub('\.meta$', '', model_file))

rkazants avatar Apr 30 '24 06:04 rkazants

build_jenkins

rkazants avatar May 01 '24 09:05 rkazants

build_jenkins

rkazants avatar May 04 '24 08:05 rkazants

build_jenkins

rkazants avatar May 04 '24 11:05 rkazants

build_jenkins

rkazants avatar May 04 '24 12:05 rkazants