llama-stack/llama_stack/providers/inline/post_training/torchtune
Botao Chen 52a21ce78f
Free up memory after post training finishes (#770)
## context 
Currently, the GPU memory will be continuously occupied after the
training finishes. In this PR, we explicitly delete the reference and
clean up the memory after training finishes.

## test
Before the change, after training a llama 3.2 3B model, >6GB GPU memory
is still occupied

After the change, after training a llama 3.2 3B model, the GPU memory
drops to ~1GB

<img width="156" alt="Screenshot 2025-01-14 at 6 05 17 PM"
src="https://github.com/user-attachments/assets/45d212b1-a651-49f3-aad9-1c0a27fcebcf"
/>
2025-01-14 19:19:38 -08:00
..
common [post training] define llama stack post training dataset format (#717) 2025-01-14 12:48:49 -08:00
datasets [post training] define llama stack post training dataset format (#717) 2025-01-14 12:48:49 -08:00
recipes Free up memory after post training finishes (#770) 2025-01-14 19:19:38 -08:00
__init__.py [1/n] torchtune <> llama-stack integration skeleton (#540) 2024-12-13 11:05:35 -08:00
config.py [1/n] torchtune <> llama-stack integration skeleton (#540) 2024-12-13 11:05:35 -08:00
post_training.py [remove import *] clean up import *'s (#689) 2024-12-27 15:45:44 -08:00