-
Notifications
You must be signed in to change notification settings - Fork 146
add support for draft model of eagle3 #1468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xufang-lisa
wants to merge
19
commits into
huggingface:main
Choose a base branch
from
xufang-lisa:xufang/add_eagle3_draft_model_conversion
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0181cbd
add support for eagle3 draft model
xufang-lisa 39e8ada
rename target_hidden_state_input to hidden_states
xufang-lisa 8b6987e
add eagle3 parameter to support eagles draft model conversion
xufang-lisa f91076e
restore config.json for draft model
xufang-lisa 9b17e4d
remove redundant operation
xufang-lisa a651914
reuse some implementations of llama in transformers
xufang-lisa bff9576
add some checks
xufang-lisa dffcb40
extract_d2t supports safetensor
xufang-lisa 5b44a72
fix file renaming failure
xufang-lisa febc064
download eagle3 model
xufang-lisa ecf0b96
download draft model to temp directory
xufang-lisa 51ef1fd
reuse LlamaConfig
xufang-lisa 781023f
adapt to higher version transformers
xufang-lisa b744788
pass in a new config file instead of modifying original one
xufang-lisa 9034c24
use absolute path
xufang-lisa 7eb3a4a
support Qwen3-1.7B_eagle3
xufang-lisa bce2108
support more rope_type
xufang-lisa 2321da9
add testcase for test_exporters_cli
xufang-lisa affe636
support eagle3 conversion by api
xufang-lisa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what kind of model can we convert with such addition? I am asking because original model has a different model type
llama3
.Can you convert only local copy with modified model type? I am not sure that it is capable to convert original eagle3 llama model.
Also, implemented solution looks not scalable for other eagle3 models such as https://huggingface.co/nvidia/gpt-oss-120b-Eagle3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have verified conversion and GENAI pipeline with yuhuili/EAGLE3-LLaMA3.1-Instruct-8B and Tengyunw/qwen3_8b_eagle3 locally, and AngelSlim/Qwen3-1.7B_eagle3 will be added to GENAI repo test openvinotoolkit/openvino.genai#2740. Checked the list on EAGLE3 github repo, most of them are llama type, they can be converted in theory or with limit update, can we merge this PR firstly and leave the verification per OpenVINO base model support progress and customer requirements?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we use original model type? For this, it relies on the different model type that seems to be modified manually by you. That is not how it should work. These changes should allow to convert the original model. where does
llamaeagle3
model type come from?Does it mean that user should re-create all eagle3 model and modify its model type, etc.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rkazants Discussed with Fang, WIP to avoid config.json modification by passing model_type="llamaeagle3" to AutoConfig.from_pretrained
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we use original model type? llama modeling in transformers can't support eagle3 draft model, the modeling for eagle3 draft model is from https://github.com/SafeAILab/EAGLE/blob/main/eagle/model/cnets.py. Current PR should support the conversion of eagle3 draft model with model_type: "llama" in config.json