Skip to content

fix: CUDA OOM handling on older torch#3908

Open
Chessing234 wants to merge 1 commit into
lm-sys:mainfrom
Chessing234:fix/1627-cuda-oom-old-torch
Open

fix: CUDA OOM handling on older torch#3908
Chessing234 wants to merge 1 commit into
lm-sys:mainfrom
Chessing234:fix/1627-cuda-oom-old-torch

Conversation

@Chessing234

Copy link
Copy Markdown

Summary

  • except torch.cuda.OutOfMemoryError raises AttributeError on torch 1.12
  • Detect OOM via RuntimeError message / exception name instead

Fixes #1627

Test plan

  • Import/run model_worker on torch without cuda.OutOfMemoryError

Made with Cursor

Older torch (e.g. 1.12) lacks that attribute; detect OOM via RuntimeError (lm-sys#1627).

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: module 'torch.cuda' has no attribute 'OutOfMemoryError'

1 participant