Add xpu support to decoder benchmark scripts#1
Open
jonrecker wants to merge 2 commits intodvrogozh:enable-xpufrom
Open
Add xpu support to decoder benchmark scripts#1jonrecker wants to merge 2 commits intodvrogozh:enable-xpufrom
jonrecker wants to merge 2 commits intodvrogozh:enable-xpufrom
Conversation
* Add check_decoder_support function to benchmark_decoders_library * Add argument parsing in generate_readme_data: --decoders option to specify list of decoders to test --resize_device option to specify device for resize * Warn and skip tests if requested backends (xpu, cuda) or implementations (torchaudio, torchvision) are not supported
5025b6d to
97c1ec2
Compare
dvrogozh
reviewed
Aug 26, 2025
| return True | ||
|
|
||
| if decoder_type == "torchvision": | ||
| try: |
Owner
There was a problem hiding this comment.
This does not quite help:
$ python3 benchmark_decoders.py --decoders decord,decord_batch,torchcodec_core,torchcodec_core_batch,torchcodec_core_compiled,torchcodec_public,torchcodec_public_nonbatch
Traceback (most recent call last):
File "/home/dvrogozh/git/pytorch/torchcodec/benchmarks/decoders/benchmark_decoders.py", line 172, in <module>
main()
File "/home/dvrogozh/git/pytorch/torchcodec/benchmarks/decoders/benchmark_decoders.py", line 129, in main
decoders_to_run[display] = kind(**options)
File "/home/dvrogozh/git/pytorch/torchcodec/benchmarks/decoders/benchmark_decoders_library.py", line 382, in __init__
from torchvision.transforms import v2 as transforms_v2
ModuleNotFoundError: No module named 'torchvision'
Author
There was a problem hiding this comment.
This check was only enabled in generate_readme_data.py since the other scripts allow specifying which decoders to test. But it is no problem to add checks to the other benchmarks also. Latest commit updates benchmark_decoders.py and gpu_benchmark.py to fail gracefully if dependencies are missing, and run the remaining tests if possible.
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.
--decoders option to specify list of decoders to test
--resize_device option to specify device for resize
New options for generate_readme_data.py:
Sample command-lines to run benchmark scripts with xpu enabled: