openvino icon indicating copy to clipboard operation
openvino copied to clipboard

[TF FE]: Support complex tensors for Rsqrt operations

Open hub-bla opened this issue 1 year ago • 2 comments

Details:

  • Support complex tensors for Rsqrtoperations + tests

Tickets:

hub-bla avatar Aug 27 '24 08:08 hub-bla

build_jenkins

rkazants avatar Aug 27 '24 08:08 rkazants

Hey @rkazants, I encountered some issues described here. Could you give me a hint?

hub-bla avatar Aug 28 '24 07:08 hub-bla

@rkazants This one really got me sweating but I was able to fix issues. However, tests cannot compare infinite values even though the outcome is correct.

hub-bla avatar Aug 29 '24 16:08 hub-bla

build_jenkins

rkazants avatar Sep 08 '24 18:09 rkazants

Let us see CI results for now. I will take a look more deeply tomorrow.

Thanks, Roman

rkazants avatar Sep 08 '24 18:09 rkazants

All checks passed and I addressed code changes.

hub-bla avatar Sep 09 '24 09:09 hub-bla

build_jenkins

rkazants avatar Sep 09 '24 10:09 rkazants

@rkazants Previous PR #26475 seems to cause failure on ARM and the same happened PR #26512. Should I make separate PR to mark some test cases as xfail or it can be done here?

hub-bla avatar Sep 11 '24 08:09 hub-bla

@rkazants Previous PR #26475 seems to cause failure on ARM and the same happened PR #26512. Should I make separate PR to mark some test cases as xfail or it can be done here?

Hi @hub-bla, do you know the reason? It is strange to me that this is sporadic since the input data should be the same run-to-run.

rkazants avatar Sep 11 '24 10:09 rkazants

I do not know the reason yet but I viewed failed test cases and the output for the failed test is the same. Rsqrt PR Screenshot 2024-09-11 123748 MO Python Test PR Screenshot 2024-09-11 123851

However, the test on Rsqrt PR failed only on 1 test but in MO Python Test PR it failed on 3.

hub-bla avatar Sep 11 '24 10:09 hub-bla

Here in Rsqrt I had a problem with an unstable formula at first (It passed tests for small sizes but was really close on bigger ones). I'll try to increase test case size for Prod with bigger shapes to see if the formula itself is stable and then get back to you with the results if that's the issue.

hub-bla avatar Sep 11 '24 10:09 hub-bla

@rkazants I think my assumption about numerically unstable formula is true. For example with shape [1, 3, 20, 150] I'm getting an AssertionError that's quite close to the acceptable range. However, with shape [1, 3, 20, 224] it does not throw anything.

But that doesn't explain why sometimes the tests were successful.

hub-bla avatar Sep 11 '24 13:09 hub-bla

The only other option I found for this operation is iterative multiplication according to the formula for multiplying two complex numbers but I'm not sure how to do it in the translator.

Formula: (a + ib) (c + id) = (ac – bd) + i(ad + bc)

hub-bla avatar Sep 11 '24 15:09 hub-bla

@rkazants Previous PR #26475 seems to cause failure on ARM and the same happened PR #26512. Should I make separate PR to mark some test cases as xfail or it can be done here?

Hi @hub-bla, do you know the reason? It is strange to me that this is sporadic since the input data should be the same run-to-run.

But that doesn't explain why sometimes the tests were successful.

I also once found that catboost implementation on gpu is non-deterministic. Maybe it's also the case here.

hub-bla avatar Sep 11 '24 21:09 hub-bla

@rkazants Does it require any action from me now?

hub-bla avatar Sep 12 '24 17:09 hub-bla

build_jenkins

rkazants avatar Sep 15 '24 10:09 rkazants