transformers/tests/models
Sanchit Gandhi a9701953ff
[whisper] static kv cache (#31166)
* make work with cache abstraction

* correct for static cache

* hacks for compile

* make fast

* fix

* fix pos ids

* generate

* fix sdpa

* fix sdpa cache pos

* fix fa2

* clean fa2

* integrate cache into generate

* make style

* copies

* more copies

* update eager

* update sdpa

* update fa2

* simplify

* use cache pos

* always compute cross-cache for debug

* avoid recompiles
Co-authored-by: Arthur Zucker <arthur@huggingface.co>

* fix fix

* fix fix fix

* more fix

* try encoder-decoder cache (too messy)

* revert encoder-decoder cache

* check cross-attn cache

* use enc-dec dataclass

* use richer enc-dec dataclass

* clean-up

* revert static cache changes

* small fixes

* revert to cpu flag

* fix copies

* add static slow test

* past k/v docstring

* more docstrings

* cache_position docstrings

* add to docs

* add enc-dec cache to docs

* make style

* fix after rebase

* fix beam

* style

* fix generation strategies

* fix most decoder-only tests

* style

* skip test

* more clean up

* small docstrings

* Apply suggestions from code review

Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>

* add todo

* only crop self-attn

* check cache in mixin

* style

* fix re-compile after rebase

* move `is_updated` logic to enc-dec wrapper

* revert back

* revert cache back

* finalise design

* fix

* fix fix

* style

* Update src/transformers/cache_utils.py

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

* deprecate

* updates

* final updates

* style

* style

---------

Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
2024-07-02 13:24:15 +01:00
..
albert Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
align Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
altclip Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
audio_spectrogram_transformer Pass datasets trust_remote_code (#31406) 2024-06-17 17:29:13 +01:00
auto
autoformer
bark Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
bart Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
barthez Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
bartpho
beit Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
bert Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
bert_generation
bert_japanese
bertweet
big_bird Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
bigbird_pegasus Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
biogpt Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
bit Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
blenderbot Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
blenderbot_small Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
blip Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
blip_2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
bloom Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
bridgetower Add ViTImageProcessorFast to tests (#31424) 2024-06-25 13:36:58 +01:00
bros
byt5 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
camembert Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
canine Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
chinese_clip Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
clap Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
clip Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
clipseg Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
clvp Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
code_llama Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
codegen Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
cohere Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
conditional_detr Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
convbert Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
convnext Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
convnextv2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
cpm
cpmant Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
ctrl
cvt Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
data2vec Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
dbrx Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
deberta
deberta_v2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
decision_transformer
deformable_detr Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
deit Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
depth_anything Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
detr Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
dinat Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
dinov2
distilbert Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
dit
donut Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
dpr
dpt
efficientnet Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
electra Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
encodec Fix return_dict in encodec (#31646) 2024-06-28 12:18:01 +01:00
encoder_decoder Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
ernie Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
esm Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
falcon Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
fastspeech2_conformer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
flaubert Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
flava Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
fnet Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
focalnet Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
fsmt Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
funnel
fuyu Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
gemma Add gemma 2 (#31659) 2024-06-27 17:36:19 +02:00
gemma2 Fix post gemma merge (#31660) 2024-06-27 17:51:42 +02:00
git Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
glpn Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
gpt2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
gpt_bigcode Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
gpt_neo
gpt_neox [GPT-NeoX] Add SDPA support (#31031) 2024-06-26 13:56:36 +01:00
gpt_neox_japanese Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
gpt_sw3
gptj
grounding_dino Add ViTImageProcessorFast to tests (#31424) 2024-06-25 13:36:58 +01:00
groupvit Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
herbert Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
hubert Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
ibert Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
idefics Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
idefics2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
imagegpt Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
informer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
instructblip
instructblipvideo Add video modality for InstrucBLIP (#30182) 2024-06-25 15:45:39 +05:00
jamba Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
jetmoe Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
kosmos2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
layoutlm Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
layoutlmv2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
layoutlmv3 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
layoutxlm Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
led Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
levit Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
lilt
llama Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
llava Add LLaVa NeXT Video (#31252) 2024-06-26 21:52:28 +05:00
llava_next Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
llava_next_video Add LLaVa NeXT Video (#31252) 2024-06-26 21:52:28 +05:00
longformer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
longt5 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
luke Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
lxmert Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
m2m_100
mamba Mamba: add generative tests (#31478) 2024-06-19 10:27:23 +01:00
marian Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
markuplm Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mask2former Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
maskformer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mbart Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mbart50 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
megatron_bert Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
megatron_gpt2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mgp_str Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mistral Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mixtral Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mluke Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mobilebert Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mobilenet_v1
mobilenet_v2
mobilevit Pass datasets trust_remote_code (#31406) 2024-06-17 17:29:13 +01:00
mobilevitv2
mpnet Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mpt Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mra Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mt5 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
musicgen Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
musicgen_melody Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
mvp Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
nllb Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
nllb_moe Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
nougat Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
nystromformer
olmo Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
oneformer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
openai Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
opt Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
owlv2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
owlvit Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
paligemma Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
patchtsmixer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
patchtst
pegasus Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
pegasus_x Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
perceiver Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
persimmon Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
phi
phi3
phobert
pix2struct Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
plbart Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
poolformer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
pop2piano Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
prophetnet Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
pvt Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
pvt_v2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
qwen2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
qwen2_moe Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
rag Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
recurrent_gemma Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
reformer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
regnet Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
rembert SPLIT PR: add user defined symbols and control symbols (#31305) 2024-06-21 01:48:10 -07:00
resnet Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
roberta Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
roberta_prelayernorm
roc_bert
roformer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
rt_detr change anchor_image_size None for compatibility (#31640) 2024-06-27 12:36:55 +01:00
rwkv RWKV: enable generation tests (#31490) 2024-06-20 14:15:01 +01:00
sam
seamless_m4t Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
seamless_m4t_v2
segformer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
seggpt
sew Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
sew_d Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
siglip Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
speech_encoder_decoder Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
speech_to_text Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
speecht5 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
splinter
squeezebert
stablelm
starcoder2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
superpoint Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
swiftformer
swin Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
swin2sr Fix dtype casting in swinv2 and swinv2sr to allow non-FP32 inference (#31589) 2024-06-26 18:46:48 +01:00
swinv2 Fix dtype casting in swinv2 and swinv2sr to allow non-FP32 inference (#31589) 2024-06-26 18:46:48 +01:00
switch_transformers Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
t5 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
table_transformer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
tapas Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
time_series_transformer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
timesformer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
timm_backbone Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
trocr Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
tvp
udop Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
umt5 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
unispeech Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
unispeech_sat Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
univnet Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
upernet Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
video_llava Add LLaVa NeXT Video (#31252) 2024-06-26 21:52:28 +05:00
videomae Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
vilt Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
vipllava Add LLaVa NeXT Video (#31252) 2024-06-26 21:52:28 +05:00
vision_encoder_decoder Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
vision_text_dual_encoder Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
visual_bert
vit Add ViTImageProcessorFast to tests (#31424) 2024-06-25 13:36:58 +01:00
vit_mae
vit_msn
vitdet Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
vitmatte Use self.config_tester.run_common_tests() (#31431) 2024-06-19 10:18:08 +01:00
vits Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
vivit
wav2vec2 Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
wav2vec2_bert Pass datasets trust_remote_code (#31406) 2024-06-17 17:29:13 +01:00
wav2vec2_conformer Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
wav2vec2_phoneme Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
wav2vec2_with_lm Pass datasets trust_remote_code (#31406) 2024-06-17 17:29:13 +01:00
wavlm Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
whisper [whisper] static kv cache (#31166) 2024-07-02 13:24:15 +01:00
x_clip Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
xglm Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
xlm
xlm_roberta Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
xlm_roberta_xl
xlnet Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
xmod
yolos Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
yoso Skip tests properly (#31308) 2024-06-26 21:59:08 +01:00
__init__.py