[Model] add rope_scaling support for qwen2#4930
Merged
simon-mo merged 1 commit intovllm-project:mainfrom May 21, 2024
Merged
Conversation
simon-mo
approved these changes
May 21, 2024
robertgshaw2-redhat
pushed a commit
to neuralmagic/nm-vllm
that referenced
this pull request
Jun 8, 2024
joerunde
pushed a commit
to joerunde/vllm
that referenced
this pull request
Jun 17, 2024
robertgshaw2-redhat
pushed a commit
to neuralmagic/nm-vllm
that referenced
this pull request
Jul 14, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We are the Qwen team and would like to add the
rope_scalingsupport for qwen2. This would enableyarnto extend the context length.FIX #4824
Test
https://huggingface.co/Qwen/Qwen1.5-7B-Chatand use the followingconfig.json:{ "architectures": [ "Qwen2ForCausalLM" ], "attention_dropout": 0.0, "bos_token_id": 151643, "eos_token_id": 151645, "hidden_act": "silu", "hidden_size": 4096, "initializer_range": 0.02, "intermediate_size": 11008, "max_position_embeddings": 32768, "max_window_layers": 28, "model_type": "qwen2", "num_attention_heads": 32, "num_hidden_layers": 32, "num_key_value_heads": 32, "rms_norm_eps": 1e-06, "rope_theta": 1000000.0, "sliding_window": 131072, "tie_word_embeddings": false, "torch_dtype": "bfloat16", "transformers_version": "4.37.0", "use_cache": true, "use_sliding_window": false, "vocab_size": 151936, "rope_scaling": { "factor": 4.0, "original_max_position_embeddings": 32768, "type": "yarn" } }The output is:
If we do not use the
yarnmethod, the output will be an empty string.