Multi GPU inference and write to dataframe

Good day for all.

I have a dataframe as input. I need to add a new column that compute some metric using a model. The dataframe has 150000 inputs and i have 4 gpus. One way to figure out was use DDP but i have doubts about there is a good practice. (I have seen nn.DataParalell is not recommended). Some other recoomendation?. I Have also ensure the order of the metrics: For example, if dataloder splits dataframe i need to ensure, for example, the metric with index 500 has to be written in these position in dataframe, not in another(i.e 800)(For this task i use the at function of dataframe. Some other recomendation or advice?. Regards

If you are unsure about using DDP (I assume because no actual training of a model takes place) you could just run different processes and assign the corresponding data shards to each of them. Layer you could then create the final output based on all output shards.