torchnvjpeg icon indicating copy to clipboard operation
torchnvjpeg copied to clipboard

Single decode and batch decode cost time different

Open basaltzhang opened this issue 1 year ago • 0 comments

Signle decode cost 137 ms per image Batch decode cost 0.64 ms per image

I guess the reason is the torchnvjpeg.Decoder parameter different, so I set the param without torch.cuda.current_stream(device_id), time is 137 ms with torch.cuda.current_stream(device_id), time is 69 ms

So I suggest use below to initialize. decoder = torchnvjpeg.Decoder(0, 0, True, device_id, batch_size, max_cpu_threads, max_image_size, torch.cuda.current_stream(device_id))

basaltzhang avatar Mar 02 '23 06:03 basaltzhang