Skip to content

Conversation

@haic0
Copy link

@haic0 haic0 commented Oct 23, 2025

Add Qwen3-Next support for AMD GPU.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @haic0, 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 new documentation that outlines the process for deploying and benchmarking the Qwen3-Next-80B-A3B-Instruct large language model on AMD MI300X GPUs. The guide provides clear, step-by-step instructions covering Docker setup, Hugging Face authentication, vLLM model serving, and performance evaluation, aiming to facilitate the use of this model on AMD hardware.

Highlights

  • New Documentation for AMD GPU Support: A new markdown file, Qwen/AMD/Qwen3-Next-AMD.md, has been added to provide comprehensive instructions.
  • Qwen3-Next on AMD MI300X: The new guide details the step-by-step process for installing and running Qwen3-Next-80B-A3B-Instruct models specifically on AMD MI300X GPUs.
  • vLLM Integration: Instructions include leveraging the rocm/vllm-dev:nightly Docker image for model serving and benchmarking.
  • Benchmarking Guide: The document provides specific commands for executing a benchmark script to evaluate model performance on the target hardware.
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 a new guide for running Qwen3-Next on AMD GPUs. The guide is a good starting point, but I've identified several areas for improvement. My feedback includes a critical security concern regarding Docker volume mounts, as well as several suggestions to improve the document's structure, clarity, and formatting for consistency with other guides in the repository. These changes will make the guide more secure, readable, and easier for users to follow.

```
Launch the Rocm-vllm docker:
```shell
docker run -d -it --ipc=host --network=host --privileged --cap-add=CAP_SYS_ADMIN --device=/dev/kfd --device=/dev/dri --device=/dev/mem --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v /:/work -e SHELL=/bin/bash --name Qwen3-next rocm/vllm-dev:nightly
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Mounting the host's root directory (/) into the container with -v /:/work is a significant security risk. It grants the container unrestricted access to the entire host filesystem. It is strongly recommended to mount a specific working directory instead, for example, the current directory.

Suggested change
docker run -d -it --ipc=host --network=host --privileged --cap-add=CAP_SYS_ADMIN --device=/dev/kfd --device=/dev/dri --device=/dev/mem --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v /:/work -e SHELL=/bin/bash --name Qwen3-next rocm/vllm-dev:nightly
docker run -d -it --ipc=host --network=host --privileged --cap-add=CAP_SYS_ADMIN --device=/dev/kfd --device=/dev/dri --device=/dev/mem --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $(pwd):/work -e SHELL=/bin/bash --name Qwen3-next rocm/vllm-dev:nightly

@@ -0,0 +1,30 @@
#### Step by Step Guide
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better document structure and consistency with other guides in the repository, it's recommended to use a level 1 heading for the main title of the document.

Suggested change
#### Step by Step Guide
# Qwen3-Next on AMD GPU

@@ -0,0 +1,30 @@
#### Step by Step Guide
Please follow the steps here to install and run Qwen3-Next-80B-A3B-Instruct models on AMD MI300X GPU.
#### Step 1
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better structure, steps should be level 2 headings. A descriptive title also helps clarity.

Suggested change
#### Step 1
## Step 1: Prepare Docker Environment

```shell
docker pull rocm/vllm-dev:nightly
```
Launch the Rocm-vllm docker:
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There's a typo in "Rocm-vllm". It should be "ROCm vLLM" for correctness and clarity.

Suggested change
Launch the Rocm-vllm docker:
Launch the ROCm vLLM docker:

```shell
docker run -d -it --ipc=host --network=host --privileged --cap-add=CAP_SYS_ADMIN --device=/dev/kfd --device=/dev/dri --device=/dev/mem --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v /:/work -e SHELL=/bin/bash --name Qwen3-next rocm/vllm-dev:nightly
```
#### Step 2
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistent heading structure, this should be a level 2 heading with a descriptive title.

Suggested change
#### Step 2
## Step 2: Log in to Hugging Face

Comment on lines +13 to +16
Huggingface login
```shell
huggingface-cli login
```
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There is unnecessary leading and trailing whitespace in this section which should be removed for cleaner formatting.

Suggested change
Huggingface login
```shell
huggingface-cli login
```
Huggingface login
```shell
huggingface-cli login

Comment on lines +17 to +18
#### Step 3
##### FP8
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better structure and clarity, this step's heading should be a level 2 heading, and the "FP8" detail can be incorporated into it. This avoids a deep and less readable heading level.

Suggested change
#### Step 3
##### FP8
## Step 3: Start the vLLM server (FP8)

Run the vllm online serving
Sample Command
```shell
VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 vllm serve Qwen/Qwen3-Next-80B-A3B-Instruct --tensor-parallel-size 4 --max-model-len 32768 --no-enable-prefix-caching
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There is an extra space in the command that should be removed for correctness.

Suggested change
VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 vllm serve Qwen/Qwen3-Next-80B-A3B-Instruct --tensor-parallel-size 4 --max-model-len 32768 --no-enable-prefix-caching
VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 vllm serve Qwen/Qwen3-Next-80B-A3B-Instruct --tensor-parallel-size 4 --max-model-len 32768 --no-enable-prefix-caching

```shell
VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 vllm serve Qwen/Qwen3-Next-80B-A3B-Instruct --tensor-parallel-size 4 --max-model-len 32768 --no-enable-prefix-caching
```
#### Step 4
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistent heading structure, this should be a level 2 heading. The trailing space should also be removed.

Suggested change
#### Step 4
## Step 4: Run Benchmark

Comment on lines +26 to +30
Open a new terminal, enter into the running docker and run the following benchmark script.
```shell
docker exec -it Qwen3-next /bin/bash
python3 /vllm-workspace/benchmarks/benchmark_serving.py --model Qwen/Qwen3-Next-80B-A3B-Instruct --dataset-name random --ignore-eos --num-prompts 500 --max-concurrency 128 --random-input-len 3200 --random-output-len 800 --percentile-metrics ttft,tpot,itl,e2el
```
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The instructions for running the benchmark can be simplified. Instead of opening an interactive shell and then running the script, you can execute the script directly with docker exec. This makes it a single, non-interactive command and is less prone to user error. This also fixes extra whitespace in the command.

Suggested change
Open a new terminal, enter into the running docker and run the following benchmark script.
```shell
docker exec -it Qwen3-next /bin/bash
python3 /vllm-workspace/benchmarks/benchmark_serving.py --model Qwen/Qwen3-Next-80B-A3B-Instruct --dataset-name random --ignore-eos --num-prompts 500 --max-concurrency 128 --random-input-len 3200 --random-output-len 800 --percentile-metrics ttft,tpot,itl,e2el
```
Open a new terminal and run the following command to execute the benchmark script inside the container.
```shell
docker exec -it Qwen3-next python3 /vllm-workspace/benchmarks/benchmark_serving.py --model Qwen/Qwen3-Next-80B-A3B-Instruct --dataset-name random --ignore-eos --num-prompts 500 --max-concurrency 128 --random-input-len 3200 --random-output-len 800 --percentile-metrics ttft,tpot,itl,e2el

@simon-mo
Copy link
Contributor

Please add it to existing Qwen3-Next document

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