TensorRT-LLMs/cpp
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
..
cmake fix #3109: early exit cmake if find_library() does not find any lib (#3113) 2025-03-29 19:59:03 +08:00
include/tensorrt_llm refactor: Simplify disableLookahead and improve numDecodingEngineTokens handling (#3103) 2025-04-01 18:47:31 +08:00
micro_benchmarks Update TensorRT-LLM (#2936) 2025-03-18 21:25:19 +08:00
tensorrt_llm refactor: Simplify disableLookahead and improve numDecodingEngineTokens handling (#3103) 2025-04-01 18:47:31 +08:00
tests refactor: Improve decoder finalize function (#3077) 2025-03-28 14:33:59 +08:00
CMakeLists.txt Update (#2978) 2025-03-23 16:39:35 +08:00