-
Notifications
You must be signed in to change notification settings - Fork 508
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
[MRG] Tensorflow backend & Benchmarker & Myst_parser #316
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #316 +/- ##
==========================================
- Coverage 93.34% 93.03% -0.32%
==========================================
Files 21 21
Lines 4901 5198 +297
==========================================
+ Hits 4575 4836 +261
- Misses 326 362 +36 |
This reverts commit 8223e76.
ncassereau
changed the title
[MRG] Tensorflow backend
[MRG] Tensorflow backend & Benchmarker
Dec 7, 2021
ncassereau
changed the title
[MRG] Tensorflow backend & Benchmarker
[WIP] Tensorflow backend & Benchmarker
Dec 7, 2021
ncassereau
changed the title
[WIP] Tensorflow backend & Benchmarker
[MRG] Tensorflow backend & Benchmarker
Dec 7, 2021
This is awesome, thank you so much @ncassereau-idris |
ncassereau
changed the title
[MRG] Tensorflow backend & Benchmarker
[MRG] Tensorflow backend & Benchmarker & Myst_parser
Dec 9, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Personal To do
Types of changes
Motivation and context / Related issue
Note that tensorflow does not know how to transpose inplace, which can have a negative impact on performance for any function which requires the usage of a transpose (More information here: https://www.tensorflow.org/api_docs/python/tf/transpose#expandable-1)
Note that nothing was done regarding the device consistency of our calculation (unlike TorchBackend for instance). This is due to the fact that tensorflow chooses the device automatically without caring about the device where inputs are located. If the user wants a specific device, this should be done outside of POT, probably something like
More information here: https://www.tensorflow.org/guide/gpu#overview
How has this been tested (if it applies)
Tested with Tensorflow 2.6.0 and 2.7.0. Benchmark with Tensorflow 2.6.0
Performance on Sinkhorn Knopp
The speedup is not as convincing as with cupy, might be due to how inefficient tensorflow transpose are. Still a great choice for very high dimensions.
Used pretty much the code from test/test_gpu.py::test_gpu_sinkhorn.
Tests were performed with Tensorflow 2.6.0, results in seconds, averaged over 100 runs.
Code used for the test
Checklist