mirror of
https://github.com/deepseek-ai/DeepSeek-V3.git
synced 2025-04-19 10:08:59 -04:00
Add CUDA cache clearing in memory management
Added torch.cuda.empty_cache() to free up unused memory on the GPU,
This commit is contained in:
parent
e6e66fd23f
commit
65d8f5f1e9
@ -60,6 +60,7 @@ def main(fp8_path, bf16_path):
|
|||||||
if len(loaded_files) > 2:
|
if len(loaded_files) > 2:
|
||||||
oldest_file = next(iter(loaded_files))
|
oldest_file = next(iter(loaded_files))
|
||||||
del loaded_files[oldest_file]
|
del loaded_files[oldest_file]
|
||||||
|
torch.cuda.empty_cache()
|
||||||
|
|
||||||
# Update model index
|
# Update model index
|
||||||
new_model_index_file = os.path.join(bf16_path, "model.safetensors.index.json")
|
new_model_index_file = os.path.join(bf16_path, "model.safetensors.index.json")
|
||||||
|
Loading…
Reference in New Issue
Block a user