huggingface
memory_error
ai_generated
true
OutOfMemoryError during attention computation
ID: huggingface/attention-sink-oom
78%Fix Rate
82%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 4 | active | — | — | — |
Root Cause
Attention mechanism OOM on long sequences.
genericWorkarounds
-
90% success Use Flash Attention 2: model.from_pretrained(attn_implementation="flash_attention_2")
-
85% success Reduce max_length or use sliding window attention
Dead Ends
Common approaches that don't work:
-
Pad all sequences to max length
78% fail
Wastes memory on short sequences
-
Remove attention mask
88% fail
Wrong attention computation