Skip to content

Conversation

noooop
Copy link
Collaborator

@noooop noooop commented May 12, 2025

Summary

  • support GTE NewModel
    • Alibaba-NLP/gte-multilingual-base
    • Alibaba-NLP/gte-base-en-v1.5
    • Alibaba-NLP/gte-large-en-v1.5
  • validate models previously supported
    • BertModel
      • thenlper/gte-large
      • thenlper/gte-base
      • thenlper/gte-small
      • thenlper/gte-large-zh
      • thenlper/gte-base-zh
      • thenlper/gte-small-zh
    • Qwen2ForCausalLM
      • Alibaba-NLP/gte-Qwen2-1.5B-instruct
      • Alibaba-NLP/gte-Qwen2-7B-instruct
    • ModernBertModel
      • Alibaba-NLP/gte-modernbert-base

Details

GTE NewModel

GTE NewModel uses NTKScalingRotaryEmbedding(RotaryEmbedding extended with fixed and mixed NTK scaling. https://kexue.fm/archives/9706)

Alibaba-NLP/gte-base-en-v1.5: type_vocab_size == 0

The second-generation GTE model (mGTE-TRM) is named NewModel. The name NewModel is too generic, you should set --hf-overrides '{"architectures": ["GteNewModel"]}' to specify the use of the GteNewModel architecture.

numerical stability

BertModel require float32 to achieve relatively good numerical stability (<1e-4).

float16 thenlper/gte-large 0.7680763719749079 -0.23436936369131067 0.007572298762589869
float32 thenlper/gte-large 0.7680763719749079 -2.4026911306096466e-06 7.336910572172527e-06

although torch_dtype is float16 in config.json. weird.

Other models can also achieve good results with float16.

float16 Alibaba-NLP/gte-multilingual-base 0.7750746088095989 -2.6885162520251527e-05 1.1313339850093886e-05
float32 Alibaba-NLP/gte-multilingual-base 0.7750746088095989 -5.2213094295927576e-06 7.063984056561489e-06

float16 Alibaba-NLP/gte-modernbert-base 0.7481935698597016 -3.955676059219648e-05 1.221876070985973e-05
float32 Alibaba-NLP/gte-modernbert-base 0.7481935698597016 -1.3103018835503022e-05 5.7769652475943475e-06

Alibaba-NLP/gte-Qwen2-1.5B-instruct

Adding {"is_causal": True} can get results consistent with SentenceTransformer.

float16 Alibaba-NLP/gte-Qwen2-1.5B-instruct 0.7280529229028553 5.124313459714536e-05 1.6385524234026275e-05

Not adding {"is_causal": True} can get better results on STS12 dataset

float16 Alibaba-NLP/gte-Qwen2-1.5B-instruct 0.7280529229028553 0.030351551441818114 1.2688565748575559e-05

tests Involved

pytest tests/models/language/pooling/test_gte.py

Fix #13616

Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added the documentation Improvements or additions to documentation label May 12, 2025
@DarkLight1337 DarkLight1337 enabled auto-merge (squash) May 13, 2025 08:32
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label May 13, 2025
auto-merge was automatically disabled May 13, 2025 12:16

Head branch was pushed to by a user without write access

@DarkLight1337
Copy link
Member

Unblocking extended LM tests

@DarkLight1337
Copy link
Member

Need to install MTEB for the tests

@noooop
Copy link
Collaborator Author

noooop commented May 14, 2025

Need to install MTEB for the tests

Didn't you only test a few models before?

MTEB has not merged my PR. ┓( ´∀` )┏

@DarkLight1337
Copy link
Member

I mean the CI fails because of this

@noooop
Copy link
Collaborator Author

noooop commented May 14, 2025

What should I do? When testing only core_model before, we could skip test_models_mteb.

@DarkLight1337
Copy link
Member

You can add pytest.skip to skip these models for now

@vllm-bot vllm-bot merged commit 63ad622 into vllm-project:main May 14, 2025
8 of 13 checks passed
zzzyq pushed a commit to zzzyq/vllm that referenced this pull request May 24, 2025
@noooop noooop deleted the gte branch July 10, 2025 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New Model]: gte-multilingual-base

3 participants