@@ -478,17 +478,6 @@ class AsymmetricalCacheTest : public ::testing::TestWithParam<AsymmetricTestPara
478478
479479 void TearDown () override {}
480480
481- int getEnvMpiDebugRank ()
482- {
483- // Look-up env variable TLLM_DEBUG_RANK.
484- char const * const env = std::getenv (" TLLM_DEBUG_RANK" );
485- if (env == nullptr )
486- {
487- return -2 ; // -1 means all ranks, -2 means no debug rank.
488- }
489- return std::stoi (env);
490- }
491-
492481 void setUpCommunicator (int contextTp, int contextPp, int contextCp, int genTp, int genPp, int genCp,
493482 bool isMLA = false , bool contextDP = false , bool generationDP = false )
494483 {
@@ -968,7 +957,8 @@ class AsymmetricalCacheTest : public ::testing::TestWithParam<AsymmetricTestPara
968957 {
969958 if (blockIdInWindow >= startBlockId)
970959 {
971- verifyBlockData (*it, initial, globalBlockIdsForWindow.empty () ? blockIdx : globalBlockIdsForWindow[blockIdx], windowSize);
960+ verifyBlockData (*it, initial,
961+ globalBlockIdsForWindow.empty () ? blockIdx : globalBlockIdsForWindow[blockIdx], windowSize);
972962 }
973963 blockIdx++;
974964 blockIdInWindow++;
@@ -978,11 +968,6 @@ class AsymmetricalCacheTest : public ::testing::TestWithParam<AsymmetricTestPara
978968
979969 void fillBlockData (tensorrt_llm::runtime::ITensor& blockData, int blockId, size_t initial, int windowSize = 0 )
980970 {
981- static const int TARGET_RANK = getEnvMpiDebugRank (); // -1 means all ranks.
982- if (TARGET_RANK == -1 || tensorrt_llm::mpi::MpiComm::world ().getRank () == TARGET_RANK)
983- {
984- TLLM_LOG_INFO (" fillBlockData called for rank %d mRankInInstance %d blockId %d windowSize %d" , mRank , mRankInInstance , blockId, windowSize);
985- }
986971 auto const & blockManager = mManager ->getBlockManager ();
987972 auto const onlyWindowSize = windowSize == 0 ? blockManager.getPoolWindowSize (0 ) : windowSize;
988973 auto const & bufferManager = blockManager.getBufferManager (onlyWindowSize);
@@ -1032,19 +1017,6 @@ class AsymmetricalCacheTest : public ::testing::TestWithParam<AsymmetricTestPara
10321017 using ValueType = decltype (generateValue);
10331018 auto * dataPtr = static_cast <ValueType*>(hostTensor->data (keyIndex));
10341019 *dataPtr = generateValue;
1035- if (TARGET_RANK == -1 || tensorrt_llm::mpi::MpiComm::world ().getRank () == TARGET_RANK)
1036- {
1037- TLLM_LOG_INFO (tensorrt_llm::mpi::MpiComm::world ().getRank (),
1038- " [RANK %d] [fillBlockData::key] blockId=%d, layer=%d->%d, head=%d->%d, token=%d->%d, hidden=%d, "
1039- " keyIdx=%zu, set_value=%s, dataType=%d" ,
1040- tensorrt_llm::mpi::MpiComm::world ().getRank (),
1041- blockId, layerId, layerId + startLayerId,
1042- headId, headId + startHeadId,
1043- tokenId, tokenId + startTokenId,
1044- hiddenId, keyIndex,
1045- std::to_string (static_cast <double >(*dataPtr)).c_str (),
1046- static_cast <int >(blockData.getDataType ()));
1047- }
10481020 },
10491021 generateExpectedValue (initial, windowSize, tokenId + startTokenId, layerId + startLayerId,
10501022 headId + startHeadId, hiddenId, true , blockData.getDataType ()));
@@ -1069,17 +1041,10 @@ class AsymmetricalCacheTest : public ::testing::TestWithParam<AsymmetricTestPara
10691041 bufferManager.getStream ().synchronize ();
10701042 }
10711043
1072- void verifyBlockData (
1073- tensorrt_llm::runtime::ITensor& blockData, size_t initial, int blockId, int windowSize = 0 )
1044+ void verifyBlockData (tensorrt_llm::runtime::ITensor& blockData, size_t initial, int blockId, int windowSize = 0 )
10741045 {
10751046 auto const & blockManager = mManager ->getBlockManager ();
10761047
1077- static const int TARGET_RANK = getEnvMpiDebugRank (); // -1 means all ranks.
1078- if (TARGET_RANK == -1 || tensorrt_llm::mpi::MpiComm::world ().getRank () == TARGET_RANK)
1079- {
1080- TLLM_LOG_INFO (" verifyBlockData called for rank %d mRankInInstance %d blockId %d" , mRank , mRankInInstance , blockId);
1081- }
1082-
10831048 auto const onlyWindowSize = windowSize == 0 ? blockManager.getPoolWindowSize (0 ) : windowSize;
10841049 auto const & bufferManager = blockManager.getBufferManager (onlyWindowSize);
10851050
@@ -1132,24 +1097,6 @@ class AsymmetricalCacheTest : public ::testing::TestWithParam<AsymmetricTestPara
11321097 using ValueType = decltype (generateValue);
11331098 auto * dataPtr = static_cast <ValueType*>(hostTensor->data (keyIndex));
11341099 EXPECT_EQ (*dataPtr, generateValue);
1135- if (TARGET_RANK == -1 || tensorrt_llm::mpi::MpiComm::world ().getRank () == TARGET_RANK)
1136- {
1137- std::string result = " " ;
1138- if (*dataPtr != generateValue) {
1139- result = " FAILED!" ;
1140- }
1141- TLLM_LOG_INFO (tensorrt_llm::mpi::MpiComm::world ().getRank (),
1142- " [RANK %d] [verifyBlockData::value] blockId=%d, layer=%d->%d, head=%d->%d, token=%d->%d, hidden=%d, "
1143- " valueIdx=%zu, actual_value=%s, dataType=%d %s" ,
1144- tensorrt_llm::mpi::MpiComm::world ().getRank (),
1145- blockId, layerId, layerId + startLayerId,
1146- headId, headId + startHeadId,
1147- tokenId, tokenId + startTokenId,
1148- hiddenId, valueIndex,
1149- std::to_string (static_cast <double >(*dataPtr)).c_str (),
1150- static_cast <int >(blockData.getDataType ()),
1151- result.c_str ());
1152- }
11531100 },
11541101 generateExpectedValue (initial, windowSize, tokenId + startTokenId, layerId + startLayerId,
11551102 headId + startHeadId, hiddenId, true , blockData.getDataType ()));
@@ -1175,12 +1122,6 @@ class AsymmetricalCacheTest : public ::testing::TestWithParam<AsymmetricTestPara
11751122 std::variant<double , float , int16_t , int8_t > generateExpectedValue (size_t initial, int windowSize, int tokenId,
11761123 int layerId, int headId, int hiddenId, bool key, nvinfer1::DataType dataType)
11771124 {
1178- static const int TARGET_RANK = getEnvMpiDebugRank (); // -1 means all ranks.
1179- if (TARGET_RANK == -1 || tensorrt_llm::mpi::MpiComm::world ().getRank () == TARGET_RANK)
1180- {
1181- TLLM_LOG_INFO (" generateExpectedValue called for rank %d, initial=%zu, windowSize=%d, tokenId=%d, layerId=%d, headId=%d, hiddenId=%d, key=%d, dataType=%d" ,
1182- tensorrt_llm::mpi::MpiComm::world ().getRank (), initial, windowSize, tokenId, layerId, headId, hiddenId, key, static_cast <int >(dataType));
1183- }
11841125 size_t seed = 0 ;
11851126 std::size_t hashValue = std::hash<size_t >{}(initial);
11861127 std::hash<int > hasher{};
0 commit comments