Skip to content

bug fix: don't swallow OutOfMemoryError when enable_memory_snapshot=True - #2374

Merged
weifengpy merged 1 commit into
pytorch:mainfrom
weifengpy:oom-error
Feb 12, 2026
Merged

weifengpy merged 1 commit into
pytorch:mainfrom
weifengpy:oom-error

Conversation

@weifengpy

@weifengpy weifengpy commented Feb 12, 2026 •

Copy link
Copy Markdown
Contributor

fix #2362

claude ran a OOM job to verified 3 things. super safe!

  1. Exit code 1 (not 0) — the process failed as expected:
    exitcode : 1 (pid: 2663521)

  2. The OOM traceback was surfaced instead of being swallowed:
    torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 14.00 GiB. GPU 0 has a total capacity of 94.99 GiB of which 9.30 GiB is free.

  3. The memory snapshot was still saved before the error propagated:
    outputs/memory_snapshot/iteration_0_exit/rank0_memory_snapshot.pickle

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 12, 2026
@weifengpy
weifengpy merged commit ba8ace6 into pytorch:main Feb 12, 2026
29 checks passed
TXacs pushed a commit to McmillanTAC/torchtitan that referenced this pull request Apr 13, 2026
…rue (pytorch#2374)

fix pytorch#2362

claude ran a OOM job to verified 3 things. super safe!

1. Exit code 1 (not 0) — the process failed as expected:
  exitcode  : 1 (pid: 2663521)

  2. The OOM traceback was surfaced instead of being swallowed:
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 14.00 GiB.
GPU 0 has a total capacity of 94.99 GiB of which 9.30 GiB is free.

  3. The memory snapshot was still saved before the error propagated:
  outputs/memory_snapshot/iteration_0_exit/rank0_memory_snapshot.pickle
ACharacterInASimulation pushed a commit to ACharacterInASimulation/torchtitan that referenced this pull request Apr 21, 2026
…rue (pytorch#2374)

fix pytorch#2362

claude ran a OOM job to verified 3 things. super safe!

1. Exit code 1 (not 0) — the process failed as expected:
  exitcode  : 1 (pid: 2663521)

  2. The OOM traceback was surfaced instead of being swallowed:
torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 14.00 GiB.
GPU 0 has a total capacity of 94.99 GiB of which 9.30 GiB is free.

  3. The memory snapshot was still saved before the error propagated:
  outputs/memory_snapshot/iteration_0_exit/rank0_memory_snapshot.pickle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

maybe_enable_memory_snapshot silently swallows OutOfMemoryError

3 participants