@@ -9,9 +9,13 @@ PARTICLES = ['muon', 'pion', 'kaon', 'proton']
99ITEMS = ['model.keras' , 'tX.pkl' , 'tY.pkl' ]
1010
1111
12- rule build_container :
12+ rule validate_all :
13+ input : smkstore (expand ("validate-{particle}.html" , particle = PARTICLES ), 's3reports' )
14+
15+
16+ rule build_apptainer_image :
1317 input :
14- definition_file = "workflow/envs/pidgan.def"
18+ definition_file = ancient ( "workflow/envs/pidgan.def" )
1519
1620 output :
1721 sif = smkstore ("lhcb-pidsim.sif" , 's3images' )
@@ -38,7 +42,7 @@ rule build_container:
3842
3943
4044rule cache_container :
41- input : ancient ( smkstore ("lhcb-pidsim.sif" , 's3images' ) )
45+ input : smkstore ("lhcb-pidsim.sif" , 's3images' )
4246 output : config ['apptainer_cached_image' ]
4347 shell : "cp {input} {output}"
4448
@@ -59,7 +63,7 @@ rule preprocessing:
5963 report = report (
6064 smkstore ("{model}-{particle}-preprocessing.html" , 's3reports' ),
6165 category = "Preprocessing" ,
62- labels = dict (model = "{model}" , particle = "{particle}" )
66+ labels = dict (model = "{model}" , particle = "{particle}" , type = 'html' )
6367 )
6468
6569 log : smkstore ("{model}-{particle}-preprocessing.html" , 's3reports' )
@@ -120,16 +124,16 @@ rule train:
120124 history_csv = report (
121125 smkstore ("history/generator-{model}-{particle}.csv" , 's3reports' ),
122126 category = "Training" ,
123- labels = dict (model = "{model}" , particle = "{particle}" )
127+ labels = dict (model = "{model}" , particle = "{particle}" , type = 'csv' )
124128 ),
125129
126130 output_validation_set = smkstore ("ready2validate/{model}-{particle}.npz" , 's3reports' ),
127131 output_model = smkstore ("{model}/{particle}/model.keras" , "s3models" ),
128132
129133 report = report (
130134 smkstore ("{model}-{particle}-train.html" , 's3reports' ),
131- category = "Preprocessing " ,
132- labels = dict (model = "{model}" , particle = "{particle}" )
135+ category = "Training " ,
136+ labels = dict (model = "{model}" , particle = "{particle}" , type = 'html' )
133137 )
134138
135139 log : smkstore ("{model}-{particle}-train.html" , 's3reports' )
@@ -138,8 +142,8 @@ rule train:
138142
139143
140144 resources :
141- cpu = 8 ,
142- mem_mb = 32000 ,
145+ cpu = 4 ,
146+ mem_mb = 15000 ,
143147 gpu = 1
144148
145149 params :
@@ -193,12 +197,12 @@ rule deploy:
193197
194198 output :
195199 hook = touch ("/tmp/deploy.touch" ),
196- generated_c_file = "/tmp/compiled_pid_model .c" ,
200+ generated_c_file = "/tmp/compiled_model .c" ,
197201 generated_library = smkstore ("pid_compiled_model/generated.so" , 's3models' ),
198202 report = report (
199203 smkstore ("deploy.html" , 's3reports' ),
200204 category = "Deploy" ,
201- labels = dict (model = "ALL" , particle = "ALL" )
205+ labels = dict (model = "ALL" , particle = "ALL" , type = 'html' )
202206 )
203207
204208 params :
@@ -243,8 +247,8 @@ rule validate:
243247
244248 report = report (
245249 smkstore ("validate-{particle}.html" , 's3reports' ),
246- category = "Preprocessing " ,
247- labels = dict (model = "ALL" , particle = "{particle}" )
250+ category = "Validation " ,
251+ labels = dict (model = "ALL" , particle = "{particle}" , type = "html" )
248252 )
249253
250254 log : smkstore ("validate-{particle}.html" , 's3reports' )
@@ -259,15 +263,15 @@ rule validate:
259263 max_entries = config ['entries_for_validation' ],
260264
261265 resources :
262- cpu = 8 ,
263- mem_mb = 32000 ,
266+ cpu = 4 ,
267+ mem_mb = 15000 ,
264268 gpu = 0
265269
266270 shell :
267271 """
268272 INPUT_FILES='{params.data_files}' \
269273 PARTICLE='{wildcards.particle}' \
270- GENERATED_LIBRARY ='{input.generated_library}' \
274+ SHARED_OBJECT ='{input.generated_library}' \
271275 MAX_ENTRIES='{params.max_entries}' \
272276 SAMPLE='{params.sample}' \
273277 jupyter nbconvert --to html --execute \
@@ -278,7 +282,5 @@ rule validate:
278282 {input.notebook} --output {log}
279283 """
280284
281- rule validate_all :
282- input : smkstore (expand ("validate-{particle}.html" , particle = PARTICLES ), 's3reports' )
283285
284286
0 commit comments