transformers/tests/models/bert
JB (Don) dfa7b580e9
[`BERT`] Add support for sdpa (#28802)
* Adding SDPA support for BERT

* Using the proper input name for testing model input in inference()

* Adding documentation for SDPA in BERT model page

* Use the stable link for the documentation

* Adding a gate to only call .contiguous() for torch < 2.2.0

* Additions and fixes to the documentation

* Minor updates to documentation

* Adding extra requirements needed for the contiguous() bug

* Adding "Adapted from" in plcae of the "Copied from"

* Add benchmark speedup tables to the documentation

* Minor fixes to the documentation

* Use ClapText as a replacemenet for Bert in the Copied-From

* Some more fixes for the fix-copies references

* Overriding the test_eager_matches_sdpa_generate in bert tests to not load with low_cpu_mem_usage

[test all]

* Undo changes to separate test

* Refactored SDPA self attention code for KV projections

* Change use_sdpa to attn_implementation

* Fix test_sdpa_can_dispatch_on_flash by preparing input (required for MultipleChoice models)
2024-04-26 16:23:44 +01:00
..
__init__.py Move test model folders (#17034) 2022-05-03 14:42:02 +02:00
test_modeling_bert.py [`BERT`] Add support for sdpa (#28802) 2024-04-26 16:23:44 +01:00
test_modeling_flax_bert.py Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00
test_modeling_tf_bert.py Speed up TF tests by reducing hidden layer counts (#24595) 2023-06-30 16:30:33 +01:00
test_tokenization_bert.py Adds pretrained IDs directly in the tests (#29534) 2024-03-13 14:53:27 +01:00
test_tokenization_bert_tf.py Update all references to canonical models (#29001) 2024-02-16 08:16:58 +01:00