Skip to content

Commit

Permalink
Update thread counts for TorchCodec (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadsharif1 authored Nov 20, 2024
1 parent eff34b9 commit afc1647
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 196 deletions.
8 changes: 3 additions & 5 deletions benchmarks/decoders/benchmark_decoders_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,7 @@ def get_consecutive_frames_from_video(self, video_file, numFramesToDecode):

class TorchCodecPublic(AbstractDecoder):
def __init__(self, num_ffmpeg_threads=None, device="cpu"):
self._num_ffmpeg_threads = (
int(num_ffmpeg_threads) if num_ffmpeg_threads else None
)
self._num_ffmpeg_threads = int(num_ffmpeg_threads) if num_ffmpeg_threads else 1
self._device = device

from torchvision.transforms import v2 as transforms_v2
Expand Down Expand Up @@ -628,7 +626,7 @@ def run_benchmarks(
},
label=f"video={video_file_path} {metadata_label}",
sub_label=decoder_name,
description=f"dataloader[threads={bp.num_threads} batch_size={bp.batch_size}] {num_samples} decode_and_transform()",
description=f"dataloader[threads={bp.num_threads},batch_size={bp.batch_size}] {num_samples} decode_and_transform()",
)
results.append(
dataloader_result.blocked_autorange(
Expand Down Expand Up @@ -673,7 +671,7 @@ def run_benchmarks(
decoder_name,
video_file_path,
num_samples,
f"{kind} seek()+next()",
f"{num_samples} x {kind} seek()+next()",
)
)

Expand Down
Binary file modified benchmarks/decoders/benchmark_readme_chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit afc1647

Please sign in to comment.