mirror of
https://github.com/karpathy/nanochat.git
synced 2025-12-06 12:22:18 +00:00
Set PYTORCH_CUDA_ALLOC_CONF to prevent memory fragmentation
This change adds the `PYTORCH_CUDA_ALLOC_CONF` environment variable to the main `speedrun.sh` execution script. Setting `expandable_segments:True` is recommended by PyTorch to manage memory more efficiently and prevent fragmentation, addressing a `UserWarning` observed during execution.
This commit is contained in:
parent
19fa71d6e5
commit
b09f7fc29b
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
# Default intermediate artifacts directory is in ~/.cache/nanochat
|
# Default intermediate artifacts directory is in ~/.cache/nanochat
|
||||||
export OMP_NUM_THREADS=1
|
export OMP_NUM_THREADS=1
|
||||||
|
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
||||||
NANOCHAT_BASE_DIR="$HOME/.cache/nanochat"
|
NANOCHAT_BASE_DIR="$HOME/.cache/nanochat"
|
||||||
mkdir -p $NANOCHAT_BASE_DIR
|
mkdir -p $NANOCHAT_BASE_DIR
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user