Handle cache_position for transformers 4.47.0 and later (#528)#529
Handle cache_position for transformers 4.47.0 and later (#528)#529lancerts merged 2 commits intolinkedin:mainfrom BenasdTW:fix_qwen2vl_528
Conversation
|
LGTM! All test passed on my machine, including trasnformers 4.48.0 and 4.47.1.
btw, could you clarify what you mean by that? |
@Tcc0403 Thank you for taking the time to look into this! I have updated my previous comment.
|
|
Oh I see what you mean. You meant 4.48.0 couldn't pass the test without this PR, and applying this PR can fix the issue. Before merging it, let me ask liger team whether we should modify liger's backward compatibility ci. If so, we can update the ci to test this PR. |
Summary
Fix issue #528 by copying the new way to handle RoPE from transformers 4.48.0
Testing Done
Tested on (all worked with this PR, 4.48.0 didn't work with this PR):
pip install transformers==4.46.2
pip install transformers==4.46.3
pip install transformers==4.48.0
Before applying this PR, using training Qwen2-VL using
liger-kernelwithtransformers>=4.47.0would result in this error (issue #528):Inference test script:
Training test script:
My hardware is fairly weak, OOM running
make test. Might need further testing.make testto ensure correctnessmake checkstyleto ensure code stylemake test-convergenceto ensure convergence