Skip to content

[AMD] [DO NOT MERGE] [GLM-5 Day 0] Add GLM-5 nightly test#18911

Open
michaelzhang-ai wants to merge 13 commits intosgl-project:mainfrom
michaelzhang-ai:glm5-nightly-test-mi325
Open

[AMD] [DO NOT MERGE] [GLM-5 Day 0] Add GLM-5 nightly test#18911
michaelzhang-ai wants to merge 13 commits intosgl-project:mainfrom
michaelzhang-ai:glm5-nightly-test-mi325

Conversation

@michaelzhang-ai
Copy link
Collaborator

@michaelzhang-ai michaelzhang-ai commented Feb 17, 2026

Motivation

Add nightly CI accuracy tests for GLM-5 on AMD MI325/MI300X and MI35x runners.

GLM-5 is a 744B parameter (40B active) MoE model that uses DeepSeek Sparse Attention (DSA/NSA), sharing the same architecture family as DeepSeek-V3.2.

Nightly 720 pass: https://github.com/sgl-project/sglang/actions/runs/22167228133
Nightly pass: https://github.com/sgl-project/sglang/actions/runs/22167228136

Please help review. Thanks! @HaiShaw @bingxche @yctseng0211

Modifications

New test files

  • test/registered/amd/accuracy/mi30x/test_glm5_eval_amd.py — GSM8K few-shot completion benchmark for MI325/MI300X
  • test/registered/amd/accuracy/mi35x/test_glm5_eval_mi35x.py — GSM8K few-shot completion benchmark for MI35x

Workflow updates

  • nightly-test-amd.yml — Added nightly-8-gpu-glm5 (MI30x) and nightly-8-gpu-mi35x-glm5 (MI35x) jobs
  • nightly-test-amd-rocm720.yml — Added nightly-8-gpu-glm5-rocm720 (MI30x) and nightly-8-gpu-mi35x-glm5-rocm720 (MI35x) jobs

Configuration

  • Model: zai-org/GLM-5 (TP=8)
  • NSA attention backend: --nsa-prefill-backend tilelang --nsa-decode-backend tilelang
  • --chunked-prefill-size 131072, --mem-fraction-static 0.80
  • --watchdog-timeout 1200 (20 min for weight loading)
  • Accuracy threshold: 0.93 (based on reported ~95.45% GSM8K accuracy)
  • Test template follows existing DeepSeek-V3.2 pattern

Accuracy Tests

GLM-5 Models (MI325)

Model Variant TP Accuracy Threshold Status
zai-org/GLM-5 nsa 8 0.965 0.93 ✅ PASS

GLM-5 Models (MI35x)

Model Variant TP Accuracy Threshold Status
zai-org/GLM-5 nsa 8 0.970 0.93 ✅ PASS

Benchmarking and Profiling

Checklist

Review Process

  1. Ping Merge Oncalls to start the PR flow. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • /tag-run-ci-label, /rerun-failed-ci, /tag-and-rerun-ci
  4. After green CI and required approvals, ask Merge Oncalls to merge.

…ROCm 7.2; refactor forward_hip method in RotaryEmbedding class to accept *args/**kwargs for better subclass compatibility.
- Introduced new jobs for 8-GPU GLM-5 accuracy tests in both AMD and MI35x workflows.
- Updated workflow triggers to include pull requests for the main branch.
- Added new test scripts for GLM-5 evaluation on MI325 and MI35x platforms.
- Enhanced job definitions to install necessary dependencies and run accuracy benchmarks.

This update improves CI coverage for GLM-5 models, ensuring robust testing across different hardware configurations.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @michaelzhang-ai, 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 AMD GPU support by introducing dedicated nightly accuracy tests for the GLM-5 large language model across different AMD MI series GPUs. It ensures that the model's performance on these platforms is consistently monitored and validated, and addresses a compatibility issue in the rotary embedding layer to facilitate proper execution on AMD hardware.

Highlights

  • New Nightly Accuracy Tests: Added nightly CI accuracy tests for the GLM-5 model on AMD MI325/MI300X and MI35x GPU runners to ensure model performance and stability.
  • AMD GPU Compatibility for Rotary Embedding: Implemented a forward_hip method in the RotaryEmbedding layer to provide a native PyTorch implementation for AMD GPUs, bypassing CUDA-specific JIT kernels that cause issues on ROCm platforms.
  • GLM-5 Model Configuration: Configured GLM-5 (744B parameter MoE model) with specific parameters for testing, including NSA attention backend (tilelang), chunked prefill size, memory fraction, and a watchdog timeout for weight loading.
  • GSM8K Benchmark Integration: Integrated the GSM8K few-shot completion benchmark into the new test files to evaluate the accuracy of the GLM-5 model on AMD hardware.

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

Changelog
  • python/sglang/srt/layers/rotary_embedding.py
    • Added a forward_hip method to RotaryEmbedding to provide a native PyTorch implementation for AMD GPUs, bypassing JIT kernels that rely on nvidia-smi.
  • test/registered/amd/accuracy/mi30x/test_glm5_eval_amd.py
    • Created a new test file to evaluate GLM-5 model accuracy on AMD MI325/MI300X GPUs using the GSM8K few-shot completion benchmark.
  • test/registered/amd/accuracy/mi35x/test_glm5_eval_mi35x.py
    • Created a new test file to evaluate GLM-5 model accuracy on AMD MI35x GPUs using the GSM8K few-shot completion benchmark, including specific Hugging Face cache configurations.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/nightly-test-amd-rocm720.yml
    • .github/workflows/nightly-test-amd.yml
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
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 adds nightly CI tests for GLM-5 on AMD GPUs. The changes include a necessary modification to rotary_embedding.py to support AMD GPUs and two new test files for different AMD hardware. The new test files contain a significant amount of duplicated code. To improve maintainability, I suggest refactoring the common logic into a shared utility module or a base test class in a follow-up PR. I've also suggested a small improvement to the ModelConfig dataclass in the new test files to use a more idiomatic approach for mutable default values.

@michaelzhang-ai michaelzhang-ai changed the title [AMD] Add GLM-5 nightly test [AMD] [DO NOT MERGE] Add GLM-5 nightly test Feb 19, 2026
@michaelzhang-ai michaelzhang-ai marked this pull request as ready for review February 19, 2026 03:39
@michaelzhang-ai michaelzhang-ai changed the title [AMD] [DO NOT MERGE] Add GLM-5 nightly test [AMD] [DO NOT MERGE] [GLM-5 Day 0] Add GLM-5 nightly test Feb 19, 2026
@michaelzhang-ai
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments