Skip to content

Comments

Set materialize_only_last_token_logits=False when log_probs = True#613

Open
athitten wants to merge 1 commit intomainfrom
athitten/logprobs_flag
Open

Set materialize_only_last_token_logits=False when log_probs = True#613
athitten wants to merge 1 commit intomainfrom
athitten/logprobs_flag

Conversation

@athitten
Copy link
Contributor

@athitten athitten commented Feb 20, 2026

MCore's DynamicInferenceEngine introduces materialize_only_last_token_logits in InferenceConfig with a default value of True to avoid computing logprobs for all tokens (prompt + completion) to save memory and optimize performance. By default in deployment, when the dynamic engine is built from the static engine it builds a DynamicInferenceContext with an InferenceConfig(...) that has the default value of True for materialize_only_last_token_logits.

This raises an error while evaluating the benchmarks that requires logprobs:

AssertionError: Prompt log probs cannot be calculated if only last token logits are materialized.
Set materialize_only_last_token_logits to False in DynamicInferenceContext
or skip_prompt_log_probs to True in SamplingParams.

As a fix this PR sets materialize_only_last_token_logits to False when logprobs = True which is the case for logrob benchmarks.

Signed-off-by: Abhishree <abhishreetm@gmail.com>
@copy-pr-bot
Copy link

copy-pr-bot bot commented Feb 20, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@athitten athitten changed the title Add materialize_only_last_token_logits=False for when log Add materialize_only_last_token_logits=False when log_probs = True Feb 20, 2026
@athitten athitten changed the title Add materialize_only_last_token_logits=False when log_probs = True Set materialize_only_last_token_logits=False when log_probs = True Feb 20, 2026
@athitten
Copy link
Contributor Author

/ok to test a887964

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant