Skip to content

Add NPU RLVR example#798

Merged
garrett4wade merged 2 commits intoinclusionAI:mainfrom
HwVanICI:ascend-example
Jan 7, 2026
Merged

Add NPU RLVR example#798
garrett4wade merged 2 commits intoinclusionAI:mainfrom
HwVanICI:ascend-example

Conversation

@HwVanICI
Copy link
Collaborator

@HwVanICI HwVanICI commented Jan 6, 2026

Description

This PR is only relevant to Ascend NPUs. It removes a redundant operation and cherry-picks the NPU example YAML file into the main branch so it can evolve alongside upstream changes to the expected YAML format.

The core differences between gsm8k_grpo_npu.yaml and gsm8k_grpo.yaml are: (1) the rollout engine is set to vllm by default, and (2) NPU-specific envvars are included to allow the configuration to be used out of the box.

Related Issue

#747

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)

Breaking Change Details (if applicable):

Additional Context


Need help? Check the Contributing Guide or ask in
GitHub Discussions!

@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 significantly enhances support for Ascend NPUs by refining the NPU platform initialization and providing a comprehensive, ready-to-use example configuration. The new example streamlines the setup for Generative Reinforcement Learning with Policy Optimization (GRPO) on NPUs, pre-configuring it with vllm and all necessary NPU-specific environment variables for immediate deployment.

Highlights

  • NPU Redundancy Removal: Eliminated a superfluous import and call to torch_npu.contrib.transfer_to_npu.is_available() in the NPU platform initialization logic, streamlining the code.
  • New NPU Example Configuration: Introduced gsm8k_grpo_npu.yaml, a new example configuration file specifically tailored for Ascend NPU environments.
  • Default Rollout Engine for NPU: The new NPU example configuration sets vllm as the default rollout engine, optimizing performance for NPU setups.
  • NPU Environment Variables: The new NPU example includes essential NPU-specific environment variables, enabling out-of-the-box usage without manual configuration.

🧠 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.

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 new example configuration for running RLVR on Ascend NPUs and removes a redundant operation during platform initialization. The changes look good. The removal of the unused import in areal/platforms/__init__.py is a nice cleanup. The new gsm8k_grpo_npu.yaml file is well-structured for NPU-specific runs. I've added a few suggestions to improve the configuration file's maintainability and to clarify some performance-related settings.

@HwVanICI
Copy link
Collaborator Author

HwVanICI commented Jan 7, 2026

Hi @garrett4wade, it would be great if we can have this YAML merged to the main branch to keep the NPU example consistent with the rest in case there is a breaking change like in #789. Thanks!

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

@garrett4wade garrett4wade merged commit 5143491 into inclusionAI:main Jan 7, 2026
1 check passed
@HwVanICI HwVanICI deleted the ascend-example branch January 7, 2026 17:24
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