Skip to content

Commit 857f27d

Browse files
committed
Adjusting for default CF regression
1 parent 95bb2ff commit 857f27d

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ AddOption(nnClusterizerSizeInputTime, int, 3, "", 0, "Size of the input to the N
315315
AddOption(nnClusterizerUseCFregression, int, 0, "", 0, "(bool, default = false) If true, use the regression from the native clusterizer and not the NN")
316316
AddOption(nnClusterizerBatchedMode, unsigned int, 1, "", 0, "(int, default = 1) If >1, the NN is evaluated on batched input of size specified in this variable")
317317
AddOption(nnClusterizerVerbosity, int, -1, "", 0, "(int, default = -1) If >0, logging messages of the clusterizer will be displayed")
318+
AddOption(nnClusterizerBoundaryFillValue, int, -1, "", 0, "Fill value for the boundary of the input to the NN")
318319
AddOption(nnClassificationPath, std::string, "network_class.onnx", "", 0, "The classification network path")
319320
AddOption(nnClassThreshold, float, 0.5, "", 0, "The cutoff at which clusters will be accepted / rejected.")
320321
AddOption(nnRegressionPath, std::string, "network_reg.onnx", "", 0, "The regression network path")

GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
943943

944944
float time_clusterizer = 0, time_fill = 0;
945945
int evalDtype = clusterer.OrtOptions["dtype"].find("32") != std::string::npos;
946-
clusterer.outputDataClass.resize(clusterer.mPmemory->counters.nClusters);
946+
clusterer.outputDataClass.resize(clusterer.mPmemory->counters.nClusters, -1);
947947

948948
for(int batch = 0; batch < std::ceil((float)clusterer.mPmemory->counters.nClusters / clusterer.nnClusterizerBatchedMode); batch++) {
949949
uint batchStart = batch * clusterer.nnClusterizerBatchedMode;
@@ -953,9 +953,9 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
953953
clusterer.centralCharges.resize(iSize);
954954

955955
if (evalDtype == 1) {
956-
clusterer.inputData32.resize(iSize * clusterer.nnClusterizerElementSize);
956+
clusterer.inputData32.resize(iSize * clusterer.nnClusterizerElementSize, GetProcessingSettings().nnClusterizerBoundaryFillValue);
957957
} else {
958-
clusterer.inputData16.resize(iSize * clusterer.nnClusterizerElementSize);
958+
clusterer.inputData16.resize(iSize * clusterer.nnClusterizerElementSize, GetProcessingSettings().nnClusterizerBoundaryFillValue);
959959
}
960960

961961
auto start0 = std::chrono::high_resolution_clock::now();
@@ -989,7 +989,7 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
989989
time_clusterizer += std::chrono::duration_cast<std::chrono::nanoseconds>(stop1 - start1).count() / 1e9;
990990

991991
if (clusterer.nnClusterizerVerbosity < 3) {
992-
LOG(info) << "[NN CF] Apply NN (fragment " << fragment.index << ", lane: " << lane << ", slice: " << iSlice << "): filling data " << time_fill << "s ; clusterizer: " << time_clusterizer << "s";
992+
LOG(info) << "[NN CF] Apply NN (fragment " << fragment.index << ", lane: " << lane << ", slice: " << iSlice << "): filling data " << time_fill << "s ; clusterizer: " << time_clusterizer << "s ; " << clusterer.mPmemory->counters.nClusters << " clusters --> " clusterer.mPmemory->counters.nClusters / (time_fill + time_clusterizer) << " clusters/s";
993993
}
994994
} else {
995995
runKernel<GPUTPCCFClusterizer>({GetGrid(clusterer.mPmemory->counters.nClusters, lane, GPUReconstruction::krnlDeviceType::CPU), {iSlice}}, 0);

GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizer.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ GPUdii() void GPUTPCNNClusterizer::Thread<0>(int32_t nBlocks, int32_t nThreads,
3131
{
3232
uint glo_idx = get_global_id(0);
3333
if (mode == -1) {
34+
if (clusterer.outputDataClass[glo_idx] == 0) { // default clusterizer should not be called in batched mode due to mess-up with thread indices
35+
return;
36+
}
3437
Array2D<PackedCharge> chargeMap(reinterpret_cast<PackedCharge*>(clusterer.mPchargeMap));
3538
CPU_ONLY(MCLabelAccumulator labelAcc(clusterer));
3639
tpc::ClusterNative* clusterOut = (onlyMC) ? nullptr : clusterer.mPclusterByRow;

0 commit comments

Comments
 (0)