Skip to content

Commit 99ca93b

Browse files
committed
Merge branch 'gpu_clusterizer_2' into gpu_clusterizer
2 parents 0bc4097 + a478634 commit 99ca93b

File tree

8 files changed

+351
-237
lines changed

8 files changed

+351
-237
lines changed

GPU/GPUTracking/CMakeLists.txt

Lines changed: 97 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -158,38 +158,71 @@ set(HDRS_INSTALL
158158
)
159159

160160
set(SRCS_NO_CINT ${SRCS_NO_CINT} display/GPUDisplayInterface.cxx)
161-
set(SRCS_NO_CINT
162-
${SRCS_NO_CINT}
163-
Global/GPUChainITS.cxx
164-
ITS/GPUITSFitter.cxx
165-
ITS/GPUITSFitterKernels.cxx
166-
dEdx/GPUdEdx.cxx
167-
TPCConvert/GPUTPCConvert.cxx
168-
TPCConvert/GPUTPCConvertKernel.cxx
169-
DataCompression/GPUTPCCompression.cxx
170-
DataCompression/GPUTPCCompressionTrackModel.cxx
171-
DataCompression/GPUTPCCompressionKernels.cxx
172-
DataCompression/GPUTPCDecompression.cxx
173-
DataCompression/GPUTPCDecompressionKernels.cxx
174-
DataCompression/TPCClusterDecompressor.cxx
175-
DataCompression/GPUTPCClusterStatistics.cxx
176-
TPCClusterFinder/GPUTPCClusterFinder.cxx
177-
TPCClusterFinder/ClusterAccumulator.cxx
178-
TPCClusterFinder/MCLabelAccumulator.cxx
179-
TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx
180-
TPCClusterFinder/GPUTPCCFStreamCompaction.cxx
181-
TPCClusterFinder/GPUTPCCFChargeMapFiller.cxx
182-
TPCClusterFinder/GPUTPCCFPeakFinder.cxx
183-
TPCClusterFinder/GPUTPCCFNoiseSuppression.cxx
184-
TPCClusterFinder/GPUTPCCFClusterizer.cxx
185-
TPCClusterFinder/GPUTPCNNClusterizer.cxx
186-
TPCClusterFinder/GPUTPCCFDeconvolution.cxx
187-
TPCClusterFinder/GPUTPCCFMCLabelFlattener.cxx
188-
TPCClusterFinder/GPUTPCCFDecodeZS.cxx
189-
TPCClusterFinder/GPUTPCCFGather.cxx
190-
Refit/GPUTrackingRefit.cxx
191-
Refit/GPUTrackingRefitKernel.cxx
192-
Merger/GPUTPCGMO2Output.cxx)
161+
162+
if(NOT ALIGPU_BUILD_TYPE STREQUAL "Standalone")
163+
set(SRCS_NO_CINT ${SRCS_NO_CINT}
164+
Global/GPUChainITS.cxx
165+
ITS/GPUITSFitter.cxx
166+
ITS/GPUITSFitterKernels.cxx
167+
dEdx/GPUdEdx.cxx
168+
TPCConvert/GPUTPCConvert.cxx
169+
TPCConvert/GPUTPCConvertKernel.cxx
170+
DataCompression/GPUTPCCompression.cxx
171+
DataCompression/GPUTPCCompressionTrackModel.cxx
172+
DataCompression/GPUTPCCompressionKernels.cxx
173+
DataCompression/GPUTPCDecompression.cxx
174+
DataCompression/GPUTPCDecompressionKernels.cxx
175+
DataCompression/TPCClusterDecompressor.cxx
176+
DataCompression/GPUTPCClusterStatistics.cxx
177+
TPCClusterFinder/GPUTPCClusterFinder.cxx
178+
TPCClusterFinder/ClusterAccumulator.cxx
179+
TPCClusterFinder/MCLabelAccumulator.cxx
180+
TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx
181+
TPCClusterFinder/GPUTPCCFStreamCompaction.cxx
182+
TPCClusterFinder/GPUTPCCFChargeMapFiller.cxx
183+
TPCClusterFinder/GPUTPCCFPeakFinder.cxx
184+
TPCClusterFinder/GPUTPCCFNoiseSuppression.cxx
185+
TPCClusterFinder/GPUTPCCFClusterizer.cxx
186+
TPCClusterFinder/GPUTPCNNClusterizer.cxx
187+
TPCClusterFinder/GPUTPCCFDeconvolution.cxx
188+
TPCClusterFinder/GPUTPCCFMCLabelFlattener.cxx
189+
TPCClusterFinder/GPUTPCCFDecodeZS.cxx
190+
TPCClusterFinder/GPUTPCCFGather.cxx
191+
Refit/GPUTrackingRefit.cxx
192+
Refit/GPUTrackingRefitKernel.cxx
193+
Merger/GPUTPCGMO2Output.cxx)
194+
else()
195+
set(SRCS_NO_CINT ${SRCS_NO_CINT}
196+
Global/GPUChainITS.cxx
197+
ITS/GPUITSFitter.cxx
198+
ITS/GPUITSFitterKernels.cxx
199+
dEdx/GPUdEdx.cxx
200+
TPCConvert/GPUTPCConvert.cxx
201+
TPCConvert/GPUTPCConvertKernel.cxx
202+
DataCompression/GPUTPCCompression.cxx
203+
DataCompression/GPUTPCCompressionTrackModel.cxx
204+
DataCompression/GPUTPCCompressionKernels.cxx
205+
DataCompression/GPUTPCDecompression.cxx
206+
DataCompression/GPUTPCDecompressionKernels.cxx
207+
DataCompression/TPCClusterDecompressor.cxx
208+
DataCompression/GPUTPCClusterStatistics.cxx
209+
TPCClusterFinder/GPUTPCClusterFinder.cxx
210+
TPCClusterFinder/ClusterAccumulator.cxx
211+
TPCClusterFinder/MCLabelAccumulator.cxx
212+
TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx
213+
TPCClusterFinder/GPUTPCCFStreamCompaction.cxx
214+
TPCClusterFinder/GPUTPCCFChargeMapFiller.cxx
215+
TPCClusterFinder/GPUTPCCFPeakFinder.cxx
216+
TPCClusterFinder/GPUTPCCFNoiseSuppression.cxx
217+
TPCClusterFinder/GPUTPCCFClusterizer.cxx
218+
TPCClusterFinder/GPUTPCCFDeconvolution.cxx
219+
TPCClusterFinder/GPUTPCCFMCLabelFlattener.cxx
220+
TPCClusterFinder/GPUTPCCFDecodeZS.cxx
221+
TPCClusterFinder/GPUTPCCFGather.cxx
222+
Refit/GPUTrackingRefit.cxx
223+
Refit/GPUTrackingRefitKernel.cxx
224+
Merger/GPUTPCGMO2Output.cxx)
225+
endif()
193226

194227
set(SRCS_DATATYPES
195228
${SRCS_DATATYPES}
@@ -261,19 +294,37 @@ unset(HDRS_TMP)
261294

262295
# Main CMake part for O2
263296
if(ALIGPU_BUILD_TYPE STREQUAL "O2")
264-
o2_add_library(GPUDataTypes
265-
TARGETVARNAME targetName
266-
PUBLIC_INCLUDE_DIRECTORIES .
267-
Definitions
268-
DataTypes
269-
PUBLIC_LINK_LIBRARIES O2::GPUUtils
270-
O2::GPUCommon
271-
O2::ReconstructionDataFormats
272-
O2::TPCFastTransformation
273-
O2::ML
274-
PRIVATE_LINK_LIBRARIES O2::DataFormatsTPC
275-
SOURCES ${SRCS_DATATYPES})
276-
target_compile_definitions(${targetName} PRIVATE GPUCA_O2_LIB GPUCA_TPC_GEOMETRY_O2)
297+
298+
if(NOT ALIGPU_BUILD_TYPE STREQUAL "Standalone")
299+
o2_add_library(GPUDataTypes
300+
TARGETVARNAME targetName
301+
PUBLIC_INCLUDE_DIRECTORIES .
302+
Definitions
303+
DataTypes
304+
PUBLIC_LINK_LIBRARIES O2::GPUUtils
305+
O2::GPUCommon
306+
O2::ReconstructionDataFormats
307+
O2::TPCFastTransformation
308+
O2::ML
309+
PRIVATE_LINK_LIBRARIES O2::DataFormatsTPC
310+
SOURCES ${SRCS_DATATYPES})
311+
add_compile_definitions(GPUCA_HAS_ONNX=1)
312+
target_compile_definitions(${targetName} PRIVATE GPUCA_O2_LIB GPUCA_TPC_GEOMETRY_O2 GPUCA_HAS_ONNX)
313+
else()
314+
o2_add_library(GPUDataTypes
315+
TARGETVARNAME targetName
316+
PUBLIC_INCLUDE_DIRECTORIES .
317+
Definitions
318+
DataTypes
319+
PUBLIC_LINK_LIBRARIES O2::GPUUtils
320+
O2::GPUCommon
321+
O2::ReconstructionDataFormats
322+
O2::TPCFastTransformation
323+
PRIVATE_LINK_LIBRARIES O2::DataFormatsTPC
324+
SOURCES ${SRCS_DATATYPES})
325+
target_compile_definitions(${targetName} PRIVATE GPUCA_O2_LIB GPUCA_TPC_GEOMETRY_O2)
326+
endif()
327+
277328
o2_target_root_dictionary(GPUDataTypes
278329
HEADERS ${HDRS_CINT_DATATYPES} ${HDRS_CINT_O2_ADDITIONAL}
279330
LINKDEF GPUTrackingLinkDef_O2_DataTypes.h)
@@ -338,6 +389,7 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2")
338389
LABELS its COMPILE_ONLY)
339390

340391
add_subdirectory(Interface)
392+
341393
endif()
342394

343395
# Main CMake part for Standalone

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,34 @@ AddOption(tpcTriggerHandling, bool, true, "", 0, "Enable TPC trigger handling")
221221
AddHelp("help", 'h')
222222
EndConfig()
223223

224+
BeginSubConfig(GPUSettingsProcessingNNclusterizer, nn, configStandalone.proc, "NN", 0, "Processing settings for neural network clusterizer", proc_nn)
225+
AddOption(applyNNclusterizer, int, 0, "", 0, "(bool, default = 0), if the neural network clusterizer should be used.")
226+
AddOption(nnInferenceDevice, std::string, "CPU", "", 0, "(std::string) Specify inference device (cpu (default), rocm, cuda)")
227+
AddOption(nnInferenceDeviceId, unsigned int, 0, "", 0, "(unsigned int) Specify inference device id")
228+
AddOption(nnInferenceAllocateDevMem, int, 0, "", 0, "(bool, default = 0), if the device memory should be allocated for inference")
229+
AddOption(nnInferenceDtype, std::string, "fp32", "", 0, "(std::string) Specify the datatype for which inference is performed (fp32: default, fp16)") // fp32 or fp16
230+
AddOption(nnInferenceThreadsPerNN, int, 0, "", 0, "Number of threads used to evaluate one neural network")
231+
AddOption(nnInferenceEnableOrtOptimization, unsigned int, 1, "", 0, "Enables graph optimizations in ONNX Runtime. Can be greater than 1!")
232+
AddOption(nnInferenceOrtProfiling, int, 0, "", 0, "Enables profiling of model execution in ONNX Runtime")
233+
AddOption(nnInferenceOrtProfilingPath, std::string, ".", "", 0, "If nnInferenceOrtProfiling is set, the path to store the profiling data")
234+
AddOption(nnInferenceVerbosity, int, 1, "", 0, "0: No messages; 1: Warnings; 2: Warnings + major debugs; >3: All debugs")
235+
AddOption(nnClusterizerAddIndexData, int, 1, "", 0, "If normalized index data (sector, row, pad), should be appended to the input")
236+
AddOption(nnClusterizerSizeInputRow, int, 3, "", 0, "Size of the input to the NN (currently calcualted as (length-1)/2")
237+
AddOption(nnClusterizerSizeInputPad, int, 3, "", 0, "Size of the input to the NN (currently calcualted as (length-1)/2")
238+
AddOption(nnClusterizerSizeInputTime, int, 3, "", 0, "Size of the input to the NN (currently calcualted as (length-1)/2")
239+
AddOption(nnClusterizerUseCfRegression, int, 0, "", 0, "(bool, default = false) If true, use the regression from the native clusterizer and not the NN")
240+
AddOption(nnClusterizerApplyCfDeconvolution, int, 0, "", 0, "Applies the CFDeconvolution kernel before the digits to the network are filled")
241+
AddOption(nnClusterizerBatchedMode, unsigned int, 1, "", 0, "(int, default = 1) If >1, the NN is evaluated on batched input of size specified in this variable")
242+
AddOption(nnClusterizerVerbosity, int, -1, "", 0, "(int, default = -1) If >0, logging messages of the clusterizer will be displayed")
243+
AddOption(nnClusterizerBoundaryFillValue, int, -1, "", 0, "Fill value for the boundary of the input to the NN")
244+
AddOption(nnClusterizerApplyNoiseSupression, int, 1, "", 0, "Applies the NoiseSupression kernel before the digits to the network are filled")
245+
AddOption(nnClassificationPath, std::string, "network_class.onnx", "", 0, "The classification network path")
246+
AddOption(nnClassThreshold, float, 0.5, "", 0, "The cutoff at which clusters will be accepted / rejected.")
247+
AddOption(nnRegressionPath, std::string, "network_reg.onnx", "", 0, "The regression network path")
248+
AddOption(nnSigmoidTrafoClassThreshold, int, 1, "", 0, "If true (default), then the classification threshold is transformed by an inverse sigmoid function. This depends on how the network was trained (with a sigmoid as acitvation function in the last layer or not).")
249+
AddHelp("help", 'h')
250+
EndConfig()
251+
224252
BeginSubConfig(GPUSettingsProcessing, proc, configStandalone, "PROC", 0, "Processing settings", proc)
225253
AddOption(platformNum, int32_t, -1, "", 0, "Platform to use, in case the backend provides multiple platforms (OpenCL only, -1 = auto-select)")
226254
AddOption(deviceNum, int32_t, -1, "gpuDevice", 0, "Set GPU device to use (-1: automatic, -2: for round-robin usage in timeslice-pipeline)")
@@ -298,30 +326,7 @@ AddOption(printSettings, bool, false, "", 0, "Print all settings when initializi
298326
AddVariable(eventDisplay, o2::gpu::GPUDisplayFrontendInterface*, nullptr)
299327
AddSubConfig(GPUSettingsProcessingRTC, rtc)
300328
AddSubConfig(GPUSettingsProcessingParam, param)
301-
AddOption(applyNNclusterizer, int, 0, "", 0, "(bool, default = 0), if the neural network clusterizer should be used.")
302-
AddOption(nnInferenceDevice, std::string, "CPU", "", 0, "(std::string) Specify inference device (cpu (default), rocm, cuda)")
303-
AddOption(nnInferenceDeviceId, unsigned int, 0, "", 0, "(unsigned int) Specify inference device id")
304-
AddOption(nnInferenceAllocateDevMem, int, 0, "", 0, "(bool, default = 0), if the device memory should be allocated for inference")
305-
AddOption(nnInferenceDtype, std::string, "fp32", "", 0, "(std::string) Specify the datatype for which inference is performed (fp32: default, fp16)") // fp32 or fp16
306-
AddOption(nnInferenceThreadsPerNN, int, 0, "", 0, "Number of threads used to evaluate one neural network")
307-
AddOption(nnInferenceEnableOrtOptimization, unsigned int, 1, "", 0, "Enables graph optimizations in ONNX Runtime. Can be greater than 1!")
308-
AddOption(nnInferenceOrtProfiling, int, 0, "", 0, "Enables profiling of model execution in ONNX Runtime")
309-
AddOption(nnInferenceOrtProfilingPath, std::string, ".", "", 0, "If nnInferenceOrtProfiling is set, the path to store the profiling data")
310-
AddOption(nnInferenceVerbosity, int, 1, "", 0, "0: No messages; 1: Warnings; 2: Warnings + major debugs; >3: All debugs")
311-
AddOption(nnClusterizerAddIndexData, int, 1, "", 0, "If normalized index data (sector, row, pad), should be appended to the input")
312-
AddOption(nnClusterizerSizeInputRow, int, 3, "", 0, "Size of the input to the NN (currently calcualted as (length-1)/2")
313-
AddOption(nnClusterizerSizeInputPad, int, 3, "", 0, "Size of the input to the NN (currently calcualted as (length-1)/2")
314-
AddOption(nnClusterizerSizeInputTime, int, 3, "", 0, "Size of the input to the NN (currently calcualted as (length-1)/2")
315-
AddOption(nnClusterizerUseCFregression, int, 0, "", 0, "(bool, default = false) If true, use the regression from the native clusterizer and not the NN")
316-
AddOption(nnClusterizerBatchedMode, unsigned int, 1, "", 0, "(int, default = 1) If >1, the NN is evaluated on batched input of size specified in this variable")
317-
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")
319-
AddOption(nnClusterizerApplyNoiseSupression, int, 1, "", 0, "Applies the NoiseSupression kernel before the digits to the network are filled")
320-
AddOption(nnClusterizerApplyCfDeconvolution, int, 0, "", 0, "Applies the CFDeconvolution kernel before the digits to the network are filled")
321-
AddOption(nnClassificationPath, std::string, "network_class.onnx", "", 0, "The classification network path")
322-
AddOption(nnClassThreshold, float, 0.5, "", 0, "The cutoff at which clusters will be accepted / rejected.")
323-
AddOption(nnRegressionPath, std::string, "network_reg.onnx", "", 0, "The regression network path")
324-
AddOption(nnSigmoidTrafoClassThreshold, int, 1, "", 0, "If true (default), then the classification threshold is transformed by an inverse sigmoid function. This depends on how the network was trained (with a sigmoid as acitvation function in the last layer or not).")
329+
AddSubConfig(GPUSettingsProcessingNNclusterizer, nn)
325330
AddHelp("help", 'h')
326331
EndConfig()
327332
#endif // __OPENCL__

GPU/GPUTracking/GPUTrackingLinkDef_O2_DataTypes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#pragma link C++ class o2::gpu::GPUConfigurableParamGPUSettingsProcessing + ;
3131
#pragma link C++ class o2::gpu::GPUConfigurableParamGPUSettingsProcessingParam + ;
3232
#pragma link C++ class o2::gpu::GPUConfigurableParamGPUSettingsProcessingRTC + ;
33+
#pragma link C++ class o2::gpu::GPUConfigurableParamGPUSettingsProcessingNNclusterizer + ;
3334
#pragma link C++ class o2::gpu::GPUConfigurableParamGPUSettingsDisplay + ;
3435
#pragma link C++ class o2::gpu::GPUConfigurableParamGPUSettingsDisplayLight + ;
3536
#pragma link C++ class o2::gpu::GPUConfigurableParamGPUSettingsDisplayHeavy + ;

0 commit comments

Comments
 (0)