Skip to content

Commit 3d3ba30

Browse files
author
Mun Jung Jung
committed
Merge branch 'feature/munjung-dnnsp_workflow_fcls' of https://github.com/SBNSoftware/sbndcode into feature/munjung-dnnsp_workflow_fcls
pull version with nate's gpu knob
2 parents 7f89b3e + 4b3ca84 commit 3d3ba30

9 files changed

Lines changed: 55 additions & 17 deletions

sbndcode/JobConfigurations/dnnroi/standard_detsim_sbnd_bothrois.fcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
#include "standard_detsim_sbnd.fcl"
88

9-
physics.producers.simtpc2d: @local::sbnd_wcls_simsp_bothrois
9+
physics.producers.simtpc2d: @local::sbnd_wcls_simsp_bothrois
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# File: standard_detsim_sbnd_bothrois.fcl
2+
# Authors: Mun Jung Jung (munjung@uchicago.edu)
3+
4+
# runs WC 2D signal processing during detsim using both traditional and DNN-based ROI finding
5+
# create three Wire products: simtpc2d:gauss, simtpc2d:wiener (from traditional), simtpc2d:dnnsp (from DNN)
6+
7+
#include "standard_detsim_sbnd.fcl"
8+
9+
physics.producers.simtpc2d: @local::sbnd_wcls_simsp_bothrois
10+
physics.producers.simtpc2d.wcls_main.params.wc_device: "gpu"
11+
physics.producers.simtpc2d.wcls_main.plugins: [@sequence::sbnd_wcls_simsp_dnnroi.wcls_main.plugins, "WireCellCuda"]

sbndcode/JobConfigurations/dnnroi/standard_detsim_sbnd_dnnroi.fcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
#include "standard_detsim_sbnd.fcl"
99

10-
physics.producers.simtpc2d: @local::sbnd_wcls_simsp_dnnroi
10+
physics.producers.simtpc2d: @local::sbnd_wcls_simsp_dnnroi
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# File: standard_detsim_sbnd_dnnroi.fcl
2+
# Authors: Mun Jung Jung (munjung@uchicago.edu)
3+
4+
# runs WC 2D signal processing during detsim using only DNN-based ROI finding
5+
# create one Wire product: simtpc2d:dnnsp
6+
7+
8+
#include "standard_detsim_sbnd.fcl"
9+
10+
physics.producers.simtpc2d: @local::sbnd_wcls_simsp_dnnroi
11+
physics.producers.simtpc2d.wcls_main.params.wc_device: "gpu"
12+
physics.producers.simtpc2d.wcls_main.plugins: [@sequence::sbnd_wcls_simsp_dnnroi.wcls_main.plugins, "WireCellCuda"]

sbndcode/WireCell/cfg/pgrapher/experiment/sbnd/wcls-nf-sp-data.jsonnet

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
//local epoch = std.extVar('epoch'); // eg "dynamic", "after", "before", "perfect"
2424
local sigoutform = std.extVar('signal_output_form'); // eg "sparse" or "dense"
25+
local wc_device = std.extVar('wc_device');
2526
local raw_input_label = std.extVar('raw_input_label'); // eg "daq"
2627
local use_paramresp = std.extVar('use_paramresp'); // eg "true" or "false"
2728
local roi = std.extVar('roi');
@@ -49,9 +50,9 @@ local params = data_params {
4950
},
5051
};
5152

52-
53-
local tools = tools_maker(params);
54-
53+
local default_tools = tools_maker(params);
54+
local tools = if wc_device == 'gpu' then std.mergePatch(default_tools,
55+
{dft: {type: "TorchDFT", data: {device: wc_device}}}) else default_tools;
5556

5657
local mega_anode = {
5758
type: 'MegaAnodePlane',
@@ -217,7 +218,7 @@ local ts_p0 = {
217218
tick_per_slice: tick_per_slice,
218219
data: {
219220
model: dnnroi_model_p0,
220-
device: "cpu",
221+
device: wc_device,
221222
concurrency: 1,
222223
},
223224
};
@@ -228,7 +229,7 @@ local ts_p1 = {
228229
tick_per_slice: tick_per_slice,
229230
data: {
230231
model: dnnroi_model_p1,
231-
device: "cpu",
232+
device: wc_device,
232233
concurrency: 1,
233234
},
234235
};

sbndcode/WireCell/cfg/pgrapher/experiment/sbnd/wcls-nf-sp.jsonnet

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222

2323
local epoch = std.extVar('epoch'); // eg "dynamic", "after", "before", "perfect"
24+
local wc_device = std.extVar('wc_device');
2425
local sigoutform = std.extVar('signal_output_form'); // eg "sparse" or "dense"
2526
local raw_input_label = std.extVar('raw_input_label'); // eg "daq"
2627
local use_dnnroi = std.extVar('use_dnnroi');
@@ -32,12 +33,15 @@ local dnnroi_model_p1 = std.extVar('dnnroi_model_p1');
3233
local g = import 'pgraph.jsonnet';
3334
local f = import 'pgrapher/experiment/sbnd/funcs.jsonnet';
3435
local wc = import 'wirecell.jsonnet';
35-
local tools_maker = import 'pgrapher/common/tools.jsonnet';
36+
local tools_maker = import 'pgrapher/common/tools.jsonnet';'
3637
3738
local simu_params = import 'simparams.jsonnet';
3839
local params = simu_params;
3940
40-
local tools = tools_maker(params);
41+
local default_tools = tools_maker(params);
42+
local tools = if wc_device == 'gpu' then std.mergePatch(default_tools,
43+
{dft: {type: "TorchDFT", data: {device: wc_device}}}) else default_tools;
44+
4145
4246
local mega_anode = {
4347
type: 'MegaAnodePlane',
@@ -180,7 +184,7 @@ local ts_p0 = {
180184
tick_per_slice: tick_per_slice,
181185
data: {
182186
model: dnnroi_model_p0,
183-
device: "cpu",
187+
device: wc_device,
184188
concurrency: 1,
185189
},
186190
};
@@ -191,7 +195,7 @@ local ts_p1 = {
191195
tick_per_slice: tick_per_slice,
192196
data: {
193197
model: dnnroi_model_p1,
194-
device: "cpu",
198+
device: wc_device,
195199
concurrency: 1,
196200
},
197201
};

sbndcode/WireCell/cfg/pgrapher/experiment/sbnd/wcls-sim-drift-depoflux-nf-sp.jsonnet

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ local dnnroi_model_p1 = std.extVar('dnnroi_model_p1');
1414
local g = import 'pgraph.jsonnet';
1515
local f = import 'pgrapher/common/funcs.jsonnet';
1616
local wc = import 'wirecell.jsonnet';
17+
local wc_device = std.extVar('wc_device');
1718
local io = import 'pgrapher/common/fileio.jsonnet';
1819
local tools_maker = import 'pgrapher/common/tools.jsonnet';
1920

@@ -39,7 +40,9 @@ local params = base {
3940
}
4041
};
4142

42-
local tools = tools_maker(params);
43+
local default_tools = tools_maker(params);
44+
local tools = if wc_device == 'gpu' then std.mergePatch(default_tools,
45+
{dft: {type: "TorchDFT", data: {device: wc_device}}}) else default_tools;
4346
local sim_maker = import 'pgrapher/experiment/sbnd/sim.jsonnet';
4447
local sim = sim_maker(params, tools);
4548
local nanodes = std.length(tools.anodes);
@@ -317,7 +320,7 @@ local ts_p0 = {
317320
tick_per_slice: tick_per_slice,
318321
data: {
319322
model: dnnroi_model_p0,
320-
device: "cpu",
323+
device: wc_device,
321324
concurrency: 1,
322325
},
323326
};
@@ -328,7 +331,7 @@ local ts_p1 = {
328331
tick_per_slice: tick_per_slice,
329332
data: {
330333
model: dnnroi_model_p1,
331-
device: "cpu",
334+
device: wc_device,
332335
concurrency: 1,
333336
},
334337
};

sbndcode/WireCell/wcsimsp_sbnd.fcl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ sbnd_wcls_simsp.wcls_main.params: {
4343

4444
## Set "data" vs. "sim". The epoch below probably should follow suit.
4545
reality: "sim"
46-
46+
47+
## if using dnnroi, use this device
48+
wc_device: "cpu"
49+
4750
## if epoch is "dynamic" you MUST add
4851
## "wclsMultiChannelNoiseDB" to "inputers" and must NOT
4952
## add it if not "dynamic"
@@ -116,6 +119,9 @@ sbnd_wcls_sp.wcls_main.params : {
116119
# This locates the input raw::RawDigit collection in the art::Event
117120
raw_input_label: "daq"
118121

122+
# if dnnroi is used, this device will be used
123+
wc_device: "cpu"
124+
119125
# Set "data" vs. "sim". The epoch below probably should follow suit.
120126
reality: "sim"
121127

@@ -154,7 +160,6 @@ sbnd_wcls_samples_rec.wcls_main.params: {
154160

155161
## Set "data" vs. "sim". The epoch below probably should follow suit.
156162
reality: "sim"
157-
158163
## if epoch is "dynamic" you MUST add
159164
## "wclsMultiChannelNoiseDB" to "inputers" and must NOT
160165
## add it if not "dynamic"
@@ -197,7 +202,7 @@ sbnd_wcls_samples_tru.wcls_main.params: {
197202

198203
## Set "data" vs. "sim". The epoch below probably should follow suit.
199204
reality: "sim"
200-
205+
201206
## if epoch is "dynamic" you MUST add
202207
## "wclsMultiChannelNoiseDB" to "inputers" and must NOT
203208
## add it if not "dynamic"

sbndcode/WireCell/wcsp_data_sbnd.fcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ sbnd_wcls_sp_data.wcls_main.outputers: ["wclsFrameSaver:spsaver"]
4141
sbnd_wcls_sp_data.wcls_main.params : {
4242
# This locates the input raw::RawDigit collection in the art::Event
4343
raw_input_label: "daq"
44+
# if dnnroi is used, this device will be used
45+
wc_device: "cpu"
4446

4547
# if epoch is "dynamic" you MUST add
4648
# "wclsMultiChannelNoiseDB" to "inputers" and must NOT

0 commit comments

Comments
 (0)