NVIDIA / DALI

A GPU-accelerated library containing highly optimized building blocks and an execution engine for data processing to accelerate deep learning training and inference applications.
https://docs.nvidia.com/deeplearning/dali/user-guide/docs/index.html
Apache License 2.0
5.14k stars 620 forks source link

GitHub Roadmap 2024 #5320

Open JanuszL opened 8 months ago

JanuszL commented 8 months ago

The following represents a high-level overview of our 2024 plan. Please be aware that this roadmap may change at any time and the order below does not reflect the priority of our future efforts.

We strongly encourage you to comment on our roadmap and provide us with feedback.

Some of the items mentioned below are the continuation of the 2023 effort (https://github.com/NVIDIA/DALI/issues/4578)

Improving Usability:

Extending input format support:

Performance:

New transformations:

We are constantly extending the set of operations supported by DALI. Currently, this section lists the most notable additions to our areas of interest that we plan to do this year. This list is not exhaustive and we plan on expanding the set of operators as the needs or requests arise.

5had3z commented 8 months ago

I've recently come across some few gaps in datatype compatibility.

For example I have a int32 mask, I want to perform the usual random rotate -> scale -> flip -> ... etc pipeline for augmentation. Scale does not support int32, but does support uint16....however flip does not support uint16. FP16 is also relatively weak in areas.

I think an audit of currently accepted datatypes in some of the operations, and check the reason why it is missing (maybe an NPPI impl isn't available), and if there is no particular reason, how it can be unblocked.

mzient commented 8 months ago

@5had3z Thanks for pointing this out. Some of the types were probably overlooked and we can take a look at what we can do. Some others were trimmed to limit the binary size. Each additional type typically translates into a kernel instantiation. If there are multiple types (multiple inputs, outputs) the size quickly gets out of control. Finally, as you pointed out, in some cases we depend on external libraries and are limited by what they support.

5had3z commented 8 months ago

@5had3z Some others were trimmed to limit the binary size. Each additional type typically translates into a kernel instantiation. If there are multiple types (multiple inputs, outputs) the size quickly gets out of control.

I have zero experience with this, so have no idea on the feasibility. But would there perhaps be a way to JIT operations that have these large parameter spaces? Some ops could still be done ahead of time for faster pipeline start-up times for the common cases, and uninstantiated ones done on the fly.

Another catch-22 I have is that I want my pytorch DALIGenericIterator to know the "size" of my dataset, but if I use an external_source that is a python function, I don't get to use reader_name and I get a bunch of complaints about using size and last_batch_padded (the pipeline itself seemingly works fine anyway). I would be comfortable in writing my custom source dataset in c++, but I haven't looked into it deeply since there isn't pre-written tutorial yet.

JanuszL commented 8 months ago

@5had3z

I have zero experience with this, so have no idea on the feasibility. But would there perhaps be a way to JIT operations that have these large parameter spaces? Some ops could still be done ahead of time for faster pipeline start-up times for the common cases, and uninstantiated ones done on the fly.

I think you hit the spot. The runtime compilation is getting more and more established in the industry and DALI is also looking into different implementations of such capabilities. For now you can use CuPy or Numba to define operation in Python and have it compiled. We are also working on exploring approaches to the native operations DALI currently supports.

Another catch-22 I have is that I want my pytorch DALIGenericIterator to know the "size" of my dataset, but if I use an external_source that is a python function, I don't get to use reader_name and I get a bunch of complaints about using size and last_batch_padded (the pipeline itself seemingly works fine anyway). I would be comfortable in writing my custom source dataset in c++, but I haven't looked into it deeply since there isn't pre-written tutorial yet.

I'm afraid that is one of the limitations of the external source operator, while it gives you the freedom of returning any number of batches it strips the iterator of the knowledge of any samples/batches is may expect. The most flexible approach, in this case, is to always return full batches of data from the external source and just pad it with either a duplicated sample or ones that are randomly selected from the whole data set.

idobenamram commented 3 days ago

are you guys thinking of working on dali for rust? would help for when we don't want to use the triton server

JanuszL commented 3 days ago

Hi @idobenamram,

Thank you for reaching out.

are you guys thinking of working on dali for rust?

What exactly do you have in mind? Is it the native API (similar to our C API) to run the pipeline or similar to our Python one?

idobenamram commented 3 days ago

Wow thanks for the quick response @JanuszL, ya sorry maybe I should clarify. Right now we have 2 separate ways of working with our models; The first is the "production" way using triton's inference server, and the second is using onnx runtime when we want to run locally or in any other setting that doesn't have the triton server up and running. We work mainly in rust so for most of our models we call ort directly in rust. Currently we don't have a good solution for our dali pipelines, which are written in python then use triton to execute. This means we implement the part we do in dali twice for when we want to use onnx. I was thinking it could be cool to have the ability to run dali from rust like you would be able to in python. Thanks again!

JanuszL commented 3 days ago

@idobenamram would https://github.com/rust-lang/rust-bindgen do in your case applied to https://github.com/NVIDIA/DALI/blob/main/include/dali/c_api.h? You can use daliCreatePipeline to create the pipeline, daliRun to run and daliOutput to get the data. You can refer to https://github.com/NVIDIA/DALI/blob/main/dali/c_api/c_api_test.cc or https://github.com/NVIDIA/DALI/blob/main/dali_tf_plugin/daliop.cc to see how to use it.

klecki commented 3 days ago

The C API is meant to run the Pipeline that was already defined in Python. You can use this method to serialize the Pipeline to a file, which can be later loaded in the C API: https://docs.nvidia.com/deeplearning/dali/main-user-guide/docs/pipeline.html#nvidia.dali.Pipeline.serialize

idobenamram commented 3 days ago

oh, wow thats actually really cool, i didn't know that existed. so all i really need to do is create a small wrapper for the C API in rust. is this something u guys would be interested in? I can do it on my side but then no one else would be able to use it.

JanuszL commented 3 days ago

is this something u guys would be interested in? I can do it on my side but then no one else would be able to use it.

If you can contribute the necessary automation for it to DALI that would be great. We would be more than happy to guide you.