parallelformers icon indicating copy to clipboard operation
parallelformers copied to clipboard

Recommended way for cleaning up?

Open creatorrr opened this issue 2 years ago • 0 comments

Hi there!

Thanks for the awesome work on this lib! Just wanted to ask what the recommended way is to clean up a loaded model that has been parallelized using this library. What method should be called to clean up all the resources, move data out of the GPU, empty cuda cache and shut down the master process?

Tried to run this but it hanged:

model = ...
p = parallelize(
    model, 
    num_gpus=2, 
    fp16=True, 
    verbose="simple",
)

# Do some inference

p.deparallelize()  # --> This hanged

creatorrr avatar Mar 22 '22 18:03 creatorrr