Skip to content

Conversation

robertgshaw2-redhat
Copy link
Collaborator

@robertgshaw2-redhat robertgshaw2-redhat commented Jun 26, 2025

Essential Elements of an Effective PR Description Checklist

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Purpose

  • add new model
  • note: this is only the text branch. the multimodal branch will come later this week

Test Plan

vllm serve google/gemma-3n-E2B-it --disable-log-requests
MODEL=google/gemma-3n-E2B-it
PORT=8000
lm_eval --model local-completions --tasks gsm8k \
    --model_args model=$MODEL,base_url=http://127.0.0.1:$PORT/v1/completions,num_concurrent=200,max_retries=3,tokenized_requests=False \
    --limit 1000

Test Result

local-completions (model=google/gemma-3n-E2B-it,base_url=http://127.0.0.1:8000/v1/completions,num_concurrent=200,max_retries=3,tokenized_requests=False), gen_kwargs: (None), limit: 1000.0, num_fewshot: None, batch_size: 1
|Tasks|Version|     Filter     |n-shot|  Metric   |   |Value|   |Stderr|
|-----|------:|----------------|-----:|-----------|---|----:|---|-----:|
|gsm8k|      3|flexible-extract|     5|exact_match||0.610|±  |0.0154|
|     |       |strict-match    |     5|exact_match||0.593|±  |0.0155|

(Optional) Documentation Update

Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
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.

🚀

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @robertgshaw2-redhat, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive support for the Gemma3n model, a new large language model. It involves integrating its distinct architectural components, including a novel sparse activation function and specialized layer structures, and registering it within the existing model framework.

Highlights

  • New Model Integration: I've added the complete architecture for the Gemma3n model, enabling its use within the system. This includes its unique layer components and overall structure.
  • Custom Activation Function: I've introduced GeluAndMulSparse, a specialized sparse GELU activation function that is specifically designed for and utilized by the Gemma3n model.
  • Advanced Layer Structures: I've implemented unique components integral to the Gemma3n architecture, such as Gemma3nAltUp for 'Alternating Updates' and Gemma3nLaurelBlock for 'Learned Augmented Residual Layers'.
  • Model Registry Update: I've updated the model registry to include the new Gemma3nForConditionalGeneration model, making it discoverable and loadable by the system.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The code changes introduce a new model, Gemma3n, to the vLLM framework. The changes include adding a new activation function, GeluAndMulSparse, and the model implementation itself. There are a few suggestions to improve the code, including correcting a docstring, using f-strings for better readability, and adding a tolerance value when comparing floating-point numbers.

Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
Copy link
Member

@ywang96 ywang96 left a comment

Choose a reason for hiding this comment

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

Left a few comments so PTAL - we can also add the model to documentation but indicate that only text-input is supported for now.

@mgoin
Copy link
Member

mgoin commented Jun 26, 2025

@robertgshaw2-redhat robertgshaw2-redhat changed the title added model Gemma3n Jun 26, 2025
Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
@robertgshaw2-redhat
Copy link
Collaborator Author

It looks like models are public https://huggingface.co/collections/google/gemma-3n-685065323f5984ef315c93f4

Could we add it to the test registry? https://github.com/vllm-project/vllm/blob/04e1642e3251fc575d104c84782fafea348cfbaf/tests/models/registry.py

I would like to get this in now so we can have it in the nightly. Ill add a test tomorrow

@mergify mergify bot added the ci/build label Jun 26, 2025
Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
Copy link
Member

@ywang96 ywang96 left a comment

Choose a reason for hiding this comment

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

I would like to get this in now so we can have it in the nightly. Ill add a test tomorrow

I think that's fine since this PR is a model specific PR and should be low risk (assuming the transformers version bump doesn't break anything)

@ywang96 ywang96 added the ready ONLY add when PR is ready to merge/full CI is needed label Jun 26, 2025
@ywang96 ywang96 changed the title Gemma3n Gemma3n (Text-only) Jun 26, 2025
Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
@mergify mergify bot added the documentation Improvements or additions to documentation label Jun 26, 2025
@robertgshaw2-redhat robertgshaw2-redhat enabled auto-merge (squash) June 26, 2025 23:44
@mgoin
Copy link
Member

mgoin commented Jun 27, 2025

Basic models test is failing because there isn't a registered model. You can add one and put a skip arg in it https://buildkite.com/vllm/ci/builds/22772/steps/canvas?jid=0197aea1-2404-4b82-8219-729311822434#0197aea1-2404-4b82-8219-729311822434/214-1806

Signed-off-by: Roger Wang <hey@rogerw.me>
@ywang96 ywang96 requested a review from DarkLight1337 as a code owner June 27, 2025 01:03
@ywang96 ywang96 removed the request for review from DarkLight1337 June 27, 2025 01:04
Signed-off-by: Roger Wang <hey@rogerw.me>
Signed-off-by: Roger Wang <hey@rogerw.me>
Roger Wang added 4 commits June 26, 2025 20:38
Signed-off-by: Roger Wang <hey@rogerw.me>
Signed-off-by: Roger Wang <hey@rogerw.me>
Signed-off-by: Roger Wang <hey@rogerw.me>
Signed-off-by: Roger Wang <hey@rogerw.me>
@@ -7,7 +7,7 @@ requests >= 2.26.0
tqdm
blake3
py-cpuinfo
transformers >= 4.51.1
transformers >= 4.53.0
Copy link
Member

@DarkLight1337 DarkLight1337 Jun 27, 2025

Choose a reason for hiding this comment

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

Actually wait. We should not force update transformers yet, it will break Qwen2.5-Omni. cc @Isotr0py

Copy link
Member

Choose a reason for hiding this comment

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

Is that confirmed? If so we can user users to upgrade transformers manually.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

From the look of it, it seems that the blast radius is more than just on Qwen2.5-Omni. See vllm-project/vllm-ascend#1470, so I'll update this PR accordingly.

Copy link
Member

Choose a reason for hiding this comment

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

If so we can user users to upgrade transformers manually.

There is a big refactoring at config and processor in Transformers v4.53, we need to ask users to upgrade transformers manually temporarily before we add compatibility for it.

Roger Wang added 2 commits June 26, 2025 20:49
Signed-off-by: Roger Wang <hey@rogerw.me>
Signed-off-by: Roger Wang <hey@rogerw.me>
@ywang96 ywang96 disabled auto-merge June 27, 2025 05:51
@ywang96 ywang96 enabled auto-merge (squash) June 27, 2025 05:51
@ywang96 ywang96 merged commit d1c956d into vllm-project:main Jun 27, 2025
74 checks passed
@huytuong010101
Copy link

DO you have plan to support multimodal version as well?

@ywang96
Copy link
Member

ywang96 commented Jun 27, 2025

DO you have plan to support multimodal version as well?

Yea it's planned. Stay tuned!

@huytuong010101
Copy link

@ywang96 Awesome

xjpang pushed a commit to xjpang/vllm that referenced this pull request Jun 30, 2025
Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
Signed-off-by: Roger Wang <hey@rogerw.me>
Co-authored-by: Roger Wang <hey@rogerw.me>
wseaton pushed a commit to wseaton/vllm that referenced this pull request Jun 30, 2025
Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
Signed-off-by: Roger Wang <hey@rogerw.me>
Co-authored-by: Roger Wang <hey@rogerw.me>
Signed-off-by: Will Eaton <weaton@redhat.com>
wseaton pushed a commit to wseaton/vllm that referenced this pull request Jun 30, 2025
Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
Signed-off-by: Roger Wang <hey@rogerw.me>
Co-authored-by: Roger Wang <hey@rogerw.me>
wwl2755-google pushed a commit to wwl2755-google/vllm that referenced this pull request Jul 1, 2025
Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
Signed-off-by: Roger Wang <hey@rogerw.me>
Co-authored-by: Roger Wang <hey@rogerw.me>
@Larry-Gan
Copy link

Larry-Gan commented Jul 14, 2025

@ywang96 Is the multimodal version implemented yet? I don't see any PRs that may have implemented it. I was wondering if I could go data parallel with images.

avigny pushed a commit to avigny/vllm that referenced this pull request Jul 31, 2025
Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
Signed-off-by: Roger Wang <hey@rogerw.me>
Co-authored-by: Roger Wang <hey@rogerw.me>
Signed-off-by: avigny <47987522+avigny@users.noreply.github.com>
googlercolin pushed a commit to googlercolin/vllm that referenced this pull request Aug 29, 2025
Signed-off-by: rshaw@neuralmagic.com <robertgshaw2@gmail.com>
Signed-off-by: Roger Wang <hey@rogerw.me>
Co-authored-by: Roger Wang <hey@rogerw.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/build 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.

8 participants