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:
google-labs-jules[bot] 2025-10-14 06:57:18 +00:00
parent 19fa71d6e5
commit b09f7fc29b

View File

@ -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