transformers icon indicating copy to clipboard operation
transformers copied to clipboard

add `_no_split_modules` attribute to SiglipVisionModel class

Open power0341 opened this issue 1 year ago • 2 comments

What does this PR do?

fix the bug: ValueError: SiglipVisionModel does not support device_map='auto'. To implement support, the model class needs to implement the _no_split_modules attribute.

Before submitting

  • [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • [x] Did you read the contributor guideline, Pull Request section?
  • [ ] Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case.
  • [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
  • [ ] Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.

power0341 avatar Apr 08 '24 03:04 power0341

Hi @power0341, thanks for opening this PR!

There's a relevant issue here: https://github.com/huggingface/transformers/issues/29786

To make sure this addition resolves the issue, please run the accelerate tests to confirm this enables device_map="auto":

pytest tests/models/{MODEL_NAME}/test_modeling_{MODEL_NAME}.py -vv -k "offload or parallelism"

amyeroberts avatar Apr 08 '24 07:04 amyeroberts

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar May 08 '24 08:05 github-actions[bot]