running out of memory on introduction_to_stablediffusion.ipynb
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- jupyter-notebook, python, pytorch
調査の方向性
この issue は introduction_to_stablediffusion.ipynb にあり、具体的には base モデルと refiner モデルを実行しているセルが対象です。まず、T4 を使った Colab で GPU メモリの使用量を確認します。モデルの読み込みと推論の手順を確認し、バッチサイズ、画像解像度を小さくするか、gradient checkpointing のようなメモリ最適化手法を使用することを検討します。エラートレースは PyTorch の conv2d 操作を指しています。PYTORCH_CUDA_ALLOC_CONF などの環境変数を確認します。ノートブックを手順ごとに実行し、torch.cuda.memory_summary でメモリを監視すると、ピーク時の使用量を特定するのに役立ちます。
索引モデルが issue の本文から書いたものです。
説明
Thanks for this notebook @rkdan ! This is great!
In introduction_to_stablediffusion.ipynb running on Google Colab with an instance of a T4 GPU, I am running out of memory.
My code is here:
I can run until here (where I get an error):
# run both experts
image_base = base(
prompt=prompt,
num_inference_steps=n_steps,
denoising_end=high_noise_frac,
output_type="latent",
).images
image_final = refiner(
prompt=prompt,
num_inference_steps=n_steps,
denoising_start=high_noise_frac,
image=image_base,
).images[0]
Error message is
---------------------------------------------------------------------------
OutOfMemoryError Traceback (most recent call last)
<ipython-input-8-410c6a79b4f8> in <cell line: 0>()
7 ).images
8
----> 9 image_final = refiner(
10 prompt=prompt,
11 num_inference_steps=n_steps,
17 frames
/usr/local/lib/python3.11/dist-packages/torch/nn/modules/conv.py in _conv_forward(self, input, weight, bias)
547 self.groups,
548 )
--> 549 return F.conv2d(
550 input, weight, bias, self.stride, self.padding, self.dilation, self.groups
551 )
OutOfMemoryError: CUDA out of memory. Tried to allocate 512.00 MiB. GPU 0 has a total capacity of 14.74 GiB of which 306.12 MiB is free. Process 6006 has 14.44 GiB memory in use. Of the allocated memory 14.17 GiB is allocated by PyTorch, and 145.94 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)
My code is here:
- 主要言語
- Jupyter Notebook
- スター
- 21
- フォーク
- 11
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
acceleratescience/diffusion-models のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
Add devcontainer オープンenhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
acceleratescience/diffusion-models#10 · 担当者 1 名 ·
acceleratescience/diffusion-models の issue をすべて見る
似ている issue
-
area/config comp/cli comp/plugins P3 Plugin Catalog sweeper:risk-compatibility tool/memory type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#119909 · コメント 1 件 ·
-
bug configuration documentation examples policies processor tests training
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
huggingface/lerobot#4727 ·
-
📱 AI 日报 · 2026-09-23 オープンai-content daily-post
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
run-llama/llama_index#23199 ·
-
p:2-high pydanty:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
pydantic/pydantic-ai#8642 · コメント 2 件 ·