-
Notifications
You must be signed in to change notification settings - Fork 91
Added mistral model support #208
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
ValeGian
wants to merge
24
commits into
sgl-project:main
Choose a base branch
from
ValeGian:mistral
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 all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
f60f458
Add mistral target model
ValeGian 5b83e92
Add mistral to AutoDistributedTargetModel _model_mapping
ValeGian 14582ab
Register mistral templates
ValeGian 37bf89e
Add target model unit test
ValeGian 1678ae5
Add head_dim to test MistralConfig
ValeGian 7d6de07
Remove mistral v0.1 and v0.3 templates, add mistral small 24B template
ValeGian 898e471
Add mistral-small-24B eagle3 config
ValeGian 6b4ac96
Fix wrong chat_template.end_of_turn_token None check
ValeGian 1eb91d7
Test mistral-small-24B preprocessing
ValeGian 8922788
Restore Qwen3-8B preprocessing test
ValeGian 037980f
Add train script for mistral-Small-24B
ValeGian 4d1aeb9
Merge branch 'main' into mistral
ValeGian 877247b
Lint fix
ValeGian a059679
Fix misleading return type
ValeGian 06cdfeb
Fix code format
ValeGian fb3cd1d
Merge branch 'main' into mistral
ZhengHSI ab36686
Fix preprocessing
ValeGian 5ca235e
Merge branch 'main' into mistral
ValeGian e8a43a2
Fix linting
ValeGian 26022f1
Increase TP to 2 to fit on H100 with 96GB
ValeGian 0744426
Merge branch 'main' into mistral
ZhengHSI 33c4bd7
Set default NUM_GPUS to 2
ValeGian 5d1fd1b
Merge branch 'main' into mistral
ZhengHSI ebf4e6b
Merge branch 'main' into mistral
ZhengHSI 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"architectures": [ | ||
"LlamaForCausalLMEagle3" | ||
], | ||
"attention_dropout": 0.0, | ||
"bos_token_id": 1, | ||
"eos_token_id": 2, | ||
"head_dim": 128, | ||
"hidden_act": "silu", | ||
"hidden_size": 5120, | ||
"initializer_range": 0.02, | ||
"intermediate_size": 32768, | ||
"max_position_embeddings": 32768, | ||
"model_type": "llama", | ||
"num_attention_heads": 32, | ||
"num_hidden_layers": 1, | ||
"num_key_value_heads": 8, | ||
"rms_norm_eps": 1e-05, | ||
"rope_theta": 100000000.0, | ||
"sliding_window": null, | ||
"tie_word_embeddings": false, | ||
"torch_dtype": "bfloat16", | ||
"transformers_version": "4.47.0", | ||
"use_cache": true, | ||
"vocab_size": 131072, | ||
"draft_vocab_size": 32000 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
ROOT_DIR=$(dirname $SCRIPT_DIR) | ||
export TORCHINDUCTOR_CACHE_DIR=$ROOT_DIR/cache/compiled_kernels | ||
|
||
# train eagle3 for mistral-Small-24B | ||
NUM_GPUS=${1:-2} | ||
|
||
torchrun \ | ||
--standalone \ | ||
--nproc_per_node $NUM_GPUS \ | ||
$ROOT_DIR/scripts/train_eagle3_online.py \ | ||
--target-model-path mistralai/Mistral-Small-24B-Instruct-2501 \ | ||
--draft-model-config $ROOT_DIR/configs/mistral-small-24B-eagle3.json \ | ||
--train-data-path $ROOT_DIR/cache/dataset/sharegpt.jsonl \ | ||
--output-dir $ROOT_DIR/outputs/mistral-Small-24B-eagle3 \ | ||
--num-epochs 2 \ | ||
--batch-size 1 \ | ||
--tp 2 \ | ||
--learning-rate 1e-4 \ | ||
--max-length 2048 \ | ||
--chat-template mistral-small-24B \ | ||
--cache-dir $ROOT_DIR/cache \ | ||
--attention-backend flex_attention |
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.
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.
Uh oh!
There was an error while loading. Please reload this page.