Update CUDA custom op unit tests to account for recent ORT change - #6971
Merged
Conversation
hariharans29
commented
Mar 10, 2021
hariharans29
commented
Mar 11, 2021
skottmckay
reviewed
Mar 11, 2021
Contributor
|
Assuming doco on https://www.onnxruntime.ai/docs/how-to/add-custom-op.html will be updated separately to describe what's necessary to create a working CUDA based custom op and why. |
Member
Author
Yes, will come in a separate change |
skottmckay
reviewed
Mar 12, 2021
| ${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/utils.h | ||
| ${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/utils.cc) | ||
| ${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/utils.cc | ||
| ${ONNXRUNTIME_SHARED_LIB_TEST_SRC_DIR}/custom_op_utils.h |
Member
Author
There was a problem hiding this comment.
Will combine with another PR
This file contains hidden or 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
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.
Description: #3723 made a change to move the hand-crafted ORT CUDA kernels from the per-thread default stream to a compute stream that ORT created by default or a user provided compute stream. This change will require exposing an interface in custom ops to obtain ORT's compute stream or at the very least update the CUDA custom op unit tests so as to show that a user needs to use the same compute stream for both the ORT kernels (passed in via session options) and their custom kernels for synchronization. This change updates the unit tests.
Motivation and Context
The unit tests will work as is as they are just single node toy models but if users were to adapt existing custom op implementations for their models that will require interleaving with ORT's existing CUDA kernels, they will lack synchronization and result in garbage output. Hence, this change for illustrative purposes.
(Takeaway from #6952)