-
Notifications
You must be signed in to change notification settings - Fork 39
Add the ability to benchmark throughput using multiple threads #359
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
Conversation
I assume the removal of the other decoders is temporary while getting everything working? On the chart generated by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't want to update the chart or data in this PR.
I just want the cli tool to have the option to benchmark throughput for now.
CUDA and decord may not work in the same process (I haven't tested those). I just wanted the ability to benchmark throughput. I already got an interesting finding that the cuda decoder is slower on some videos.
@@ -479,13 +480,50 @@ def get_metadata(video_file_path: str) -> VideoStreamMetadata: | |||
return VideoDecoder(video_file_path).metadata | |||
|
|||
|
|||
class BatchParameters(NamedTuple): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason we're using NamedTuple
and not a dataclass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it would be lighterweight than dataclass, but I am not too sure. Do you have a preference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer dataclasses. There are some instances where you need to use a namedtuple, but in general, I consider dataclasses to have supplanted namedtuples.
The batch mode is a new mode that decodes a batch of 40 copies of the decoder using 8 threads.
Tested: