particleflow 3.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. particleflow-3.1.0/LICENSE +201 -0
  2. particleflow-3.1.0/MANIFEST.in +4 -0
  3. particleflow-3.1.0/PKG-INFO +220 -0
  4. particleflow-3.1.0/README.md +153 -0
  5. particleflow-3.1.0/habana/gaudi-pod-python-v19-1hpu.yaml +101 -0
  6. particleflow-3.1.0/habana/gaudi-pod-python-v19-2hpu.yaml +101 -0
  7. particleflow-3.1.0/habana/gaudi-pod-python-v19-3hpu.yaml +101 -0
  8. particleflow-3.1.0/habana/gaudi-pod-python-v19-4hpu.yaml +101 -0
  9. particleflow-3.1.0/habana/gaudi-pod-python-v19-5hpu.yaml +101 -0
  10. particleflow-3.1.0/habana/gaudi-pod-python-v19-6hpu.yaml +101 -0
  11. particleflow-3.1.0/habana/gaudi-pod-python-v19-7hpu.yaml +101 -0
  12. particleflow-3.1.0/habana/gaudi-pod-python-v19-8hpu.yaml +101 -0
  13. particleflow-3.1.0/mlpf/__init__.py +0 -0
  14. particleflow-3.1.0/mlpf/conf.py +720 -0
  15. particleflow-3.1.0/mlpf/customizations.py +45 -0
  16. particleflow-3.1.0/mlpf/data/__init__.py +0 -0
  17. particleflow-3.1.0/mlpf/data/cms/__init__.py +0 -0
  18. particleflow-3.1.0/mlpf/data/cms/plot_cms.py +359 -0
  19. particleflow-3.1.0/mlpf/data/cms/postprocessing2.py +1000 -0
  20. particleflow-3.1.0/mlpf/data/cms/prepare_args.py +48 -0
  21. particleflow-3.1.0/mlpf/data/cms/prepare_args_val.py +29 -0
  22. particleflow-3.1.0/mlpf/data/key4hep/__init__.py +0 -0
  23. particleflow-3.1.0/mlpf/data/key4hep/plot_postprocessing.py +380 -0
  24. particleflow-3.1.0/mlpf/data/key4hep/postprocessing.py +1480 -0
  25. particleflow-3.1.0/mlpf/heptfds/__init__.py +0 -0
  26. particleflow-3.1.0/mlpf/heptfds/cld_pf_edm4hep/__init__.py +0 -0
  27. particleflow-3.1.0/mlpf/heptfds/cld_pf_edm4hep/qq.py +84 -0
  28. particleflow-3.1.0/mlpf/heptfds/cld_pf_edm4hep/ttbar.py +86 -0
  29. particleflow-3.1.0/mlpf/heptfds/cld_pf_edm4hep/ww_fullhad.py +84 -0
  30. particleflow-3.1.0/mlpf/heptfds/cld_pf_edm4hep/zz.py +86 -0
  31. particleflow-3.1.0/mlpf/heptfds/cld_pf_edm4hep_hits/__init__.py +0 -0
  32. particleflow-3.1.0/mlpf/heptfds/cld_pf_edm4hep_hits/qq.py +80 -0
  33. particleflow-3.1.0/mlpf/heptfds/cld_pf_edm4hep_hits/ttbar.py +80 -0
  34. particleflow-3.1.0/mlpf/heptfds/cld_pf_edm4hep_hits/ww_fullhad.py +80 -0
  35. particleflow-3.1.0/mlpf/heptfds/cld_pf_edm4hep_hits/zz.py +80 -0
  36. particleflow-3.1.0/mlpf/heptfds/clic_pf_edm4hep/__init__.py +0 -0
  37. particleflow-3.1.0/mlpf/heptfds/clic_pf_edm4hep/qq.py +92 -0
  38. particleflow-3.1.0/mlpf/heptfds/clic_pf_edm4hep/ttbar.py +91 -0
  39. particleflow-3.1.0/mlpf/heptfds/clic_pf_edm4hep/ww_fullhad.py +87 -0
  40. particleflow-3.1.0/mlpf/heptfds/clic_pf_edm4hep_hits/__init__.py +0 -0
  41. particleflow-3.1.0/mlpf/heptfds/clic_pf_edm4hep_hits/qq.py +80 -0
  42. particleflow-3.1.0/mlpf/heptfds/clic_pf_edm4hep_hits/ttbar.py +80 -0
  43. particleflow-3.1.0/mlpf/heptfds/clic_pf_edm4hep_hits/ww_fullhad.py +80 -0
  44. particleflow-3.1.0/mlpf/heptfds/cms_pf/__init__.py +0 -0
  45. particleflow-3.1.0/mlpf/heptfds/cms_pf/cms_utils.py +281 -0
  46. particleflow-3.1.0/mlpf/heptfds/cms_pf/qcd.py +87 -0
  47. particleflow-3.1.0/mlpf/heptfds/cms_pf/qcd_nopu.py +80 -0
  48. particleflow-3.1.0/mlpf/heptfds/cms_pf/ttbar.py +91 -0
  49. particleflow-3.1.0/mlpf/heptfds/cms_pf/ttbar_nopu.py +82 -0
  50. particleflow-3.1.0/mlpf/heptfds/cms_pf/ztt.py +75 -0
  51. particleflow-3.1.0/mlpf/heptfds/cms_pf/ztt_nopu.py +75 -0
  52. particleflow-3.1.0/mlpf/heptfds/edm4hep_utils/__init__.py +0 -0
  53. particleflow-3.1.0/mlpf/heptfds/edm4hep_utils/utils_hits.py +144 -0
  54. particleflow-3.1.0/mlpf/heptfds/edm4hep_utils/utils_pf.py +201 -0
  55. particleflow-3.1.0/mlpf/jet_utils.py +133 -0
  56. particleflow-3.1.0/mlpf/logger.py +107 -0
  57. particleflow-3.1.0/mlpf/model/PFDataset.py +571 -0
  58. particleflow-3.1.0/mlpf/model/__init__.py +0 -0
  59. particleflow-3.1.0/mlpf/model/distributed_ray.py +377 -0
  60. particleflow-3.1.0/mlpf/model/gnn_lsh.py +320 -0
  61. particleflow-3.1.0/mlpf/model/inference.py +295 -0
  62. particleflow-3.1.0/mlpf/model/losses.py +222 -0
  63. particleflow-3.1.0/mlpf/model/mlpf.py +715 -0
  64. particleflow-3.1.0/mlpf/model/monitoring.py +118 -0
  65. particleflow-3.1.0/mlpf/model/plots.py +203 -0
  66. particleflow-3.1.0/mlpf/model/training.py +946 -0
  67. particleflow-3.1.0/mlpf/model/utils.py +220 -0
  68. particleflow-3.1.0/mlpf/optimizers/__init__.py +30 -0
  69. particleflow-3.1.0/mlpf/optimizers/lamb.py +207 -0
  70. particleflow-3.1.0/mlpf/pipeline.py +254 -0
  71. particleflow-3.1.0/mlpf/plotting/__init__.py +0 -0
  72. particleflow-3.1.0/mlpf/plotting/cms_fwlite.py +148 -0
  73. particleflow-3.1.0/mlpf/plotting/cmssw_validation_data.py +521 -0
  74. particleflow-3.1.0/mlpf/plotting/corrections.py +361 -0
  75. particleflow-3.1.0/mlpf/plotting/data_preparation.py +135 -0
  76. particleflow-3.1.0/mlpf/plotting/draw_graphs.py +154 -0
  77. particleflow-3.1.0/mlpf/plotting/plot_jet_response_comparison_v1.py +219 -0
  78. particleflow-3.1.0/mlpf/plotting/plot_jet_response_comparison_v2.py +270 -0
  79. particleflow-3.1.0/mlpf/plotting/plot_loss_curves.py +258 -0
  80. particleflow-3.1.0/mlpf/plotting/plot_met_validation.py +554 -0
  81. particleflow-3.1.0/mlpf/plotting/plot_utils.py +2168 -0
  82. particleflow-3.1.0/mlpf/plotting/plot_validation.py +1090 -0
  83. particleflow-3.1.0/mlpf/plotting/utils.py +177 -0
  84. particleflow-3.1.0/mlpf/raytune/__init__.py +0 -0
  85. particleflow-3.1.0/mlpf/raytune/search_space.py +38 -0
  86. particleflow-3.1.0/mlpf/raytune/utils.py +111 -0
  87. particleflow-3.1.0/mlpf/snakemake/produce_cms_validation_snakemake.py +322 -0
  88. particleflow-3.1.0/mlpf/snakemake/produce_snakemake.py +732 -0
  89. particleflow-3.1.0/mlpf/snakemake/produce_validation_snakemake.py +294 -0
  90. particleflow-3.1.0/mlpf/standalone/__init__.py +0 -0
  91. particleflow-3.1.0/mlpf/standalone/dsl.py +269 -0
  92. particleflow-3.1.0/mlpf/standalone/eval.py +415 -0
  93. particleflow-3.1.0/mlpf/standalone/plot_evolution.py +222 -0
  94. particleflow-3.1.0/mlpf/standalone/run_evolution.py +551 -0
  95. particleflow-3.1.0/mlpf/standalone/train.py +1220 -0
  96. particleflow-3.1.0/mlpf/standalone_eval/key4hep/evaluator.py +298 -0
  97. particleflow-3.1.0/mlpf/standalone_eval/key4hep/plots.py +262 -0
  98. particleflow-3.1.0/mlpf/timing.py +124 -0
  99. particleflow-3.1.0/mlpf/utils.py +164 -0
  100. particleflow-3.1.0/particleflow.egg-info/PKG-INFO +220 -0
  101. particleflow-3.1.0/particleflow.egg-info/SOURCES.txt +123 -0
  102. particleflow-3.1.0/particleflow.egg-info/dependency_links.txt +1 -0
  103. particleflow-3.1.0/particleflow.egg-info/entry_points.txt +2 -0
  104. particleflow-3.1.0/particleflow.egg-info/requires.txt +55 -0
  105. particleflow-3.1.0/particleflow.egg-info/top_level.txt +6 -0
  106. particleflow-3.1.0/particleflow_spec.yaml +755 -0
  107. particleflow-3.1.0/pyproject.toml +111 -0
  108. particleflow-3.1.0/setup.cfg +4 -0
  109. particleflow-3.1.0/tests/test_attention_stability.py +154 -0
  110. particleflow-3.1.0/tests/test_config_overrides.py +142 -0
  111. particleflow-3.1.0/tests/test_dataloader.py +214 -0
  112. particleflow-3.1.0/tests/test_distributed_sampler.py +189 -0
  113. particleflow-3.1.0/tests/test_dsl_interleaving.py +90 -0
  114. particleflow-3.1.0/tests/test_hept_utils.py +280 -0
  115. particleflow-3.1.0/tests/test_iterators.py +218 -0
  116. particleflow-3.1.0/tests/test_lr_schedule.py +79 -0
  117. particleflow-3.1.0/tests/test_mlpf_models.py +117 -0
  118. particleflow-3.1.0/tests/test_pfdataset_logic.py +113 -0
  119. particleflow-3.1.0/tests/test_pipeline_config.py +244 -0
  120. particleflow-3.1.0/tests/test_resumable_sampler.py +101 -0
  121. particleflow-3.1.0/tests/test_shard_consecutive_sampler.py +54 -0
  122. particleflow-3.1.0/tests/test_standalone_attention.py +483 -0
  123. particleflow-3.1.0/tests/test_utils.py +35 -0
  124. particleflow-3.1.0/validation_cms.yaml +60 -0
  125. particleflow-3.1.0/validation_key4hep.yaml +74 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,4 @@
1
+ include particleflow_spec.yaml
2
+ include validation_cms.yaml
3
+ include validation_key4hep.yaml
4
+ recursive-include mlpf *.py
@@ -0,0 +1,220 @@
1
+ Metadata-Version: 2.4
2
+ Name: particleflow
3
+ Version: 3.1.0
4
+ Summary: Machine Learning for Particle Flow Reconstruction
5
+ Author: Farouk Mokhtar, Eric Wulff, Javier Duarte
6
+ Author-email: Joosep Pata <joosep.pata@cern.ch>
7
+ License: Apache Software License
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Topic :: Scientific/Engineering :: Physics
12
+ Requires-Python: ==3.11.*
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: array-record~=0.8.3
16
+ Requires-Dist: autopep8
17
+ Requires-Dist: awkward
18
+ Requires-Dist: boost_histogram
19
+ Requires-Dist: click
20
+ Requires-Dist: comet-ml
21
+ Requires-Dist: fastjet
22
+ Requires-Dist: fsspec
23
+ Requires-Dist: jupyter
24
+ Requires-Dist: jupyter-book
25
+ Requires-Dist: keras
26
+ Requires-Dist: keras-tuner
27
+ Requires-Dist: matplotlib
28
+ Requires-Dist: mlcroissant
29
+ Requires-Dist: mplhep
30
+ Requires-Dist: networkx
31
+ Requires-Dist: notebook
32
+ Requires-Dist: numba
33
+ Requires-Dist: numpy
34
+ Requires-Dist: onnx
35
+ Requires-Dist: onnxruntime
36
+ Requires-Dist: onnxscript
37
+ Requires-Dist: pandas
38
+ Requires-Dist: papermill
39
+ Requires-Dist: plotly
40
+ Requires-Dist: pre-commit
41
+ Requires-Dist: protobuf~=5.28.3
42
+ Requires-Dist: pyarrow~=18.1.0; sys_platform == "linux"
43
+ Requires-Dist: pyarrow~=22.0.0; sys_platform == "darwin"
44
+ Requires-Dist: pydantic
45
+ Requires-Dist: pytest
46
+ Requires-Dist: ray[tune]
47
+ Requires-Dist: scikit-learn
48
+ Requires-Dist: scikit-optimize
49
+ Requires-Dist: scipy
50
+ Requires-Dist: seaborn
51
+ Requires-Dist: setGPU
52
+ Requires-Dist: snakemake
53
+ Requires-Dist: tensorboard
54
+ Requires-Dist: tensorflow~=2.20.0
55
+ Requires-Dist: tensorflow-datasets~=4.9.9
56
+ Requires-Dist: tensorflow-metadata~=1.17.3
57
+ Requires-Dist: torch
58
+ Requires-Dist: torch_runstats
59
+ Requires-Dist: tqdm
60
+ Requires-Dist: uproot
61
+ Requires-Dist: umap-learn
62
+ Requires-Dist: vector
63
+ Requires-Dist: zenodo_get
64
+ Requires-Dist: huggingface_hub
65
+ Requires-Dist: apache_beam~=2.71.0; sys_platform == "linux"
66
+ Dynamic: license-file
67
+
68
+ ### **Summary**
69
+
70
+ **ML-based particle flow (MLPF)** focuses on developing full event reconstruction for particle detectors using computationally scalable and flexible machine learning models. The project aims to improve particle flow reconstruction across various detector environments, including CMS, as well as future detectors via Key4HEP.
71
+ We build on existing, open-source simulation software by the experimental collaborations.
72
+
73
+ <p float="left">
74
+ <img src="images/diagram.svg" alt="High-level overview" width="800"/>
75
+ </p>
76
+
77
+ ---
78
+
79
+ ### **TLDR; I just want to run the code**
80
+ You can use `uv` to set up the repo and test that everything works:
81
+ ```
82
+ git clone --recurse-submodules https://github.com/jpata/particleflow.git
83
+ uv sync
84
+ uv run ./scripts/local_test_cld.sh
85
+ uv run ./scripts/local_test_cms.sh
86
+ ```
87
+
88
+ Alternatively, you can use a prepared container:
89
+ ```
90
+ apptainer exec --nv https://jpata.web.cern.ch/jpata/pytorch-20260305-08d6950.sif ./scripts/local_test_cld.sh
91
+ apptainer exec --nv https://jpata.web.cern.ch/jpata/pytorch-20260305-08d6950.sif ./scripts/local_test_cms.sh
92
+ ```
93
+
94
+
95
+
96
+ ### **Datasets**
97
+
98
+ If you wish to train on pre-made datasets, you can download them from the [Hugging Face Hub](https://huggingface.co/datasets/jpata/particleflow).
99
+ To download a specific dataset and split (e.g., CLD, PF setup, configuration split 1):
100
+ ```bash
101
+ uv run hf download jpata/particleflow \
102
+ --include "tensorflow_datasets/cld/cld_edm_*_pf/1/*" \
103
+ --local-dir data/tfds \
104
+ --repo-type dataset
105
+ ```
106
+ This will download the requested files into `data/tfds/tensorflow_datasets/cld/cld_edm_*_pf/1/`.
107
+
108
+ ### **Dataset Upload**
109
+
110
+ To upload a generated dataset to the Hugging Face Hub:
111
+ ```bash
112
+ uv run python3 scripts/upload_hf.py --repo jpata/particleflow --spec particleflow_spec.yaml clic 1
113
+ ```
114
+
115
+ ### **Training**
116
+
117
+ Run the training on the downloaded data configuration split
118
+ ```
119
+ uv run \
120
+ python mlpf/pipeline.py \
121
+ --spec-file particleflow_spec.yaml \
122
+ --production cld \
123
+ --model-name pyg-cld-v1 \
124
+ --data-dir data/tfds/tensorflow_datasets/cld \
125
+ train \
126
+ --data_config 1 \
127
+ --gpu_batch_multiplier 4 \
128
+ --gpus 1
129
+ ```
130
+
131
+ ### **Model Upload**
132
+
133
+ To upload a trained model to the Hugging Face Hub:
134
+ ```bash
135
+ uv run python3 scripts/upload_model_hf.py experiments/pyg-clic-hits-v1_clic_20260328_144021_479374 --version v3.1.0
136
+ ```
137
+
138
+ ### **Model Download & Evaluation**
139
+
140
+ To download a specific model (e.g., CLD, cluster-based, version v3.1.0) and run evaluation on a sample ROOT file:
141
+
142
+ 1. Download the model files from the Hugging Face Hub:
143
+ ```bash
144
+ uv run hf download jpata/particleflow \
145
+ --include "cld/clusters/v3.1.0/pyg-cld-v1_cld_20260328_101206_533260/*" \
146
+ --local-dir models \
147
+ --repo-type model
148
+ ```
149
+
150
+ 2. Run the evaluation script:
151
+ ```bash
152
+
153
+ mkdir -p local_test_data/cld/p8_ee_ttbar_ecm365/root
154
+ cd local_test_data/cld/p8_ee_ttbar_ecm365/root
155
+ wget -q --no-check-certificate -nc https://jpata.web.cern.ch/jpata/mlpf/cld/v1.2.3_key4hep_2025-05-29_CLD_f1e8f9/gen/root/reco_p8_ee_ttbar_ecm365_300000.root
156
+ cd ../../..
157
+
158
+ uv run python3 mlpf/standalone_eval/key4hep/evaluator.py \
159
+ --input local_test_data/cld/p8_ee_ttbar_ecm365/root/reco_p8_ee_ttbar_ecm365_300000.root \
160
+ --checkpoint models/cld/clusters/v3.1.0/pyg-cld-v1_cld_20260328_101206_533260/checkpoints/best_weights.pth \
161
+ --detector cld \
162
+ --outpath eval_results.parquet
163
+ ```
164
+ The input ROOT file should be in the [EDM4hep format](https://github.com/key4hep/EDM4hep).
165
+
166
+ ## **End-to-end workflow: dataset generation and model training**
167
+
168
+ The full data generation, model training, and validation workflow are managed using [Pixi](https://pixi.sh/) for environment and [Snakemake](https://snakemake.readthedocs.io/) for job orchestration. Apptainer images are used to provide the software for the steps for different detetors.
169
+
170
+ ```bash
171
+ #ensure all gen configs are downloaded
172
+ git submodule update --init --recursive
173
+
174
+ # install pixi, restart your shell or source your .bashrc after this. only do once.
175
+ curl -fsSL https://pixi.sh/install.sh | bash
176
+
177
+ # copy the configuration for your site. only do once.
178
+ ln -s configs/{local,tallinn,lxplus}/pixi.toml pixi.toml
179
+
180
+ # initalize the orhcestrator python environment. only do this once.
181
+ pixi run init
182
+
183
+ # generate the snakefile (will overwrite the defaults)
184
+ PROD={cms_run3,clic,cld} pixi run snakefile
185
+
186
+ # run the steps (this will take many days and thousands of jobs), so run inside screen or tmux
187
+ PROD={cms_run3,clic,cld} pixi run gen
188
+ PROD={cms_run3,clic,cld} pixi run post
189
+ PROD={cms_run3,clic,cld} pixi run tfds
190
+ PROD={cms_run3,clic,cld} pixi run train
191
+ ```
192
+
193
+ ---
194
+
195
+ ### **Publications**
196
+
197
+ The following publications trace the development of MLPF from early proofs of concept to full detector simulations and fine-tuning studies across detectors.
198
+
199
+ * [2021] First full-event GNN demonstration of MLPF: [Paper](https://doi.org/10.1140/epjc/s10052-021-09158-w) [Code](https://zenodo.org/records/4559587) [Dataset](https://doi.org/10.5281/zenodo.4559324)
200
+ * [2021] First demonstration in CMS Run 3: [Paper](http://dx.doi.org/10.1088/1742-6596/2438/1/012100) [CMS-DP](https://cds.cern.ch/record/2792320)
201
+ * [2022] Improved performance in CMS Run 3: [CMS-DP](http://cds.cern.ch/record/2842375)
202
+ * [2024] Improved performance with full simulation for future colliders: [Paper](https://doi.org/10.1038/s42005-024-01599-5) [Code](https://zenodo.org/records/10928968) [Results](https://doi.org/10.5281/zenodo.10567397)
203
+ * [2025] Fine-tuning across detectors: [Paper](https://doi.org/10.1103/PhysRevD.111.092015) [Code](https://zenodo.org/records/14930299)
204
+ * [2026] CMS Run 3 full results: [Paper](https://arxiv.org/abs/2601.17554) [CMS-DP](https://cds.cern.ch/record/2937578) [Code](https://zenodo.org/records/15573658)
205
+
206
+ ---
207
+
208
+ ### **Citations and Reuse**
209
+
210
+ You are welcome to reuse the code in accordance with the [LICENSE](https://github.com/jpata/particleflow/blob/main/LICENSE).
211
+
212
+ **How to Cite**
213
+
214
+ 1. **Academic Work:** Please cite the specific papers listed in the **Publications** section above relevant to the method you are using (e.g., initial GNN idea, fine-tuning, or specific detector studies).
215
+ 2. **Code Usage:** If you use the code significantly for research, please cite the specific [tagged version from Zenodo](https://zenodo.org/search?q=parent.id%3A4452541&f=allversions%3Atrue&l=list&p=1&s=10&sort=version).
216
+ 3. **Dataset Usage:** Cite the [appropriate dataset](https://zenodo.org/search?q=mlpf&f=allversions%3Atrue&f=resource_type%3Adataset&l=list&p=1&s=10&sort=version) via the Zenodo link and the corresponding paper.
217
+
218
+ **Contact**
219
+
220
+ For collaboration ideas that do not fit into the categories above, please [get in touch via GitHub Discussions](https://github.com/jpata/particleflow/discussions/categories/general).
@@ -0,0 +1,153 @@
1
+ ### **Summary**
2
+
3
+ **ML-based particle flow (MLPF)** focuses on developing full event reconstruction for particle detectors using computationally scalable and flexible machine learning models. The project aims to improve particle flow reconstruction across various detector environments, including CMS, as well as future detectors via Key4HEP.
4
+ We build on existing, open-source simulation software by the experimental collaborations.
5
+
6
+ <p float="left">
7
+ <img src="images/diagram.svg" alt="High-level overview" width="800"/>
8
+ </p>
9
+
10
+ ---
11
+
12
+ ### **TLDR; I just want to run the code**
13
+ You can use `uv` to set up the repo and test that everything works:
14
+ ```
15
+ git clone --recurse-submodules https://github.com/jpata/particleflow.git
16
+ uv sync
17
+ uv run ./scripts/local_test_cld.sh
18
+ uv run ./scripts/local_test_cms.sh
19
+ ```
20
+
21
+ Alternatively, you can use a prepared container:
22
+ ```
23
+ apptainer exec --nv https://jpata.web.cern.ch/jpata/pytorch-20260305-08d6950.sif ./scripts/local_test_cld.sh
24
+ apptainer exec --nv https://jpata.web.cern.ch/jpata/pytorch-20260305-08d6950.sif ./scripts/local_test_cms.sh
25
+ ```
26
+
27
+
28
+
29
+ ### **Datasets**
30
+
31
+ If you wish to train on pre-made datasets, you can download them from the [Hugging Face Hub](https://huggingface.co/datasets/jpata/particleflow).
32
+ To download a specific dataset and split (e.g., CLD, PF setup, configuration split 1):
33
+ ```bash
34
+ uv run hf download jpata/particleflow \
35
+ --include "tensorflow_datasets/cld/cld_edm_*_pf/1/*" \
36
+ --local-dir data/tfds \
37
+ --repo-type dataset
38
+ ```
39
+ This will download the requested files into `data/tfds/tensorflow_datasets/cld/cld_edm_*_pf/1/`.
40
+
41
+ ### **Dataset Upload**
42
+
43
+ To upload a generated dataset to the Hugging Face Hub:
44
+ ```bash
45
+ uv run python3 scripts/upload_hf.py --repo jpata/particleflow --spec particleflow_spec.yaml clic 1
46
+ ```
47
+
48
+ ### **Training**
49
+
50
+ Run the training on the downloaded data configuration split
51
+ ```
52
+ uv run \
53
+ python mlpf/pipeline.py \
54
+ --spec-file particleflow_spec.yaml \
55
+ --production cld \
56
+ --model-name pyg-cld-v1 \
57
+ --data-dir data/tfds/tensorflow_datasets/cld \
58
+ train \
59
+ --data_config 1 \
60
+ --gpu_batch_multiplier 4 \
61
+ --gpus 1
62
+ ```
63
+
64
+ ### **Model Upload**
65
+
66
+ To upload a trained model to the Hugging Face Hub:
67
+ ```bash
68
+ uv run python3 scripts/upload_model_hf.py experiments/pyg-clic-hits-v1_clic_20260328_144021_479374 --version v3.1.0
69
+ ```
70
+
71
+ ### **Model Download & Evaluation**
72
+
73
+ To download a specific model (e.g., CLD, cluster-based, version v3.1.0) and run evaluation on a sample ROOT file:
74
+
75
+ 1. Download the model files from the Hugging Face Hub:
76
+ ```bash
77
+ uv run hf download jpata/particleflow \
78
+ --include "cld/clusters/v3.1.0/pyg-cld-v1_cld_20260328_101206_533260/*" \
79
+ --local-dir models \
80
+ --repo-type model
81
+ ```
82
+
83
+ 2. Run the evaluation script:
84
+ ```bash
85
+
86
+ mkdir -p local_test_data/cld/p8_ee_ttbar_ecm365/root
87
+ cd local_test_data/cld/p8_ee_ttbar_ecm365/root
88
+ wget -q --no-check-certificate -nc https://jpata.web.cern.ch/jpata/mlpf/cld/v1.2.3_key4hep_2025-05-29_CLD_f1e8f9/gen/root/reco_p8_ee_ttbar_ecm365_300000.root
89
+ cd ../../..
90
+
91
+ uv run python3 mlpf/standalone_eval/key4hep/evaluator.py \
92
+ --input local_test_data/cld/p8_ee_ttbar_ecm365/root/reco_p8_ee_ttbar_ecm365_300000.root \
93
+ --checkpoint models/cld/clusters/v3.1.0/pyg-cld-v1_cld_20260328_101206_533260/checkpoints/best_weights.pth \
94
+ --detector cld \
95
+ --outpath eval_results.parquet
96
+ ```
97
+ The input ROOT file should be in the [EDM4hep format](https://github.com/key4hep/EDM4hep).
98
+
99
+ ## **End-to-end workflow: dataset generation and model training**
100
+
101
+ The full data generation, model training, and validation workflow are managed using [Pixi](https://pixi.sh/) for environment and [Snakemake](https://snakemake.readthedocs.io/) for job orchestration. Apptainer images are used to provide the software for the steps for different detetors.
102
+
103
+ ```bash
104
+ #ensure all gen configs are downloaded
105
+ git submodule update --init --recursive
106
+
107
+ # install pixi, restart your shell or source your .bashrc after this. only do once.
108
+ curl -fsSL https://pixi.sh/install.sh | bash
109
+
110
+ # copy the configuration for your site. only do once.
111
+ ln -s configs/{local,tallinn,lxplus}/pixi.toml pixi.toml
112
+
113
+ # initalize the orhcestrator python environment. only do this once.
114
+ pixi run init
115
+
116
+ # generate the snakefile (will overwrite the defaults)
117
+ PROD={cms_run3,clic,cld} pixi run snakefile
118
+
119
+ # run the steps (this will take many days and thousands of jobs), so run inside screen or tmux
120
+ PROD={cms_run3,clic,cld} pixi run gen
121
+ PROD={cms_run3,clic,cld} pixi run post
122
+ PROD={cms_run3,clic,cld} pixi run tfds
123
+ PROD={cms_run3,clic,cld} pixi run train
124
+ ```
125
+
126
+ ---
127
+
128
+ ### **Publications**
129
+
130
+ The following publications trace the development of MLPF from early proofs of concept to full detector simulations and fine-tuning studies across detectors.
131
+
132
+ * [2021] First full-event GNN demonstration of MLPF: [Paper](https://doi.org/10.1140/epjc/s10052-021-09158-w) [Code](https://zenodo.org/records/4559587) [Dataset](https://doi.org/10.5281/zenodo.4559324)
133
+ * [2021] First demonstration in CMS Run 3: [Paper](http://dx.doi.org/10.1088/1742-6596/2438/1/012100) [CMS-DP](https://cds.cern.ch/record/2792320)
134
+ * [2022] Improved performance in CMS Run 3: [CMS-DP](http://cds.cern.ch/record/2842375)
135
+ * [2024] Improved performance with full simulation for future colliders: [Paper](https://doi.org/10.1038/s42005-024-01599-5) [Code](https://zenodo.org/records/10928968) [Results](https://doi.org/10.5281/zenodo.10567397)
136
+ * [2025] Fine-tuning across detectors: [Paper](https://doi.org/10.1103/PhysRevD.111.092015) [Code](https://zenodo.org/records/14930299)
137
+ * [2026] CMS Run 3 full results: [Paper](https://arxiv.org/abs/2601.17554) [CMS-DP](https://cds.cern.ch/record/2937578) [Code](https://zenodo.org/records/15573658)
138
+
139
+ ---
140
+
141
+ ### **Citations and Reuse**
142
+
143
+ You are welcome to reuse the code in accordance with the [LICENSE](https://github.com/jpata/particleflow/blob/main/LICENSE).
144
+
145
+ **How to Cite**
146
+
147
+ 1. **Academic Work:** Please cite the specific papers listed in the **Publications** section above relevant to the method you are using (e.g., initial GNN idea, fine-tuning, or specific detector studies).
148
+ 2. **Code Usage:** If you use the code significantly for research, please cite the specific [tagged version from Zenodo](https://zenodo.org/search?q=parent.id%3A4452541&f=allversions%3Atrue&l=list&p=1&s=10&sort=version).
149
+ 3. **Dataset Usage:** Cite the [appropriate dataset](https://zenodo.org/search?q=mlpf&f=allversions%3Atrue&f=resource_type%3Adataset&l=list&p=1&s=10&sort=version) via the Zenodo link and the corresponding paper.
150
+
151
+ **Contact**
152
+
153
+ For collaboration ideas that do not fit into the categories above, please [get in touch via GitHub Discussions](https://github.com/jpata/particleflow/discussions/categories/general).
@@ -0,0 +1,101 @@
1
+ apiVersion: batch/v1
2
+ kind: Job
3
+ metadata:
4
+ name: mlpf-hpu-strategy-v19-1hpu-hvd-constbatch-bm2
5
+ spec:
6
+ completions: 1
7
+ parallelism: 1
8
+ backoffLimit: 0
9
+ template:
10
+ spec:
11
+ restartPolicy: Never
12
+ serviceAccountName: jduarte
13
+ nodeSelector:
14
+ brightcomputing.com/node-category: "gaudi"
15
+ hostNetwork: false
16
+ volumes:
17
+ - name: home
18
+ hostPath:
19
+ path: /home/jduarte
20
+ type: Directory
21
+ - name: ceph
22
+ hostPath:
23
+ path: /voyager/ceph/users/jduarte
24
+ type: Directory
25
+ - name: scratch
26
+ emptyDir: {}
27
+ imagePullSecrets:
28
+ - name: registry-credentials
29
+ containers:
30
+ - name: htf2110-190-580-20230327-ubuntu2004
31
+ image: jmduarte/particleflow:habana_v19
32
+ imagePullPolicy: Always
33
+ resources:
34
+ requests:
35
+ cpu: 48
36
+ memory: 384Gi
37
+ habana.ai/gaudi: 8
38
+ hugepages-2Mi: 96000Mi
39
+ ephemeral-storage: 256Gi
40
+ limits:
41
+ cpu: 96
42
+ memory: 396Gi
43
+ habana.ai/gaudi: 8
44
+ hugepages-2Mi: 96000Mi
45
+ ephemeral-storage: 512Gi
46
+ volumeMounts:
47
+ - name: home
48
+ mountPath: /home/jduarte
49
+ - name: ceph
50
+ mountPath: /voyager/ceph/users/jduarte
51
+ - name: scratch
52
+ mountPath: /scratch
53
+ env:
54
+ - name: POD_NAME_ID
55
+ valueFrom:
56
+ fieldRef:
57
+ fieldPath: metadata.name
58
+ - name: POD_NODE_HOSTNAME
59
+ valueFrom:
60
+ fieldRef:
61
+ fieldPath: spec.nodeName
62
+ - name: HOME
63
+ value: "/home/jduarte"
64
+ - name: CEPH
65
+ value: "/voyager/ceph/users/jduarte"
66
+ - name: LOCAL_SCRATCH_DIR
67
+ value: "/scratch"
68
+ - name: MPI_ROOT
69
+ value: "/opt/amazon/openmpi"
70
+ - name: TFDS_DATA_DIR
71
+ value: "/voyager/ceph/users/jduarte/tensorflow_datasets"
72
+ workingDir: /home/jduarte/particleflow
73
+ command: ["/bin/bash", "-c"]
74
+ args:
75
+ - >-
76
+ declare -xr LOCAL_TIME="$(date +'%Y%m%dT%H%M%S%z')";
77
+ declare -xir UNIX_TIME="$(date +'%s')";
78
+
79
+ declare -xr VGR_POD_ID="${POD_NAME_ID}.$(date +'%s').${RANDOM}.${POD_NODE_HOSTNAME}";
80
+
81
+ declare -xr K8S_JOB_YAML_FILE="${PWD}/gaudi-pod-python-v19.yaml";
82
+ declare -xr K8S_JOB_YAML_MD5SUM="$(md5sum ${K8S_JOB_YAML_FILE})";
83
+
84
+ echo "${UNIX_TIME} ${VGR_POD_ID} ${K8S_JOB_YAML_MD5SUM}";
85
+ echo "";
86
+
87
+ cat "${K8S_JOB_YAML_FILE}";
88
+
89
+ printenv;
90
+
91
+ cat /etc/os-release;
92
+ lscpu;
93
+ free -h;
94
+ cat /proc/meminfo;
95
+ lsblk --output-all;
96
+ cat /etc/fstab;
97
+ lspci -vvv;
98
+ hl-smi;
99
+ hl-smi -q;
100
+
101
+ time -p mpirun -n 1 --allow-run-as-root --prefix "${MPI_ROOT}" -x "${VGR_POD_ID}" python3 -u mlpf/pipeline.py train -g -m -c parameters/clic-test.yaml --plot-freq 0 --batch-multiplier 2 --ntrain 50000 --ntest 50000 --nepochs 11 --benchmark_dir exp_dir;