-
Notifications
You must be signed in to change notification settings - Fork 47
[torchcodec] Allow sampler to use GPU decoding #136
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
Closed
Closed
Conversation
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
This pull request was exported from Phabricator. Differential Revision: D60402239 |
ahmadsharif1
added a commit
to ahmadsharif1/torchcodec
that referenced
this pull request
Jul 31, 2024
Summary: Pull Request resolved: pytorch#136 Reviewed By: scotts Differential Revision: D60402239
f7c3f02
to
288b971
Compare
This pull request was exported from Phabricator. Differential Revision: D60402239 |
Summary: Pull Request resolved: pytorch#137 Pull Request resolved: pytorch#58 X-link: pytorch#58 1. Add CUDA support to VideoDecoder.cpp. This is done by checking what device is passed into the options and using CUDA if the device type is cuda. 2. Add -DENABLE_CUDA flag in cmake. 3. Check ENABLE_CUDA environment variable in setup.py and pass it down to cmake if it is present. 4. Add a unit test to demonstrate that CUDA decoding does work. This uses a different tensor than the one from CPU decoding because hardware decoding is intrinsically a bit inaccurate. I generated the reference tensor by dumping the tensor from the GPU on my devVM. It is possible different Nvidia hardware show different outputs. How to test this in a more robust way is TBD. 5. Added a new parameter for cuda device index for `add_video_stream`. If this is present, we will use it to do hardware decoding on a CUDA device. There is a whole bunch of TODOs: 1. Currently GPU utilization is only 7-8% when decoding the video. We need to get this higher. 2. Speed it up compared to CPU implementation. Currently this is slower than CPU decoding even for HD videos (probably because we can't hide the CPU to GPU memcpy). However, decode+resize is faster as the benchmark says. Differential Revision: D59121006 Reviewed By: scotts
This pull request was exported from Phabricator. Differential Revision: D60402239 |
288b971
to
e112494
Compare
ahmadsharif1
added a commit
to ahmadsharif1/torchcodec
that referenced
this pull request
Aug 1, 2024
Summary: Pull Request resolved: pytorch#136 Reviewed By: scotts Differential Revision: D60402239
Summary: Pull Request resolved: pytorch#136 Reviewed By: scotts Differential Revision: D60402239
This pull request was exported from Phabricator. Differential Revision: D60402239 |
e112494
to
c967b7c
Compare
This pull request has been merged in 33677b8. |
ahmadsharif1
added a commit
that referenced
this pull request
Aug 15, 2024
This reverts commit 33677b8.
NicolasHug
added a commit
to NicolasHug/torchcodec
that referenced
this pull request
Aug 28, 2024
This reverts commit 33677b8.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Reviewed By: scotts
Differential Revision: D60402239