cd /news/large-language-models/issue-with-llamasdpaattention-not-be… · home › topics › large-language-models › article
[ARTICLE · art-157269] src=discuss.huggingface.co ↗ pub= topic=large-language-models verified=true sentiment=· neutral

Issue with LlamaSdpaAttention Not Being Utilized

In Transformers 4.48.3, a model printing LlamaAttention in print(model) does not by itself indicate that SDPA is disabled, because LlamaAttention.forward selects its attention function internally via self.config._attn_implementation, according to a Hugging Face forum clarification. The post advises checking print(model.config._attn_implementation) as a first step, noting that this reports the configured implementation rather than proof of the GPU kernel actually executed, and that requesting output_attentions=True with SDPA triggers an eager-attention fallback in that version. The clarification states the unchanged class name is consistent with SDPA being selected and does not establish the cause of the separate memory issue reported.

read1 min views2 publishedOct 25, 2026

A version-specific clarification for @jacobvinje and future readers: in Transformers 4.48.3, seeing LlamaAttention in print(model) does not by itself mean SDPA is disabled.

In that version, LlamaAttention.forward selects its attention function internally using self.config._attn_implementation. The implementation is visible in the v4.48.3 source.

For an existing loaded model, this is a useful first check:

print(model.config._attn_implementation)

That reports the configured implementation, not proof of the GPU kernel actually executed. In this version, requesting output_attentions=True with SDPA triggers an eager-attention fallback. A profiler is needed to verify the executed operations and any memory implications.

So the unchanged class name is consistent with SDPA being selected; it is not, on its own, a reproducible backend failure. This clarification does not establish the cause of the separate memory issue you reported.

For a fuller explanation, I also maintain a free Transformer guide (English and Spanish). The KV-cache chapter explains the memory budget and why fitting in memory, retaining attention mass and preserving task quality are separate questions.

── more in #large-language-models 4 stories · sorted by recency
── more on @hugging face 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/issue-with-llamasdpa…] indexed:0 read:1min 2026-10-25 · —