Comments (2)
Given the logic below, we cannot enforce the model to use eager attention, since config._attn_implementation
falls back to eager when config._attn_implementation_internal
is None [1]. Hence, the if condition config._attn_implementation != kwarg_attn_imp
cannot hold, and the config._attn_implementation_internal
will be not affected, resulting a SDPA attention [2].
transformers/src/transformers/modeling_utils.py
Lines 3138 to 3150 in e4ea19b
I think we should use config._attn_implementation_internal != kwarg_attn_imp
instead
1:
transformers/src/transformers/configuration_utils.py
Lines 406 to 420 in e4ea19b
2:
transformers/src/transformers/modeling_utils.py
Lines 1461 to 1466 in e4ea19b
from transformers.
cc @fxmarty
from transformers.
Related Issues (20)
- Trainer memory leak for evaluation with `compute_metrics`
- Llama Model throwing "RuntimeError: expected scalar type BFloat16 but found Float" when using torch.compile and AMP together HOT 6
- [LLaMA3] 'add_bos_token=True, add_eos_token=True' seems not taking effect HOT 4
- google/siglip-so400m-patch14-384 inference output mismatch with pipeline output HOT 4
- Why using empty tensor to initialize? HOT 3
- Allow `ConversationalPipeline` to receive string input HOT 3
- Weird behaviour running AWQ code on RTX 4000 Ada that worked on Tesla T4 HOT 5
- AttributeError: 'BertModel' object has no attribute 'attn_implementation' HOT 7
- Training GPT2 with run_clm.py exceeds the described memory amount . HOT 2
- LayoutLMv3 Significant Training Slowdown from 4.33.3 -> 4.34.0 and beyond versions HOT 13
- Off-by-one error in strided perplexity calculation
- RuntimeError: unique_by_key: failed to synchronize: cudaErrorIllegalAddress: an illegal memory access was encountered HOT 2
- Autotokenizer."from_pretrained" read wrong config file. not "tokenizer_config.json", but "config.json" HOT 3
- ViTLayer.forward() needs to be in "eager" mode when `output_attentions=True` HOT 2
- Fix for hardcoded `final_labels` to enable loss calculation in PaliGemma HOT 9
- Sentence Transformers Gets Stuck loading HOT 3
- Paligemma causal attention still not causal ? HOT 5
- Add Nomic Embed Code to Transformers HOT 2
- loss calculation for PaliGemmaForConditionalGeneration potentially not cast to correct device HOT 2
- Trainer should throw a warning if max_sequence_length < number of tokens in dataset sample record. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transformers.