TensorRT-LLMs/cpp/include/tensorrt_llm/runtime
Robin Kobus d7386d14a8
refactor: Simplify disableLookahead and improve numDecodingEngineTokens handling (#3103)
* refactor: Simplifiy disableLookahead method

Signed-off-by: Robin Kobus <19427718+Funatiq@users.noreply.github.com>

* Update DecoderBuffers comments

Signed-off-by: Robin Kobus <19427718+Funatiq@users.noreply.github.com>

* refactor: Move numDecodingEngineTokens to DecoderState

This commit introduces new methods in the DecoderState class to manage the number of tokens for each request in a batch. The following changes were made:
- Added `getNumDecodingEngineTokens()` to retrieve the number of tokens for all requests.
- Added `getNumDecodingEngineTokens(SizeType32 batchIdx)` to get the token count for a specific request.
- Added `setNumDecodingEngineTokens(SizeType32 batchIdx, SizeType32 numTokens)` to set the token count for a specific request.
- Updated the setup method to initialize the token count vector based on the maximum batch size.
- Refactored the `CreateNewDecoderRequests` class to utilize the new token management methods, improving clarity and maintainability.

Signed-off-by: Robin Kobus <19427718+Funatiq@users.noreply.github.com>

* refactor: Improve shape variables in DecoderState

Signed-off-by: Robin Kobus <19427718+Funatiq@users.noreply.github.com>

---------

Signed-off-by: Robin Kobus <19427718+Funatiq@users.noreply.github.com>
2025-04-01 18:47:31 +08:00
..
utils Update TensorRT-LLM (#2820) 2025-02-25 21:21:49 +08:00
bufferManager.h Update TensorRT-LLM (#2755) 2025-02-11 03:01:00 +00:00
common.h Update TensorRT-LLM (#2502) 2024-11-26 16:51:34 +08:00
cudaEvent.h Update TensorRT-LLM (#787) 2024-01-02 17:54:32 +08:00
cudaStream.h Update TensorRT-LLM (#2532) 2024-12-04 21:16:56 +08:00
decoderState.h refactor: Simplify disableLookahead and improve numDecodingEngineTokens handling (#3103) 2025-04-01 18:47:31 +08:00
decodingInput.h refactor: Simplify disableLookahead and improve numDecodingEngineTokens handling (#3103) 2025-04-01 18:47:31 +08:00
decodingOutput.h Update (#2978) 2025-03-23 16:39:35 +08:00
eagleBuffers.h Update TensorRT-LLM (#2873) 2025-03-11 21:13:42 +08:00
eagleModule.h Update TensorRT-LLM (#2792) 2025-02-18 21:27:39 +08:00
explicitDraftTokensBuffers.h Update TensorRT-LLM (#2873) 2025-03-11 21:13:42 +08:00
generationInput.h Update TensorRT-LLM (#1598) 2024-05-14 16:43:41 +08:00
generationOutput.h Update TensorRT-LLM (#1598) 2024-05-14 16:43:41 +08:00
gptDecoder.h Update TensorRT-LLM (#2582) 2024-12-16 21:50:47 -08:00
gptDecoderBatched.h refactor: Simplify disableLookahead and improve numDecodingEngineTokens handling (#3103) 2025-04-01 18:47:31 +08:00
gptJsonConfig.h Update TensorRT-LLM (#2532) 2024-12-04 21:16:56 +08:00
gptSession.h Update TensorRT-LLM (#2755) 2025-02-11 03:01:00 +00:00
iBuffer.h Update TensorRT-LLM (#2755) 2025-02-11 03:01:00 +00:00
iGptDecoderBatched.h refactor: Simplify disableLookahead and improve numDecodingEngineTokens handling (#3103) 2025-04-01 18:47:31 +08:00
ipcNvlsMemory.h Update TensorRT-LLM (#2792) 2025-02-18 21:27:39 +08:00
ipcUtils.h Update TensorRT-LLM (#2873) 2025-03-11 21:13:42 +08:00
iStatefulGptDecoder.h refactor: Remove speculative decoding parameters from stateful decoders (#3024) 2025-03-26 20:16:26 +08:00
iTensor.h Update TensorRT-LLM (#2532) 2024-12-04 21:16:56 +08:00
lookaheadBuffers.h Update TensorRT-LLM (#2582) 2024-12-16 21:50:47 -08:00
lookaheadModule.h Update TensorRT-LLM (#2582) 2024-12-16 21:50:47 -08:00
loraCache.h Update TensorRT-LLM (#2755) 2025-02-11 03:01:00 +00:00
loraCachePageManagerConfig.h Update TensorRT-LLM (#1598) 2024-05-14 16:43:41 +08:00
loraModule.h Update TensorRT-LLM (#2755) 2025-02-11 03:01:00 +00:00
medusaModule.h Update TensorRT-LLM (#2436) 2024-11-12 15:27:49 +08:00
memoryCounters.h Update TensorRT-LLM (#2110) 2024-08-13 22:34:33 +08:00
modelConfig.h Update TensorRT-LLM (#2873) 2025-03-11 21:13:42 +08:00
promptTuningParams.h Update TensorRT-LLM (#1598) 2024-05-14 16:43:41 +08:00
rawEngine.h Update TensorRT-LLM (#2215) 2024-09-10 18:21:22 +08:00
request.h Update TensorRT-LLM (#2413) 2024-11-05 16:27:06 +08:00
runtimeDefaults.h Update TensorRT-LLM (#2436) 2024-11-12 15:27:49 +08:00
samplingConfig.h v1.2 (#3082) 2025-03-26 23:31:29 +08:00
speculativeDecodingMode.h Update TensorRT-LLM (#2436) 2024-11-12 15:27:49 +08:00
speculativeDecodingModule.h Update TensorRT-LLM (#1763) 2024-06-11 16:59:02 +08:00
statefulGptDecoderBatched.h Revert "refactor: Replace DecoderFinishedEvent with CudaEvent in decoder clas…" (#3183) 2025-04-01 12:49:27 +08:00
tllmLogger.h Update TensorRT-LLM (#787) 2024-01-02 17:54:32 +08:00
worldConfig.h Update TensorRT-LLM (#2849) 2025-03-04 18:44:00 +08:00