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

How to contribute multiple changes to gpu_process.pyx module #4

Open
ericyang125 opened this issue May 17, 2021 · 10 comments
Open

How to contribute multiple changes to gpu_process.pyx module #4

ericyang125 opened this issue May 17, 2021 · 10 comments

Comments

@ericyang125
Copy link
Contributor

How would I contribute multiple enhancements to the gpu_process.pyx module that I've been working on? What sort of validation should I run to ensure it works better than before, given that I could never get the base version to work on my end? Can I change the function names and arguments?

The enhancements include migration to Python 3, window deformation, median validation, bugfixes and minor performance increases, but it would be too difficult for me to separate these into individual pull requests.

@alexlib
Copy link
Member

alexlib commented May 17, 2021

Hi @ericyang125 I think the safest way is to

  1. Fork the repository to your account
  2. Merge your changes
  3. Create a pull request back to this repo.

Hope it's not a problem for you. Don't hesitate to ask questions.

@alexlib
Copy link
Member

alexlib commented May 17, 2021

I see @ericyang125 you already have one
https://github.com/ericyang125/openpiv-python-gpu

Do you want to create a pull request, please?
Does it run on Google Colaboratory ? Where could we test it?

@ericyang125
Copy link
Contributor Author

I will create a pull request after I finish a few changes then.

I modified a short demo for the changed function: https://colab.research.google.com/github/ericyang125/openpiv-python-gpu/blob/master/Openpiv_Python_Tutorial_Basic.ipynb

Would you suggest any validation dataset?

@alexlib
Copy link
Member

alexlib commented May 20, 2021

I think these two lines has to be modified from gpu_mp to

# install OpenPIV extensions
!cd openpiv-python-gpu && python3 setup.py build_ext --inplace

# put the repo on the python path
!cd openpiv-python-gpu && export PYTHONPATH=$PYTHONPATH:$PWD

@alexlib
Copy link
Member

alexlib commented May 20, 2021

everywhere gpu_mp has to be changed to openpiv-python-gpu and then the notebook runs on Google Colab

@alexlib
Copy link
Member

alexlib commented May 21, 2021

see ericyang125#1

@alexlib
Copy link
Member

alexlib commented May 22, 2021

Is it possible to create a GPU version of windef.py?
Sometime ago we decided to move from WiDIM to windef in the CPU version.

Thanks

@alexlib
Copy link
Member

alexlib commented May 22, 2021

Please open a pull request from your repo

@ericyang125
Copy link
Contributor Author

ericyang125 commented May 22, 2021

Is it possible to create a GPU version of windef.py?
Sometime ago we decided to move from WiDIM to windef in the CPU version.

Thanks

My approach to do that would be to profile windef and see which subroutines would benefit from GPU-acceleration.
Using scikit-CUDA to do the FFT would probably be the easiest place to start.
It looks like windef makes a call to scipy.ndimage.map_coordinates() to do the window deformation--there is cupyx.scipy.ndimage.map_coordinates()

From a cursory profiling of windef, most of the time (80%) is spent doing validation, next is doing the correlation (12%).

These could be GPU-accelerated by:

  1. Adapting the GPU validation library (mean, s2n, median, div) to be useable by windef
  2. Adapting the GPU cross-correlation function, which is similar in principle to extended_search_area, useable by windef

A framework to standardize the i/o of the CPU and GPU functions would be required.

The widim algorithm that I've modified performs comparably to windef, according to my testing. Adding window deformation and calling smoothn goes much of the way to improving the results.

Please open a pull request from your repo

In my repo, certain features like mean validation, s2n validation, extended_search_area (GPU version) don't work.
I could make a pull request anyway, and fix those items in the future, if you'd like.

@alexlib
Copy link
Member

alexlib commented May 22, 2021

no problem @ericyang125 - we'll wait for these corrections

In my repo, certain features like mean validation, s2n validation, extended_search_area (GPU version) don't work.
I could make a pull request anyway, and fix those items in the future, if you'd like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants