Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ autocast_dtype: torch.bfloat16 # dtype for torch.autocast for validate_model
block_size: 8192
bos_rate: 0.5
data_column: messages
val_dataset_name: validation
val_dataset_name: valid
shuffle_seed: 81436
seed: 42
fim_rate: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

# mypy: ignore-errors

import gc
import json
import warnings
from functools import partial
Expand Down Expand Up @@ -219,6 +220,15 @@ def validate_puzzle_solutions(args: DictConfig) -> None:
torch.cuda.empty_cache()
torch.cuda.synchronize()

# Stitching installs hooks that create reference cycles between the
# model and its hook closures, so the per-solution CPU model is not
# reclaimed by refcounting alone. Drop references and force a cyclic
# GC pass to avoid accumulating one full model per iteration (host
# RAM OOM / SIGKILL after ~25 solutions on an 8B model).
del stitched_model
del model
gc.collect()

dist.barrier()


Expand Down
Loading