Skip to content

VLM Training on NPU#746

Merged
garrett4wade merged 7 commits intoinclusionAI:mainfrom
HwVanICI:vlm_npu
Dec 23, 2025
Merged

VLM Training on NPU#746
garrett4wade merged 7 commits intoinclusionAI:mainfrom
HwVanICI:vlm_npu

Conversation

@HwVanICI
Copy link
Collaborator

@HwVanICI HwVanICI commented Dec 18, 2025

Description

AReaL currently provides VLM training examples only for GPU devices. There is no official documentation or example demonstrating how to train VLMs on NPU (e.g., Ascend) using AReaL and vllm-ascend. This makes NPU usage harder to adopt, debug, and reproduce.

Related Issue

Fixes #(issue)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not
    work as expected)
  • Documentation update
  • Code refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Checklist

  • I have read the Contributing Guide
  • I have run formatting tools (pre-commit or manual)
  • I have run relevant unit tests and they pass
  • I have added tests for new functionality
  • I have updated documentation if needed
  • My branch is up to date with main
  • This PR introduces breaking changes (if yes, fill out details below)
  • If this PR changes documentation, I have built and previewed it locally with
    jb build docs
  • No critical issues raised by AI reviewers (/gemini review)

Proposed Solution

Add a new example directory:

examples/vllm_npu/

This folder will provide:

  • End-to-end VLM training examples using AReaL + vLLM-ascend
  • NPU-specific configuration notes and known limitations
  • Sample logs or results to validate correctness

Results:

We trained Qwen2.5-VL-3B for 70 epochs on Geometry3K and evaluated the checkpoints using VLMEvalKit on out of distribution tasks such as MathVision, MathVista, and LogicVista. The training was performed on both NPU and GPU and results are as follows:

Method LogicVista MathVision_mini MathVista_mini Avg.
Base Model 31.0 18.3 52.3 33.8
GRPO-GPU 35.4 20.9 55.9 37.4
GRPO-NPU 35.3 20.5 54.7 36.8

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @HwVanICI, 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 training Vision-Language Models (VLMs) on Neural Processing Units (NPUs). It addresses the current gap in official documentation and examples for NPU-based VLM training within the AReaL framework, making it significantly easier for users to implement, debug, and reproduce VLM training on NPU devices. The changes include a new example directory with scripts, configuration, and detailed documentation, along with benchmark results showcasing NPU performance.

Highlights

  • NPU Training Example: A new directory examples/vlm_npu/ has been added, providing an end-to-end VLM training example specifically for NPU devices using AReaL and vLLM-ascend.
  • Configuration and Documentation: The example includes NPU-specific configuration notes, known limitations, and sample logs to validate correctness, improving adoption and reproducibility for NPU-based VLM training.
  • Performance Benchmarking: The pull request presents training results for the Qwen2.5-VL-3B model on the Geometry3K dataset, comparing performance between NPU and GPU across various VLMEvalKit benchmarks (LogicVista, MathVision, MathVista).

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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.

@HwVanICI HwVanICI changed the title VLM training example on npu VLM Training on NPU Dec 18, 2025
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

This pull request introduces a valuable example for training Vision-Language Models (VLMs) on NPUs, which is a great addition to the repository. The implementation is solid, but I've identified a few areas for improvement to enhance code quality, maintainability, and correctness. My review includes suggestions for fixing a critical typo in a shell script, improving performance and readability in the Python script by addressing a magic number and pre-compiling a regex, and correcting minor formatting issues and typos in the documentation. Overall, these changes will make the new example more robust and easier to understand.

HwVanICI and others added 5 commits December 18, 2025 14:40
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Collaborator

@garrett4wade garrett4wade left a comment

Choose a reason for hiding this comment

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

LGTM except for a minor issue.

@garrett4wade garrett4wade merged commit 524d1d9 into inclusionAI:main Dec 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants