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

GPU speed up? #135

Open
PeterPirog opened this issue Jan 3, 2023 · 2 comments
Open

GPU speed up? #135

PeterPirog opened this issue Jan 3, 2023 · 2 comments

Comments

@PeterPirog
Copy link

Is possible to speed up optapy calculations by usage of CUDA GPU?

@Christopher-Chianelli
Copy link
Contributor

You probably could use CUDA in an @easy_score_calculator (https://www.optapy.org/docs/latest/score-calculation/score-calculation.html#easyPythonScoreCalculation), but then there will be frequent transfers between CPython and Java, which will probably eat all possible performance gains (and then some). With a constraint provider, incremental score calculation is used (https://www.optapy.org/docs/latest/score-calculation/score-calculation.html#incrementalScoreCalculation) and functions are converted into Java bytecode (if possible). CUDA would probably be suitable if you have a constraint that cannot be calculated incrementally, but it would need to be benchmarked (I strongly suspect a constraint provider will still beat it, since transfer between CPython and Java have a lot of overhead).

@PeterPirog
Copy link
Author

@Christopher-Chianelli Thank You for the answer. I asked because I wonder if is possible to use JCuda http://javagl.de/jcuda.org/tutorial/TutorialIndex.html#Introduction , typically I use CUDA when I work with neural nets Tensorflow framework.

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