Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Mono-InternVL with PyTorch backend #2727

Merged
merged 5 commits into from
Nov 11, 2024

Conversation

wzk1015
Copy link
Contributor

@wzk1015 wzk1015 commented Nov 7, 2024

Support Mono-InternVL with Pytorch backend by creating internlm2_ve.py and adding is_mono in internvl.py. The MoE structure is implemented with vision_embedding_indexing and text_embedding_indexing. Also fix some typos.

@lvhan028 lvhan028 added the enhancement New feature or request label Nov 8, 2024
@grimoire
Copy link
Collaborator

grimoire commented Nov 8, 2024

OMG, we have so many typos...

@lvhan028
Copy link
Collaborator

lvhan028 commented Nov 8, 2024

@zhulinJulia24 Please add Mono-InternVL into test cases

@wzk1015
Copy link
Contributor Author

wzk1015 commented Nov 8, 2024

One known bug is that Mono-InternVL encounters NaN when using float16 (this issue), due to some numerical instability. We will fix this in the next version of model, but for the current version I think float16 is not supported. Bfloat16 works fine. Should I add a note in FP16/BF16 of supported_models.md?

I test KV INT 8 and INT 4 and they work fine. For W8A8 and W4A16 I suppose they are not supported, following InternVL2 PyTorchEngine.

@lvhan028
Copy link
Collaborator

lvhan028 commented Nov 8, 2024

One known bug is that Mono-InternVL encounters NaN when using float16 (this issue), due to some numerical instability. We will fix this in the next version of model, but for the current version I think float16 is not supported. Bfloat16 works fine. Should I add a note in FP16/BF16 of supported_models.md?

I test KV INT 8 and INT 4 and they work fine. For W8A8 and W4A16 I suppose they are not supported, following InternVL2 PyTorchEngine.

Sure. A note about this situation is appreciated.

Copy link
Collaborator

@grimoire grimoire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@RunningLeon RunningLeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lvhan028 lvhan028 merged commit 06aea5d into InternLM:main Nov 11, 2024
5 checks passed
@wzk1015 wzk1015 mentioned this pull request Nov 11, 2024
AllentDan pushed a commit to AllentDan/lmdeploy that referenced this pull request Nov 13, 2024
* support Mono-InternVL; fix typos

* update readme

* add assertion for FP16

* add assertion for FP16

* update _SUPPORTED_ARCHS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants