Skip to content

Extend max_model_length to prevent context truncation #463

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eldarkurtic
Copy link

With the existing example command for evaluation, both max_model_length and max_new_tokens are set to the same value of 32768. This produces the following warning:

[ WARNING]: context_size + max_new_tokens=33238 which is greater than self.max_length=32768. Truncating context to 0 tokens. (vllm_model.py:276)

We need to increase the max_model_length to a larger value to prevent truncating the context. I ran some tests and the proposed 38768 seems to be large enough for all three tasks I've tested so far: AIME, MATH-500, and GPQA-Diamond.

Copy link
Member

@lewtun lewtun left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @eldarkurtic! Do you see much variation in the evaluation scores once this is included? I believe some of the Qwen models were trained with 32k context, so once we exceed this the model may start producing gibberish.

@eldarkurtic
Copy link
Author

I've never done a full eval to compare the two because I stopped using 32k as soon as I saw the warning that prompt has been truncated to 0 tokens

[ WARNING]: context_size + max_new_tokens=33238 which is greater than self.max_length=32768. Truncating context to 0 tokens. (vllm_model.py:276)

But definitely a good point for Qwen models. I assume this could be up to user to decide based on their chosen model for evals.

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.

2 participants