Closed eaidova closed 3 weeks ago
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
what about the issue https://github.com/huggingface/transformers/issues/32848 which is the reason behind the default implementation change. Pretty sure it's a modeling incompatibility but can you make sure the snippet in the issue returns the correct outputs with sdpa+ov_model ?
@IlyasMoutawwakil , I tested gemma-2-2b-it, output seems correct:
['Let\'s count them! \n\nYou\'ve used the word "laugh" one times in your question. 😊 \n', 'There are two "laugh" words in your sentence. 😊 \n', 'There are three "laugh" words in the phrase "laugh laugh laugh". \n', 'There are four "laugh" words in the phrase "laugh laugh laugh laugh". \n', 'There are 5 "laugh" words in the phrase "laugh laugh laugh laugh laugh". \n']
P.S. as I understand issue appears for bfloat16 execution on cuda, that is not our case (even loading bf16 model weights in ov we try to preserve fp32 accuracy level and fallback nodes to this precision if there is overflow), there is difference from original answer due to difference in used cache format, but it does not impact meaning and I receive the same out if modify cache class for transfroemrs too
thanks for investigating 👍
What does this PR do?
transformers 4.45 introduces perf regression for gemma2 models due to switching default realization from sdpa to eager in this commit: https://github.com/huggingface/transformers/commit/975b988bfe6e7ebb47390cd9a1556c6888804883
benchmarking results for CPU:
Before submitting