Reference input randomSeeds by idx rather than batchSlot #1742
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.
Steps to reproduce:
The output of the steps I get in my build of phi-4-mini-4k is
The same bug occurs in all models. you will get different tokens output, but the point is that the incorrect responses in 2. and 3. will match the randomSeed 0 from step 4.
A single request goes through
curandInitialize
which is correct, rather thancurandBatchInitialize
, so we can trust the output of performing a single request at once.Note also that when performing a batch, both curl and trtllm are greedy and start processing it not as a batch, before processing the other 3. This is why you see one result in the batch with the correct answer before the batch produces the incorrect answer.
You will see that in steps 2 and 3, you see one different output which respects the randomSeed, followed by 3 outputs which matches the randomSeed 0 one.
Debugging steps:
Thus it appears to be incorrect to read from randomSeeds[batchSlots[0]] and correct to read from randomSeeds[0] instead.