Skip to content

Commit 984857e

Browse files
committed
Bug-fixes for boundary reading
1 parent 45d8071 commit 984857e

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ AddOption(nnInferenceDtype, std::string, "fp32", "", 0, "(std::string) Specify t
306306
AddOption(nnInferenceThreadsPerNN, int, 0, "", 0, "Number of threads used to evaluate one neural network")
307307
AddOption(nnInferenceEnableOrtOptimization, unsigned int, 1, "", 0, "Enables graph optimizations in ONNX Runtime. Can be greater than 1!")
308308
AddOption(nnInferenceOrtProfiling, int, 0, "", 0, "Enables profiling of model execution in ONNX Runtime")
309-
AddOption(nnInferenceOrtProfilingPath, std::string, ".", "", 0, "If mmInferenceOrtProfiling is set, the path to store the profiling data")
309+
AddOption(nnInferenceOrtProfilingPath, std::string, ".", "", 0, "If nnInferenceOrtProfiling is set, the path to store the profiling data")
310310
AddOption(nnInferenceVerbosity, int, 1, "", 0, "0: No messages; 1: Warnings; 2: Warnings + major debugs; >3: All debugs")
311311
AddOption(nnClusterizerAddIndexData, int, 1, "", 0, "If normalized index data (sector, row, pad), should be appended to the input")
312312
AddOption(nnClusterizerSizeInputRow, int, 3, "", 0, "Size of the input to the NN (currently calcualted as (length-1)/2")
@@ -316,6 +316,7 @@ AddOption(nnClusterizerUseCFregression, int, 0, "", 0, "(bool, default = false)
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")
318318
AddOption(nnClusterizerBoundaryFillValue, int, -1, "", 0, "Fill value for the boundary of the input to the NN")
319+
AddOption(nnClusterizerApplyCfDeconvolution, int, 0, "", 0, "Applies the CFDeconvolution kernel before the digits to the network are filled")
319320
AddOption(nnClassificationPath, std::string, "network_class.onnx", "", 0, "The classification network path")
320321
AddOption(nnClassThreshold, float, 0.5, "", 0, "The cutoff at which clusters will be accepted / rejected.")
321322
AddOption(nnRegressionPath, std::string, "network_reg.onnx", "", 0, "The regression network path")

GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,9 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
931931
clusterer.OrtOptions["model-path"] = reg_model_paths[1];
932932
clusterer.model_reg_2.init(clusterer.OrtOptions);
933933
}
934-
} else {
934+
}
935+
936+
if (clusterer.nnClusterizerUseCFregression || (int)(GetProcessingSettings().nnClusterizerApplyCfDeconvolution)) {
935937
runKernel<GPUTPCCFDeconvolution>({GetGrid(clusterer.mPmemory->counters.nPositions, lane), {iSlice}});
936938
DoDebugAndDump(RecoStep::TPCClusterFinding, 262144 << 4, clusterer, &GPUTPCClusterFinder::DumpChargeMap, *mDebugFile, "Split Charges");
937939
}
@@ -992,6 +994,8 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
992994
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";
993995
}
994996
} else {
997+
runKernel<GPUTPCCFDeconvolution>({GetGrid(clusterer.mPmemory->counters.nPositions, lane), {iSlice}});
998+
DoDebugAndDump(RecoStep::TPCClusterFinding, 262144 << 4, clusterer, &GPUTPCClusterFinder::DumpChargeMap, *mDebugFile, "Split Charges");
995999
runKernel<GPUTPCCFClusterizer>({GetGrid(clusterer.mPmemory->counters.nClusters, lane, GPUReconstruction::krnlDeviceType::CPU), {iSlice}}, 0);
9961000
}
9971001

GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizer.cxx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@ bool GPUTPCNNClusterizer::isBoundary(int row, int pad, int global_shift, const G
108108
{
109109
if (pad < 0 || row < 0) { // Faster short-circuit
110110
return true;
111-
} else if (row <= 62) {
112-
if (pad < 0 || pad > geo.NPads(row)) {
111+
} else if (row < 63) {
112+
if (pad >= geo.NPads(row)) {
113113
return true;
114114
} else {
115115
return false;
116116
}
117-
} else if (row <= 62 + global_shift) { // to account for the gap between IROC and OROC. Charge will be set to -1 in order to signal boundary to the neural network
117+
} else if (row < (63 + global_shift)) { // to account for the gap between IROC and OROC. Charge will be set to -1 in order to signal boundary to the neural network
118118
return true;
119119
} else if (row <= o2::tpc::constants::MAXGLOBALPADROW - 1 + global_shift) {
120-
if (pad < 0 || pad > geo.NPads(row)) {
120+
if (pad >= geo.NPads(row - global_shift)) {
121121
return true;
122122
} else {
123123
return false;
@@ -156,7 +156,13 @@ GPUd() void GPUTPCNNClusterizer::fillInputData(int32_t nBlocks, int32_t nThreads
156156
for (int p = -clusterer.nnClusterizerSizeInputPad + pad_offset; p <= clusterer.nnClusterizerSizeInputPad + pad_offset; p++) {
157157
is_boundary = is_boundary || GPUTPCNNClusterizer::isBoundary(row + r + row_offset, pad + p, clusterer.nnClusterizerSizeInputRow, clusterer.Param().tpcGeometry);
158158
for (int t = -clusterer.nnClusterizerSizeInputTime; t <= clusterer.nnClusterizerSizeInputTime; t++) {
159-
if (!is_boundary) {
159+
if (is_boundary) {
160+
if(dtype == 0){
161+
clusterer.inputData16[write_idx] = (OrtDataType::Float16_t)((float)clusterer.nnClusterizerBoundaryFillValue);
162+
} else {
163+
clusterer.inputData32[write_idx] = (float)clusterer.nnClusterizerBoundaryFillValue;
164+
}
165+
} else {
160166
ChargePos tmp_pos(row + r, pad + p, time + t);
161167
if(dtype == 0){
162168
clusterer.inputData16[write_idx] = (OrtDataType::Float16_t)((float)chargeMap[tmp_pos].unpack() / central_charge);

0 commit comments

Comments
 (0)