Skip to content

Conversation

@Seren-hao
Copy link

What does this PR do?

support qwen3vl on ASCEND NPU

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, megatron, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data, cfg, reward
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


ningmengliu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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 support for Qwen3-VL models on Ascend NPUs. The changes include updating the documentation to reflect this new support and adding new example and test scripts for Qwen3-VL-8B and Qwen3-VL-30B. While the changes are straightforward, the newly added shell scripts contain several critical syntax errors, such as missing line continuations and invalid characters in arguments, which will prevent them from running correctly. Additionally, the scripts rely on an undefined environment variable without proper checks. These issues need to be addressed to ensure the examples and tests are functional.

Comment on lines +42 to +46
actor_rollout_ref.rollout.max_num_batched_tokens=8192
actor_rollout_ref.rollout.enable_chunked_prefill=True \
actor_rollout_ref.actor.entropy_from_logits_with_chunking=True \
actor_rollout_ref.ref.entropy_from_logits_with_chunking=True \
+actor_rollout_ref.rollout.engine_kwargs.vllm.disable_mm_preprocessor_cache=True \
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

There are a couple of syntax errors in the arguments passed to python3 that will cause the script to fail:

  1. Line 42 is missing a trailing \ to continue the command on the next line. This will cause the shell to terminate the python command prematurely and attempt to execute the following lines as separate commands.
  2. Line 46 has a leading +, which is an invalid character for a command-line argument here and will likely cause a parsing error in the python script.
Suggested change
actor_rollout_ref.rollout.max_num_batched_tokens=8192
actor_rollout_ref.rollout.enable_chunked_prefill=True \
actor_rollout_ref.actor.entropy_from_logits_with_chunking=True \
actor_rollout_ref.ref.entropy_from_logits_with_chunking=True \
+actor_rollout_ref.rollout.engine_kwargs.vllm.disable_mm_preprocessor_cache=True \
actor_rollout_ref.rollout.max_num_batched_tokens=8192 \
actor_rollout_ref.rollout.enable_chunked_prefill=True \
actor_rollout_ref.actor.entropy_from_logits_with_chunking=True \
actor_rollout_ref.ref.entropy_from_logits_with_chunking=True \
actor_rollout_ref.rollout.engine_kwargs.vllm.disable_mm_preprocessor_cache=True \

actor_rollout_ref.rollout.tensor_model_parallel_size=8 \
actor_rollout_ref.rollout.name=$ENGINE \
actor_rollout_ref.rollout.ignore_eos=False \
+actor_rollout_ref.rollout.engine_kwargs.vllm.disable_mm_preprocessor_cache=True \
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

This line has a leading +, which is an invalid character for a command-line argument here and will likely cause a parsing error in the python script.

Suggested change
+actor_rollout_ref.rollout.engine_kwargs.vllm.disable_mm_preprocessor_cache=True \
actor_rollout_ref.rollout.engine_kwargs.vllm.disable_mm_preprocessor_cache=True \

Comment on lines +47 to +51
actor_rollout_ref.rollout.max_num_batched_tokens=8192
actor_rollout_ref.rollout.enable_chunked_prefill=True \
actor_rollout_ref.actor.entropy_from_logits_with_chunking=True \
actor_rollout_ref.ref.entropy_from_logits_with_chunking=True \
+actor_rollout_ref.rollout.engine_kwargs.vllm.disable_mm_preprocessor_cache=True \
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

There are a couple of syntax errors in the arguments passed to python3 that will cause the script to fail:

  1. Line 47 is missing a trailing \ to continue the command on the next line. This will cause the shell to terminate the python command prematurely and attempt to execute the following lines as separate commands.
  2. Line 51 has a leading +, which is an invalid character for a command-line argument here and will likely cause a parsing error in the python script.
Suggested change
actor_rollout_ref.rollout.max_num_batched_tokens=8192
actor_rollout_ref.rollout.enable_chunked_prefill=True \
actor_rollout_ref.actor.entropy_from_logits_with_chunking=True \
actor_rollout_ref.ref.entropy_from_logits_with_chunking=True \
+actor_rollout_ref.rollout.engine_kwargs.vllm.disable_mm_preprocessor_cache=True \
actor_rollout_ref.rollout.max_num_batched_tokens=8192 \
actor_rollout_ref.rollout.enable_chunked_prefill=True \
actor_rollout_ref.actor.entropy_from_logits_with_chunking=True \
actor_rollout_ref.ref.entropy_from_logits_with_chunking=True \
actor_rollout_ref.rollout.engine_kwargs.vllm.disable_mm_preprocessor_cache=True \

Comment on lines +10 to +11
data.train_files=$data_path/train.parquet \
data.val_files=$data_path/test.parquet \
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The $data_path variable is used here but not defined in the script. This will cause the script to fail if the variable is not set in the environment. It's good practice to add a check to ensure it's set and exit with an error if it's not. For example, you could add this at the top of the script:

if [ -z "$data_path" ]; then
  echo "Error: data_path environment variable is not set." >&2
  exit 1
fi

Comment on lines +11 to +12
data.train_files=$data_path/train.parquet \
data.val_files=$data_path/test.parquet \
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The $data_path variable is used here but not defined in the script. This will cause the script to fail if the variable is not set in the environment. It's good practice to add a check to ensure it's set and exit with an error if it's not. For example, you could add this at the top of the script:

if [ -z "$data_path" ]; then
  echo "Error: data_path environment variable is not set." >&2
  exit 1
fi

Comment on lines +15 to +16
data.train_files=$data_path/train.parquet \
data.val_files=$data_path/test.parquet \
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The $data_path variable is used here but not defined in the script. This will cause the script to fail if the variable is not set in the environment. It's good practice to add a check to ensure it's set and exit with an error if it's not. For example, you could add this at the top of the script:

if [ -z "$data_path" ]; then
  echo "Error: data_path environment variable is not set." >&2
  exit 1
fi

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.

3 participants