Skip to content

Commit d55b929

Browse files
committed
remove redundant code
1 parent fdf6c7e commit d55b929

2 files changed

Lines changed: 2 additions & 34 deletions

File tree

Device/CSR/CsrSplit.cu

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ __global__ void fillFvalue(const real *csrFvalue, uint numCsr, const uint *preRo
7979
atomicAdd(newCsrFeaLen + (firstPartId + 1) * numFea + feaId, 1);
8080
newCsrLen[basePos + numCsrCurPart] = csrLen;
8181
}
82-
// if(0.369250 == temp){
83-
// printf("csr len of 0.369250 is %d and %d; old len=%d, csrId=%d\n", newCsrLen[basePos], newCsrLen[basePos + numCsrCurPart], oldCsrLen[csrId], csrId);
84-
// }
8582
}
8683

8784
__global__ void newCsrLenFvalue(const int *preFvalueInsId, int numFeaValue, const int *pInsId2Nid, int maxNid,
@@ -101,10 +98,7 @@ __global__ void newCsrLenFvalue(const int *preFvalueInsId, int numFeaValue, cons
10198
RangeBinarySearch(gTid, eachCsrStart, numCsr, csrId);
10299
CONCHECKER(csrId < numCsr);
103100
__syncthreads();
104-
//first csrId
105-
// if(gTid >= numFeaValue && tid == 0){
106-
// printf("oh shitt####################################################\n");
107-
// }
101+
108102
if(tid == 0)
109103
firstCsrId = csrId;
110104
__syncthreads();
@@ -115,30 +109,16 @@ __global__ void newCsrLenFvalue(const int *preFvalueInsId, int numFeaValue, cons
115109
int insId = preFvalueInsId[gTid];//insId is not -1, as preFvalueInsId is dense.
116110
int pid = pInsId2Nid[insId] - maxNid - 1;//mapping to new node
117111

118-
// if(csrId == 2809992 && csrFvalue[csrId] == 0.369250){
119-
// printf("gpu pid=%d, insId=%d, csrfvalue=%f, left_fv=%f, right_fv=%f, gTid=%d, blkid=%d\n",
120-
// pid, insId, csrFvalue[csrId], csrFvalue[csrId - 1], csrFvalue[csrId + 1], gTid, blockIdx.y * gridDim.x + blockIdx.x);
121-
// }
122-
123112
csrId2Pid[csrId] = pid < 0 ? LARGE_1B_UCHAR : pid;
124113
if(pid >= 0 && pid % 2 == 0){//not leaf node and it's first part.
125114
uint counterOffset = csrId - firstCsrId;
126-
// if(305030 == csrId || 478798 == csrId){
127-
// printf("first csr id=%d, csrId=%d\n", firstCsrId, csrId);
128-
// }
115+
129116
__threadfence();
130117
uint orgValue = atomicAdd(csrCounter + counterOffset, 1);
131-
// if(csrFvalue[csrId] == 0.369250){
132-
// printf("gpu pid=%d, insId=%d, csrfvalue=%f, firstCsrId=%d, cntOffset=%d, orgValue=%d, cnt=%d\n",
133-
// pid, insId, csrFvalue[csrId], firstCsrId, counterOffset, orgValue, csrCounter[counterOffset]);
134-
// }
135118
}
136119
}
137120

138121
__syncthreads();
139-
// if(blockIdx.y * gridDim.x + blockIdx.x == 2216293 && tid == 95){
140-
// printf("###################################################################### cnt=%d\n", csrCounter[tid]);
141-
// }
142122
//compute len of each csr
143123
if(csrCounter[tid] > 0){
144124
uint numCsrCurPart;
@@ -149,9 +129,6 @@ __global__ void newCsrLenFvalue(const int *preFvalueInsId, int numFeaValue, cons
149129
numCsrPrePartsAhead, posInPart, numCsrCurPart, feaId);
150130

151131
atomicAdd(csrNewLen + numCsrPrePartsAhead * 2 + posInPart, csrCounter[tid]);
152-
// if(blockIdx.y * gridDim.x + blockIdx.x == 2216293 && tid == 95){
153-
// printf("csrNewLen=%d, numcsrPrePartAhead=%d, posInPart=%d, cnt=%d\n", csrNewLen[numCsrPrePartsAhead * 2 + posInPart], numCsrPrePartsAhead, posInPart, csrCounter[tid]);
154-
// }
155132
}
156133
}
157134

Device/FindSplit/FindFeaCsr.cu

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ void AfterCompression(GBDTGPUMemManager &manager, BagCsrManager &csrManager, Bag
150150
int numSeg = bagManager.m_numFea * numofSNode;
151151
//construct keys for exclusive scan
152152
checkCudaErrors(cudaMemset(csrManager.getMutableCsrKey(), -1, sizeof(uint) * csrManager.curNumCsr));
153-
// checkCudaErrors(cudaMemset(pCSRMultableKey, -1, sizeof(uint) * csrManager.curNumCsr));
154-
printf("done constructing key... number of segments is %d\n", numSeg);
155153

156154
//set keys by GPU
157155
uint maxSegLen = 0;
@@ -339,10 +337,6 @@ cudaDeviceSynchronize();
339337
int blockSizeFillFvalue;
340338
dim3 dimNumBlockToFillFvalue;
341339
conf.ConfKernel(csrManager.curNumCsr, blockSizeFillFvalue, dimNumBlockToFillFvalue);
342-
//fid hess sum
343-
uint *hess_cnt_d;
344-
checkCudaErrors(cudaMalloc((void**)&hess_cnt_d, sizeof(uint) * bagManager.m_numFea));
345-
checkCudaErrors(cudaMemset(hess_cnt_d, 0, sizeof(uint) * bagManager.m_numFea));
346340
fillFvalue<<<dimNumBlockToFillFvalue, blockSizeFillFvalue>>>(csrManager.getCsrFvalue(), csrManager.curNumCsr, csrManager.pEachCsrFeaStartPos,
347341
bagManager.m_pPreNumSN_h[0], bagManager.m_numFea, csrManager.getCsrKey(), pOldCsrLen_d, pCsrId2Pid,
348342
// bagManager.m_pPreNumSN_h[bagId], bagManager.m_numFea, pCSRKey, pOldCsrLen_d, pCsrId2Pid,
@@ -426,7 +420,6 @@ checkCudaErrors(cudaFree(pCsrMarker));
426420
csrManager.pEachNodeSizeInCsr, csrManager.pEachCsrNodeStartPos, csrManager.getMutableCsrFvalue(), csrManager.getMutableCsrLen());
427421
}
428422
//need to compute for every new tree
429-
printf("reserve memory\n");
430423
if(indexComp.histogram_d.reservedSize < csrManager.curNumCsr * (2 + 2 * sizeof(real)/sizeof(uint))){//make sure enough memory for reuse
431424
printf("reallocate memory for histogram (sn=%u): %u v.s. %u.......\n", numofSNode, indexComp.histogram_d.reservedSize,
432425
csrManager.curNumCsr * (2 + 2 * sizeof(real)/sizeof(uint)));
@@ -448,7 +441,6 @@ checkCudaErrors(cudaFree(pCsrMarker));
448441
pCsrStartPos_d = (uint*)indexComp.partitionMarker.addr;
449442
printf("comp gd and hess\n");
450443

451-
452444
ComputeGDHess<<<dimNumofBlockForGD, blockSizeForGD, sharedMemSizeForGD>>>(csrManager.getCsrLen(), pCsrStartPos_d,
453445
bagManager.m_pInsGradEachBag,
454446
bagManager.m_pInsHessEachBag,
@@ -457,7 +449,6 @@ checkCudaErrors(cudaFree(pCsrMarker));
457449
GETERROR("after ComputeGD");
458450
clock_t csr_len_end = clock();
459451
total_csr_len_t += (csr_len_end - csr_len_t);
460-
printf("done comp gd and hess\n");
461452
}
462453

463454
void DeviceSplitter::FeaFinderAllNode2(void *pStream, int bagId)

0 commit comments

Comments
 (0)