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

Feature/TensorFlow GPU #296

Merged
merged 6 commits into from
May 16, 2022
Merged

Feature/TensorFlow GPU #296

merged 6 commits into from
May 16, 2022

Conversation

Spiess
Copy link
Member

@Spiess Spiess commented May 5, 2022

Implements additional build flag -PGPU=true to use GPU version of TensorFlow.

Closes #293.

Will be made concrete once #294 is merged.

@silvanheller
Copy link
Member

Have you tested that this is actually just a drop-in replacement and uses the GPU (e.g. using nvidia-smi)

@Spiess
Copy link
Member Author

Spiess commented May 5, 2022

Please excuse, I forgot to mention that I did test this and could determine that the GPU is used, but since different item extractions are not batched, this could still be improved in the future.

@Spiess Spiess marked this pull request as ready for review May 5, 2022 09:26
@silvanheller silvanheller self-requested a review May 5, 2022 09:27
Copy link
Member

@silvanheller silvanheller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this on ubuntu and can confirm it works. There is however not really any noticeable speedup for CLIP. One request: Could the jar have a flag indicating whether it was built with gpu support?

@lucaro
Copy link
Member

lucaro commented May 5, 2022

I tested this on ubuntu and can confirm it works. There is however not really any noticeable speedup for CLIP. One request: Could the jar have a flag indicating whether it was built with gpu support?

I think that would also make sense for the application build. Alternatively, we might just add a CLI command that lists the currently available GPU compute resources. That would also serve as a debug feature.

@lucaro
Copy link
Member

lucaro commented May 16, 2022

I just tried what happens if you include tensorflow-core-platform-gpu on a machine without cuda support. It tries to load cuda, fails, and falls back to the CPU. Apart from some additional error messages in the log and a slightly larger size of the dependencies, there is, therefore, no downside in always loading the gpu-enabled version. The switch is not even necessary. The same behavior can be observed with tensorflow-core-platform-mkl. Interestingly enough, tensorflow-core-platform-mkl-gpu which contains both the intel and the nvidia accelerator support did not work on my machine, otherwise I'd have suggested that as a default.

@lucaro
Copy link
Member

lucaro commented May 16, 2022

I removed the switch and set it directly to use the GPU-enabled dependency. We can merge this now.

@Spiess Spiess merged commit 062abb6 into master May 16, 2022
@Spiess Spiess deleted the feature/tensorflow-gpu branch May 16, 2022 12:20
silvanheller pushed a commit that referenced this pull request Jun 10, 2022
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

Successfully merging this pull request may close these issues.

TensorFlow GPU support
3 participants