dkurt/openvino_pytorch_layers

Does grid_sample work for openVINO?

Closed this issue · 6 comments

Thanks for your sharing! As it grid_sample is not mentioned in README, I wonder whether it works for openVINO custom layer?

dkurt commented

Hi! Yes, just merged with #14. Works fine with OpenVINO 2021.2 (forgot to add to README)

Thank you so much for the reply. Got it.

I am working on implementing the Categorical distribution sampling (tf.distributions.categorical or torch.distributions.categorical) for openVINO, which is commonly used in RL models.

It is so wired that there is no random generation ops in openVINO like random.uniform. May I ask what is the optimal way for such an implementation? e.g., some c++ math library, intel MKL, or implement it in the front phase. Appreciate your help and hope to merge it to your repository if I get it done.

dkurt commented

@SamitHuang, the thing is that random ops are non-deterministic. You may start with just a reference custom CPU layers (using OpenCV for random array generation, as for example). OpenCV is a part of OpenVINO.

Looking forward for a contribution! Is whould be nice to know which RL model is optimized this way. Do you have some project on GitHub?

Thanks. That's good advice to me. I was thinking about using an external library like gsl_ran_multinomial. Now using uniform distribution sampling in opencv plus intel MKL math library for transforming the uniform dist. to categorical dist. (by gumbel-softmax or binary search) should be more efficient.

By the way, did you try to use the mkl library when doing the op extension? It would be helpful if there is some examples!

The RL model is a q-learning model for a game agent, but it is not released on github. I would to like to do so after permission!

dkurt commented

By the way, did you try to use the mkl library when doing the op extension? It would be helpful if there is some examples!

Please take a look at #13. It's an example with Fast Fourier Transform from MKL.

dkurt commented

I think that we can close it