Replies: 12 comments
|
Hi We don't have such a plan, but what kind of task do you have in your mind? |
|
Using the video hw accelerated pipeline and seeking without going to reintegrate twice with the ffmpeg low level API natively in pytorch. E.g. In the video example here we need to manipulate a lot of low level API I think it is a little bit less practical from a classical ML/AI pipeline. https://github.com/facebookresearch/spdl/blob/main/examples/streaming_nvdec_decoding.py |
|
I see. Unfortunately, I am not familiar with Torchcodec. Maybe @NicolasHug or someone else from the team can help on that. |
|
Hi folks, I'm happy to help review a PR that adds a TorchCodec-based tutorial, if that's in scope for SPDL. |
|
Is there any relationship between the official data/datalodaer refactoring and this project? This could help to understand a TorchCodec role in the integration. |
By "the official data/datalodaer refactoring", I assume you are referring to activities in PyTorch org. SPDL was developed at Meta Reality Lab to solve the data loading bottleneck of production system. So in a sense PyTorch data nodes is a derivative of SPDL. |
|
I was mainly talking about the mega thread at meta-pytorch/data#1196 but it is hard today to track things on this topic on the current STOA. For sure the problem related to efficiently handling video/images pipelines it is still quite important but it is not clear on what repo investing as a third party. |
|
Yes. The data loading bottleneck is everywhere and it hinders other efforts like model optimization. It is extremely important problem to solve, and it gets harder to solve each year when new generation of GPU appears. Unfortunately, the architecture of PyTorch's DataLoader is not suited for solving the task, so we built SPDL while meeting the important criteria and keeping the solution as generic as possible. What PyTorch wants to do with their projects and what they envision in ecosystem is on them, so I can only hope for their best. |
|
Yes I totally agree on your points this is really one of the main data pipeline priority for the ecosystem IMHO. This is why I have asked here about TorchCodec as I suppose it could potentially remove some boil-operate relatively low level/recurrent ffmpeg interfacing code at least. |
|
Are you interested in if we provide a simpler interface? The potential problem with TorchCodec's GPU decoder is that it relies on GPU-enabled ffmpeg (libav).
For 1, FFmpeg creates CUDA context when initializing a CUDA decoder. This consumes 500MB of GPU memory. When attempting to use all the NVDEC ships (for example 7 chips on H100), it can consume 3.5 GB of GPU memory. This memory consumption might be acceptable depending on the application, but I feel it is unnecessary. For 2, FFmpeg's CUDA decoder plugin calls For 3, What makes difficult to take advantage of GPU video decoder is its initialization time. It takes about 300ms in my benchmark. There are couple of ways to avoid re-initialization. NVDEC has reconfigure mechanism, which can avoid the expensive decoder initialization cost when the only difference of videos are the resolutions. As a bonus, SPDL I/O does not require GPU-enabled FFmpeg to use NVDEC, which is handy for OSS users. |
|
Moto just so you know we have addressed these in TorchCodec's new "beta" CUDA interface we released recently, which doesn't rely on FFmpeg: https://github.com/meta-pytorch/torchcodec/releases/tag/v0.8.0 For point 3, we're not re-configuring the |
|
@bhack I briefly looked at the documentation of torchcodec, and I see that all the decoding logic is put behind of This suggests that all you can do / have to do to integrate it with SPDL is just to write a wrapper function and pass it to Something like the following. |
Uh oh!
There was an error while loading. Please reload this page.
Do you plan to have examples with Torchcodec?
https://github.com/meta-pytorch/torchcodec
All reactions