You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the random seed is not provided to SamplingParams, TRT-LLM will generate a default and fixed random seed for sampling. That's why you observed the generation outputs unchanged across different runs. So, we need to provide different random seeds to get different sampling outputs. Thanks!
Please checkout this doc. The range is [0, 2^64-1].
While, we do receive this same question in multiple places. We tend to change the current behavior, namely using a unfixed default random seed. I will update this issue when we finish this changing.
The default behavior has been aligned to vLLM's. More specifically, for SamplingParams with TopP/TopK (and proper temperature) but no random seed provided, the runtime will generate a random one. So, it will result in different responses. There is a test to protect this behavior.
I'm closing this issue. Feel free to reopen or open another one if you encounter the same issue.
I'm running a docker container of tensorrt and when I try to pass a random seed, it returns {"object":"error","message":"[{'type': 'extra_forbidden', 'loc': ('body', 'random_seed'), 'msg': 'Extra inputs are not permitted', 'input': 8}]","type":"BadRequestError","param":null,"code":400}. Any idea what I'm doing wrong?
dear @syuoni and @Superjomn - we are trying to use Tensor-LLM for inference for the new Kimi-K2 model. Its crazy fast, but fails to generate different outputs, even though we are using absurd high top_k, temperature and explicitly set seed to different values each run.
weirdly enough the 2nd generation is different but then all follow up generations stay the same. reproducibly.
any idea what we could try? re-rolls with different gens are a must-have feature for us.
I'm was observing the same behavior in v0.21.0, and realized (after many hours...) that you need to add enable_trtllm_sampler: true to your --extra_llm_api_options yaml file to enable temperature and other sampling option.
Activity
syuoni commentedon Nov 7, 2024
Hi @ZhenboYan ,
If the random seed is not provided to SamplingParams, TRT-LLM will generate a default and fixed random seed for sampling. That's why you observed the generation outputs unchanged across different runs. So, we need to provide different random seeds to get different sampling outputs. Thanks!
MadDanWithABox commentedon Feb 17, 2025
@syuoni For future reference, what is the range of this seed? I want to be able to have the maximum amount of random as possible
syuoni commentedon Feb 17, 2025
Hi @MadDanWithABox ,
Please checkout this doc. The range is
[0, 2^64-1].While, we do receive this same question in multiple places. We tend to change the current behavior, namely using a unfixed default random seed. I will update this issue when we finish this changing.
syuoni commentedon Mar 15, 2025
Hi all,
The default behavior has been aligned to vLLM's. More specifically, for
SamplingParamswith TopP/TopK (and proper temperature) but no random seed provided, the runtime will generate a random one. So, it will result in different responses. There is a test to protect this behavior.I'm closing this issue. Feel free to reopen or open another one if you encounter the same issue.
Thanks for reporting the issue!
bindrad commentedon Jun 10, 2025
I'm running a docker container of tensorrt and when I try to pass a random seed, it returns
{"object":"error","message":"[{'type': 'extra_forbidden', 'loc': ('body', 'random_seed'), 'msg': 'Extra inputs are not permitted', 'input': 8}]","type":"BadRequestError","param":null,"code":400}. Any idea what I'm doing wrong?fstandhartinger commentedon Jul 27, 2025
dear @syuoni and @Superjomn - we are trying to use Tensor-LLM for inference for the new Kimi-K2 model. Its crazy fast, but fails to generate different outputs, even though we are using absurd high
top_k,temperatureand explicitly setseedto different values each run.weirdly enough the 2nd generation is different but then all follow up generations stay the same. reproducibly.
any idea what we could try? re-rolls with different gens are a must-have feature for us.
thx for your assistance, keep up the good work!
josephrocca commentedon Sep 8, 2025
I'm was observing the same behavior in
v0.21.0, and realized (after many hours...) that you need to addenable_trtllm_sampler: trueto your--extra_llm_api_optionsyaml file to enable temperature and other sampling option.