Skip to content

support qwen3 coder draft model, add opc dataset process#73

Merged
sleepcoo merged 6 commits intomainfrom
support-qwen3-coder
Aug 1, 2025
Merged

support qwen3 coder draft model, add opc dataset process#73
sleepcoo merged 6 commits intomainfrom
support-qwen3-coder

Conversation

@yizhang2077
Copy link
Collaborator

@yizhang2077 yizhang2077 commented Jul 28, 2025

  1. support qwen3 coder offline training
  2. format & make benchmark max output token length to 2048 (default is 128)
# launch
python3 -m sglang.launch_server --model Qwen/Qwen3-Coder-480B-A35B-Instruct --speculative-algorithm EAGLE3 --speculative-draft-model-path <draft_path> --speculative-num-steps 4 --speculative-eagle-topk 1 --speculative-num-draft-tokens 5 --mem-fraction-static 0.85 --dtype bfloat16 --tp 8 --tool-call-parser qwen3_coder

# test
python3 benchmarks/run_humaneval.py --parallel 1

#result 
## default
Latency: 912.153 s
Output throughput: 101.234 token/s                                                                                                           
Accept length: 1.000

## eagle3
Latency: 440.144 s                                                                                                                           
Output throughput: 209.797 token/s 
Accept length: 3.278 

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.

Summary of Changes

Hello @yizhang2077, 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 support for the Qwen3 Coder draft model, enabling its offline training capabilities, particularly with the EAGLE3 speculative decoding algorithm. It also standardizes benchmark configurations by increasing the maximum output token length for several evaluation scripts and integrates a new dataset processing pipeline for the OPC dataset, facilitating training data preparation.

Highlights

  • Qwen3 Coder Draft Model Support: Added necessary configurations and an example script to support offline training of the Qwen3 Coder model with the EAGLE3 speculative decoding algorithm.
  • Benchmark Consistency: Standardized the max_new_tokens parameter to 2048 across run_gsm8k.py, run_humaneval.py, and run_math500.py benchmarks, ensuring longer and more consistent output generation during evaluations.
  • OPC Dataset Integration: Introduced new functionality in prepare_data.py to process the OpenCoder-LLM/opc-sft-stage1 dataset, making it available for training purposes.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 or fill out our survey to provide feedback.

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 support for the Qwen3 Coder draft model and integrates the opc dataset for offline training. The changes also standardize the maximum output token length in several benchmark scripts. My review includes suggestions for scripts/prepare_data.py to improve code style and update an error message for better maintainability and correctness.

return ds


import hashlib
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

According to PEP 8, imports should be placed at the top of the file, after any module comments and docstrings, and before module globals and constants. Placing import hashlib here is unconventional. Please move this import to the top of the file with the other import statements.

proc_fn = process_opc_sft_stage1
else:
raise ValueError(
f"This script only supports ultrachat_200k and sharegpt datasets for demo purpose, if you wish to use other datasets, please modify this script."
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This error message is now outdated as the script supports the opc dataset. Please update the message to include opc in the list of supported datasets to avoid confusion.

raise ValueError(
            f"This script only supports ultrachat, sharegpt, and opc datasets for demo purpose, if you wish to use other datasets, please modify this script."
        )

@sleepcoo
Copy link
Collaborator

great job!!!

@yizhang2077 yizhang2077 force-pushed the support-qwen3-coder branch from f0f3342 to 03550c4 Compare July 28, 2025 07:42
@sleepcoo sleepcoo requested a review from zyksir July 28, 2025 07:52
@FlamingoPg FlamingoPg mentioned this pull request Jul 28, 2025
22 tasks
@sleepcoo sleepcoo merged commit 224e0d8 into main Aug 1, 2025
1 check passed
@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@sleepcoo sleepcoo deleted the support-qwen3-coder branch August 1, 2025 05:39
qibaoyuan pushed a commit to qibaoyuan/SpecForge that referenced this pull request Aug 18, 2025
)

* support qwen3 coder draft model, add opc dataset process

* rename config

---------

Co-authored-by: lukec <118525388+sleepcoo@users.noreply.github.com>
@icewool
Copy link

icewool commented Aug 30, 2025

能否分享下你的qwen3-Coder草稿模型

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