Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 07cb0ce

Browse files
authored
Implement MPS memory checks in pull workflow
1 parent a5f2264 commit 07cb0ce

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/pull.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,16 @@ jobs:
695695
export MODEL_PATH=checkpoints/stories15M/stories15M.pt
696696
export MODEL_NAME=stories15M
697697
export MODEL_DIR=/tmp
698-
export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0
698+
python - <<'PY'
699+
import torch
700+
if torch.backends.mps.is_available():
701+
try:
702+
print("MPS current:", torch.mps.current_allocated_memory() / (1024**3), "GiB")
703+
print("MPS driver :", torch.mps.driver_allocated_memory() / (1024**3), "GiB")
704+
print("MPS peak :", torch.mps.driver_allocated_memory() / (1024**3), "GiB")
705+
except Exception:
706+
pass
707+
PY
699708
700709
python3 torchchat.py generate --device mps --checkpoint-path ${MODEL_PATH} --temperature 0
701710

0 commit comments

Comments
 (0)