Skip to content

Commit eebd047

Browse files
committed
format code
Signed-off-by: Xiwen Yu <13230610+VALLIS-NERIA@users.noreply.github.com>
1 parent aa15395 commit eebd047

File tree

27 files changed

+292
-204
lines changed

27 files changed

+292
-204
lines changed

cpp/include/tensorrt_llm/batch_manager/evictionPolicy.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ class MaybePlaceholderLRUEvictionPolicy : public LRUEvictionPolicy
123123
/// @brief Initialize the placeholder eviction policy with pre-allocated placeholder blocks.
124124
/// @param allPlaceholderBlocksById Vector of placeholder blocks indexed by abs(blockId).
125125
/// Indices 0 and 1 are unused (nullptr); index abs(blockId) holds the block with that ID.
126-
/// @param numPlaceholderBlocks Number of placeholder blocks (determines valid index range [2, numPlaceholderBlocks+1]).
126+
/// @param numPlaceholderBlocks Number of placeholder blocks (determines valid index range [2,
127+
/// numPlaceholderBlocks+1]).
127128
/// @param secondaryOffloadMinPriority Secondary offload priority threshold (passed to inner policy).
128129
void initializePlaceholders(std::vector<BlockPtr>& allPlaceholderBlocksById, SizeType32 numPlaceholderBlocks,
129130
std::optional<executor::RetentionPriority> secondaryOffloadMinPriority);

cpp/include/tensorrt_llm/batch_manager/kvCacheManager.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,8 @@ class WindowBlockManager
10501050
//! \param pinBlocks If true, increment ref count for blocks while storing (pin on store).
10511051
//! \return Pair of (num blocks stored for reuse, vector of pinned block IDs).
10521052
[[nodiscard]] std::pair<SizeType32, std::vector<KVCacheBlock::IdType>> storeBlocks(
1053-
std::vector<BlockKey> const& blockKeys, std::vector<KVCacheBlock::IdType> const& blockIds,OptionalRef<LlmRequest const> llmRequest,
1054-
bool pinBlocks = false);
1053+
std::vector<BlockKey> const& blockKeys, std::vector<KVCacheBlock::IdType> const& blockIds,
1054+
OptionalRef<LlmRequest const> llmRequest, bool pinBlocks = false);
10551055

10561056
[[nodiscard]] bool verifyQueueIntegrity();
10571057

@@ -1168,7 +1168,6 @@ class WindowBlockManager
11681168
&& LinearAttentionMetadata::hasRecurrentStatesCache(mLinearAttentionMetadata->cacheType);
11691169
}
11701170

1171-
11721171
private:
11731172
nvinfer1::DataType mDataType;
11741173
SizeType32 mWindowSize;
@@ -1815,7 +1814,8 @@ class BaseKVCacheManager
18151814
/// @brief Increase size for request at seqSlotIdx. Allocate new KV cache block(s) if needed.
18161815
virtual void addToken(LlmRequest::RequestIdType requestId) = 0;
18171816

1818-
/// @brief Get the number of tokens for a request at KVCacheManager's sight. Sometimes it is different from LlmRequest::getNumTokens.
1817+
/// @brief Get the number of tokens for a request at KVCacheManager's sight. Sometimes it is different from
1818+
/// LlmRequest::getNumTokens.
18191819
[[nodiscard]] virtual SizeType32 getTokenCount(LlmRequest::RequestIdType requestId) const = 0;
18201820

18211821
/// @brief Add new request to the KV cache manager.
@@ -1935,7 +1935,9 @@ class BaseKVCacheManager
19351935
}
19361936
TLLM_LOG_DEBUG("[calculateCacheSizePerTokenForSingleWindowSize] nkvh: %s", ss.str().c_str());
19371937
auto const sumLocalHeads = std::reduce(nkvh.cbegin(), nkvh.cend());
1938-
TLLM_LOG_DEBUG("[calculateCacheSizePerTokenForSingleWindowSize] sumLocalHeads: %d, kvFactor: %d, sizePerHead: %d", sumLocalHeads, kvFactor, modelConfig.getSizePerHead());
1938+
TLLM_LOG_DEBUG(
1939+
"[calculateCacheSizePerTokenForSingleWindowSize] sumLocalHeads: %d, kvFactor: %d, sizePerHead: %d",
1940+
sumLocalHeads, kvFactor, modelConfig.getSizePerHead());
19391941
// NOTE: We expect the initialization of modelConfig to have already taken the tp size into account and do not
19401942
// address it here
19411943
// consider only local layers for the calculation

cpp/include/tensorrt_llm/batch_manager/templatedTrie.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ class Node
165165
{
166166
}
167167

168-
//! \brief Print subtree in Unix `tree` style (├──, └──, │). NodeKey must support operator<<(std::ostream&, NodeKey).
169-
void printTree(int depth = 0, std::string const& prefix = "",
170-
std::optional<bool> isLast = std::nullopt) const
168+
//! \brief Print subtree in Unix `tree` style (├──, └──, │). NodeKey must support operator<<(std::ostream&,
169+
//! NodeKey).
170+
void printTree(int depth = 0, std::string const& prefix = "", std::optional<bool> isLast = std::nullopt) const
171171
{
172172
(void) depth;
173173
bool const isRoot = mPrevNode.expired();

cpp/tensorrt_llm/batch_manager/evictionPolicy.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ class PlaceholderInnerLRUEvictionPolicy : public LRUEvictionPolicy
302302
}
303303
if (block->hasRefs())
304304
{
305-
TLLM_LOG_WARNING("Found placeholder block (id %d) with references in placeholder policy",
306-
block->getBlockId());
305+
TLLM_LOG_WARNING(
306+
"Found placeholder block (id %d) with references in placeholder policy", block->getBlockId());
307307
queueCompromised = true;
308308
}
309309
}
@@ -322,8 +322,8 @@ void MaybePlaceholderLRUEvictionPolicy::initializePlaceholders(std::vector<Block
322322

323323
// Extract the actual placeholder blocks from allPlaceholderBlocksById[2..numPlaceholderBlocks+1]
324324
// so the inner policy's mFreeBlockIterators[i] corresponds to blockId = -(i+2).
325-
std::vector<BlockPtr> placeholderBlocks(allPlaceholderBlocksById.begin() + 2,
326-
allPlaceholderBlocksById.begin() + numPlaceholderBlocks + 2);
325+
std::vector<BlockPtr> placeholderBlocks(
326+
allPlaceholderBlocksById.begin() + 2, allPlaceholderBlocksById.begin() + numPlaceholderBlocks + 2);
327327

328328
mPlaceholderEvictionPolicy->initialize(placeholderBlocks, {numPlaceholderBlocks, 0}, secondaryOffloadMinPriority);
329329
}

0 commit comments

Comments
 (0)