{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreieyv3ffqyv46cyry7spz6y6x5wghhwdgf42bgcznrp6qdpxvm6nbm",
"uri": "at://did:plc:pgryn3ephfd2xgft23qokfzt/app.bsky.feed.post/3ml6isyvpjqq2"
},
"path": "/t/running-out-of-memory-in-the-summary-example/175777#post_1",
"publishedAt": "2026-05-06T08:33:52.000Z",
"site": "https://discuss.huggingface.co",
"tags": [
"notebooks/examples/summarization.ipynb at main · huggingface/notebooks · GitHub"
],
"textContent": "I am trying to run this notebook locally: notebooks/examples/summarization.ipynb at main · huggingface/notebooks · GitHub\nI am running on mac m2 with python 3.14.\nThe only change I did is to install additional dependencies (pip install datasets transformers torch torchvision torchaudio accelerate).\nDuring the train process I see the memory goes up like a memory leak. After some run time (something like 1300 steps) I get an error of out of memory for the device.\n“RuntimeError: MPS backend out of memory (MPS allocated: 4.20 GiB, other allocations: 43.49 GiB, max allowed: 47.74 GiB). Tried to allocate 51.44 MiB on private pool. Use PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 to disable upper limit for memory allocations (may cause system failure).”\nI tried to run torch.mps.empty_cache() but it didn’t change\nWhat can be my issue? How can I fix this memory issue so I will be able to train the model?\nI don’t want to set PYTORCH_MPS_HIGH_WATERMARK_RATIO to 0 as it seems like just a hack, and to fix my core issue about the memory leak\nThank for you helping!",
"title": "Running out of memory in the summary example"
}