particle-imaging-models 0.6.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 (426) hide show
  1. particle_imaging_models-0.6.0/.dockerignore +9 -0
  2. particle_imaging_models-0.6.0/.github/docker/Dockerfile +39 -0
  3. particle_imaging_models-0.6.0/.github/docker/Dockerfile.nersc +64 -0
  4. particle_imaging_models-0.6.0/.github/docker/common/install_system.sh +12 -0
  5. particle_imaging_models-0.6.0/.github/docker/entrypoint.sh +32 -0
  6. particle_imaging_models-0.6.0/.github/docker/pimm +9 -0
  7. particle_imaging_models-0.6.0/.github/release.yml +23 -0
  8. particle_imaging_models-0.6.0/.github/scripts/modal_ci.py +277 -0
  9. particle_imaging_models-0.6.0/.github/workflows/docker.yml +383 -0
  10. particle_imaging_models-0.6.0/.github/workflows/docs.yml +110 -0
  11. particle_imaging_models-0.6.0/.github/workflows/release.yml +310 -0
  12. particle_imaging_models-0.6.0/.github/workflows/test-gpu.yml +54 -0
  13. particle_imaging_models-0.6.0/.gitignore +58 -0
  14. particle_imaging_models-0.6.0/.python-version +1 -0
  15. particle_imaging_models-0.6.0/LICENSE +21 -0
  16. particle_imaging_models-0.6.0/PKG-INFO +247 -0
  17. particle_imaging_models-0.6.0/README.md +200 -0
  18. particle_imaging_models-0.6.0/RELEASING.md +26 -0
  19. particle_imaging_models-0.6.0/assets/logo.svg +1 -0
  20. particle_imaging_models-0.6.0/configs/_base_/dataset/scannetpp.py +104 -0
  21. particle_imaging_models-0.6.0/configs/_base_/default_runtime.py +54 -0
  22. particle_imaging_models-0.6.0/configs/detector/_base_/jaxtpc_seg.py +90 -0
  23. particle_imaging_models-0.6.0/configs/detector/semseg/semseg-pt-v3m2-jaxtpc-5cls.py +105 -0
  24. particle_imaging_models-0.6.0/configs/panda/v1/panseg/pt-v3m2-ft-joint-fft.py +353 -0
  25. particle_imaging_models-0.6.0/configs/panda/v1/panseg/pt-v3m2-ft-pid-dec.py +281 -0
  26. particle_imaging_models-0.6.0/configs/panda/v1/panseg/pt-v3m2-ft-pid-fft-detector.py +10 -0
  27. particle_imaging_models-0.6.0/configs/panda/v1/panseg/pt-v3m2-ft-pid-fft.py +294 -0
  28. particle_imaging_models-0.6.0/configs/panda/v1/panseg/pt-v3m2-ft-pid-scratch.py +2 -0
  29. particle_imaging_models-0.6.0/configs/panda/v1/panseg/pt-v3m2-ft-vtx-dec.py +277 -0
  30. particle_imaging_models-0.6.0/configs/panda/v1/panseg/pt-v3m2-ft-vtx-fft-detector.py +12 -0
  31. particle_imaging_models-0.6.0/configs/panda/v1/panseg/pt-v3m2-ft-vtx-fft.py +290 -0
  32. particle_imaging_models-0.6.0/configs/panda/v1/panseg/pt-v3m2-ft-vtx-scratch.py +2 -0
  33. particle_imaging_models-0.6.0/configs/panda/v1/pretrain/pretrain-sonata-v1m1-pilarnet-smallmask-v3m8.py +343 -0
  34. particle_imaging_models-0.6.0/configs/panda/v1/pretrain/pretrain-sonata-v1m1-pilarnet-smallmask.py +356 -0
  35. particle_imaging_models-0.6.0/configs/panda/v1/semseg/semseg-pt-v3m2-pilarnet-ft-5cls-dec.py +211 -0
  36. particle_imaging_models-0.6.0/configs/panda/v1/semseg/semseg-pt-v3m2-pilarnet-ft-5cls-fft.py +227 -0
  37. particle_imaging_models-0.6.0/configs/panda/v1/semseg/semseg-pt-v3m2-pilarnet-ft-5cls-lin.py +197 -0
  38. particle_imaging_models-0.6.0/configs/panda/v1/semseg/semseg-pt-v3m2-pilarnet-ft-5cls-scratch.py +2 -0
  39. particle_imaging_models-0.6.0/configs/panda/v2/_base_/default_runtime.py +59 -0
  40. particle_imaging_models-0.6.0/configs/panda/v2/baselines/_base_/next_sparse_resnet.py +98 -0
  41. particle_imaging_models-0.6.0/configs/panda/v2/baselines/next_sparse_resnet.py +2 -0
  42. particle_imaging_models-0.6.0/configs/panda/v2/decoder/synthetic.py +88 -0
  43. particle_imaging_models-0.6.0/configs/panda/v2/finetune/.gitignore +1 -0
  44. particle_imaging_models-0.6.0/configs/panda/v2/finetune/_base_/datasets/lartpc.py +212 -0
  45. particle_imaging_models-0.6.0/configs/panda/v2/finetune/_base_/datasets/next.py +91 -0
  46. particle_imaging_models-0.6.0/configs/panda/v2/finetune/_base_/datasets/sphenix.py +236 -0
  47. particle_imaging_models-0.6.0/configs/panda/v2/finetune/_base_/datasets/wc.py +248 -0
  48. particle_imaging_models-0.6.0/configs/panda/v2/finetune/_base_/decoder.py +45 -0
  49. particle_imaging_models-0.6.0/configs/panda/v2/finetune/_base_/encoder.py +21 -0
  50. particle_imaging_models-0.6.0/configs/panda/v2/finetune/_base_/lora.py +11 -0
  51. particle_imaging_models-0.6.0/configs/panda/v2/finetune/_base_/schedule.py +40 -0
  52. particle_imaging_models-0.6.0/configs/panda/v2/finetune/_base_/wc_encoder.py +3 -0
  53. particle_imaging_models-0.6.0/configs/panda/v2/finetune/instance/lartpc.py +8 -0
  54. particle_imaging_models-0.6.0/configs/panda/v2/finetune/instance/lartpc_frozen.py +9 -0
  55. particle_imaging_models-0.6.0/configs/panda/v2/finetune/instance/lartpc_scratch.py +14 -0
  56. particle_imaging_models-0.6.0/configs/panda/v2/finetune/instance/sphenix.py +6 -0
  57. particle_imaging_models-0.6.0/configs/panda/v2/finetune/instance/sphenix_frozen.py +6 -0
  58. particle_imaging_models-0.6.0/configs/panda/v2/finetune/instance/sphenix_scratch.py +14 -0
  59. particle_imaging_models-0.6.0/configs/panda/v2/finetune/instance/wc.py +7 -0
  60. particle_imaging_models-0.6.0/configs/panda/v2/finetune/instance/wc_frozen.py +7 -0
  61. particle_imaging_models-0.6.0/configs/panda/v2/finetune/instance/wc_scratch.py +13 -0
  62. particle_imaging_models-0.6.0/configs/panda/v2/finetune/semseg/_base.py +63 -0
  63. particle_imaging_models-0.6.0/configs/panda/v2/finetune/semseg/_lartpc.py +106 -0
  64. particle_imaging_models-0.6.0/configs/panda/v2/finetune/semseg/_sphenix.py +152 -0
  65. particle_imaging_models-0.6.0/configs/panda/v2/finetune/semseg/lartpc.py +7 -0
  66. particle_imaging_models-0.6.0/configs/panda/v2/finetune/semseg/lartpc_frozen.py +91 -0
  67. particle_imaging_models-0.6.0/configs/panda/v2/finetune/semseg/lartpc_scratch.py +14 -0
  68. particle_imaging_models-0.6.0/configs/panda/v2/finetune/semseg/sphenix.py +7 -0
  69. particle_imaging_models-0.6.0/configs/panda/v2/finetune/semseg/sphenix_frozen.py +25 -0
  70. particle_imaging_models-0.6.0/configs/panda/v2/finetune/semseg/sphenix_scratch.py +14 -0
  71. particle_imaging_models-0.6.0/configs/panda/v2/finetune/transfer/lartpc.py +30 -0
  72. particle_imaging_models-0.6.0/configs/panda/v2/finetune/transfer/lartpc_frozen.py +10 -0
  73. particle_imaging_models-0.6.0/configs/panda/v2/finetune/transfer/next.py +28 -0
  74. particle_imaging_models-0.6.0/configs/panda/v2/finetune/transfer/next_frozen.py +12 -0
  75. particle_imaging_models-0.6.0/configs/panda/v2/finetune/transfer/sphenix.py +30 -0
  76. particle_imaging_models-0.6.0/configs/panda/v2/finetune/transfer/sphenix_frozen.py +10 -0
  77. particle_imaging_models-0.6.0/configs/panda/v2/finetune/transfer/wc.py +32 -0
  78. particle_imaging_models-0.6.0/configs/panda/v2/finetune/transfer/wc_frozen.py +10 -0
  79. particle_imaging_models-0.6.0/configs/panda/v2/pretrain/_base_.py +66 -0
  80. particle_imaging_models-0.6.0/configs/panda/v2/pretrain/_data_/lartpc.py +237 -0
  81. particle_imaging_models-0.6.0/configs/panda/v2/pretrain/_data_/next.py +243 -0
  82. particle_imaging_models-0.6.0/configs/panda/v2/pretrain/_data_/sphenix.py +230 -0
  83. particle_imaging_models-0.6.0/configs/panda/v2/pretrain/_data_/wc.py +254 -0
  84. particle_imaging_models-0.6.0/configs/panda/v2/pretrain/lartpc.py +6 -0
  85. particle_imaging_models-0.6.0/configs/panda/v2/pretrain/next.py +6 -0
  86. particle_imaging_models-0.6.0/configs/panda/v2/pretrain/sphenix.py +6 -0
  87. particle_imaging_models-0.6.0/configs/panda/v2/pretrain/wc.py +7 -0
  88. particle_imaging_models-0.6.0/configs/panda/v2/test/lartpc_instance.py +16 -0
  89. particle_imaging_models-0.6.0/configs/panda/v2/test/sphenix_instance.py +16 -0
  90. particle_imaging_models-0.6.0/configs/polarmae/pretrain-polarmae-pilarnet.py +156 -0
  91. particle_imaging_models-0.6.0/configs/polarmae/semseg/semseg-polarmae-pilarnet-fft-reproduce.py +129 -0
  92. particle_imaging_models-0.6.0/configs/polarmae/semseg/semseg-polarmae-pilarnet-fft.py +186 -0
  93. particle_imaging_models-0.6.0/configs/polarmae/semseg/semseg-polarmae-pilarnet-peft.py +167 -0
  94. particle_imaging_models-0.6.0/configs/tests/tiny_semseg.py +131 -0
  95. particle_imaging_models-0.6.0/configs/tests/tiny_semseg_crash.py +12 -0
  96. particle_imaging_models-0.6.0/docs/.gitignore +10 -0
  97. particle_imaging_models-0.6.0/docs/Makefile +41 -0
  98. particle_imaging_models-0.6.0/docs/README.md +31 -0
  99. particle_imaging_models-0.6.0/docs/source/_static/custom-icons.js +13 -0
  100. particle_imaging_models-0.6.0/docs/source/_static/custom.css +86 -0
  101. particle_imaging_models-0.6.0/docs/source/_static/figures/panda-event.json +1 -0
  102. particle_imaging_models-0.6.0/docs/source/_static/logo-dark.svg +1 -0
  103. particle_imaging_models-0.6.0/docs/source/_static/logo-light.svg +1 -0
  104. particle_imaging_models-0.6.0/docs/source/_static/logo-themed.svg +1 -0
  105. particle_imaging_models-0.6.0/docs/source/_static/pimm.js +99 -0
  106. particle_imaging_models-0.6.0/docs/source/conf.py +111 -0
  107. particle_imaging_models-0.6.0/docs/source/data/datasets.md +76 -0
  108. particle_imaging_models-0.6.0/docs/source/data/event-format.md +52 -0
  109. particle_imaging_models-0.6.0/docs/source/data/index.md +10 -0
  110. particle_imaging_models-0.6.0/docs/source/data/transforms.md +40 -0
  111. particle_imaging_models-0.6.0/docs/source/data/your-data.md +146 -0
  112. particle_imaging_models-0.6.0/docs/source/develop/add-component.md +114 -0
  113. particle_imaging_models-0.6.0/docs/source/develop/architecture.md +54 -0
  114. particle_imaging_models-0.6.0/docs/source/develop/contributing.md +35 -0
  115. particle_imaging_models-0.6.0/docs/source/develop/index.md +9 -0
  116. particle_imaging_models-0.6.0/docs/source/get-started/first-run.md +95 -0
  117. particle_imaging_models-0.6.0/docs/source/get-started/how-pimm-works.md +91 -0
  118. particle_imaging_models-0.6.0/docs/source/get-started/index.md +9 -0
  119. particle_imaging_models-0.6.0/docs/source/get-started/install.md +169 -0
  120. particle_imaging_models-0.6.0/docs/source/index.md +42 -0
  121. particle_imaging_models-0.6.0/docs/source/models/export.md +59 -0
  122. particle_imaging_models-0.6.0/docs/source/models/fine-tune.md +93 -0
  123. particle_imaging_models-0.6.0/docs/source/models/index.md +28 -0
  124. particle_imaging_models-0.6.0/docs/source/models/panda.md +86 -0
  125. particle_imaging_models-0.6.0/docs/source/models/polarmae.md +51 -0
  126. particle_imaging_models-0.6.0/docs/source/models/run.md +111 -0
  127. particle_imaging_models-0.6.0/docs/source/reference/glossary.md +73 -0
  128. particle_imaging_models-0.6.0/docs/source/reference/index.md +11 -0
  129. particle_imaging_models-0.6.0/docs/source/training/checkpoints.md +64 -0
  130. particle_imaging_models-0.6.0/docs/source/training/configs.md +71 -0
  131. particle_imaging_models-0.6.0/docs/source/training/evaluate.md +74 -0
  132. particle_imaging_models-0.6.0/docs/source/training/index.md +13 -0
  133. particle_imaging_models-0.6.0/docs/source/training/monitor.md +77 -0
  134. particle_imaging_models-0.6.0/docs/source/training/scale.md +142 -0
  135. particle_imaging_models-0.6.0/docs/source/training/train.md +67 -0
  136. particle_imaging_models-0.6.0/docs/source/training/troubleshooting.md +71 -0
  137. particle_imaging_models-0.6.0/docs/tools/gen_reference.py +797 -0
  138. particle_imaging_models-0.6.0/example.env +17 -0
  139. particle_imaging_models-0.6.0/install.sh +105 -0
  140. particle_imaging_models-0.6.0/launch/NERSC_CHAIN.md +16 -0
  141. particle_imaging_models-0.6.0/launch/README.md +176 -0
  142. particle_imaging_models-0.6.0/launch/SLURM_CHAIN.md +35 -0
  143. particle_imaging_models-0.6.0/launch/defaults.yaml +20 -0
  144. particle_imaging_models-0.6.0/launch/runs/e050_tail.yaml +25 -0
  145. particle_imaging_models-0.6.0/launch/sites/local.yaml +85 -0
  146. particle_imaging_models-0.6.0/launch/sites/nersc-container.yaml +99 -0
  147. particle_imaging_models-0.6.0/launch/sites/nersc.yaml +98 -0
  148. particle_imaging_models-0.6.0/launch/sites/s3df-container.yaml +95 -0
  149. particle_imaging_models-0.6.0/launch/sites/s3df.yaml +89 -0
  150. particle_imaging_models-0.6.0/launch/sites/slurm.yaml +83 -0
  151. particle_imaging_models-0.6.0/notebooks/panda/example.ipynb +1110 -0
  152. particle_imaging_models-0.6.0/pimm/__init__.py +33 -0
  153. particle_imaging_models-0.6.0/pimm/cli/__init__.py +1 -0
  154. particle_imaging_models-0.6.0/pimm/cli/__main__.py +7 -0
  155. particle_imaging_models-0.6.0/pimm/cli/common.py +80 -0
  156. particle_imaging_models-0.6.0/pimm/cli/export.py +138 -0
  157. particle_imaging_models-0.6.0/pimm/cli/launch.py +60 -0
  158. particle_imaging_models-0.6.0/pimm/cli/main.py +63 -0
  159. particle_imaging_models-0.6.0/pimm/cli/submit.py +66 -0
  160. particle_imaging_models-0.6.0/pimm/cli/trace.py +497 -0
  161. particle_imaging_models-0.6.0/pimm/cli/watchdog.py +62 -0
  162. particle_imaging_models-0.6.0/pimm/datasets/__init__.py +29 -0
  163. particle_imaging_models-0.6.0/pimm/datasets/builder.py +17 -0
  164. particle_imaging_models-0.6.0/pimm/datasets/dataloader.py +129 -0
  165. particle_imaging_models-0.6.0/pimm/datasets/defaults.py +322 -0
  166. particle_imaging_models-0.6.0/pimm/datasets/jaxtpc_dataset.py +484 -0
  167. particle_imaging_models-0.6.0/pimm/datasets/lucid_dataset.py +271 -0
  168. particle_imaging_models-0.6.0/pimm/datasets/next_h5.py +744 -0
  169. particle_imaging_models-0.6.0/pimm/datasets/pilarnet/__init__.py +31 -0
  170. particle_imaging_models-0.6.0/pimm/datasets/pilarnet/decode.py +414 -0
  171. particle_imaging_models-0.6.0/pimm/datasets/pilarnet/default.py +88 -0
  172. particle_imaging_models-0.6.0/pimm/datasets/pilarnet/h5.py +436 -0
  173. particle_imaging_models-0.6.0/pimm/datasets/pilarnet/overlay.py +266 -0
  174. particle_imaging_models-0.6.0/pimm/datasets/preprocessing/__init__.py +0 -0
  175. particle_imaging_models-0.6.0/pimm/datasets/preprocessing/anchors.py +356 -0
  176. particle_imaging_models-0.6.0/pimm/datasets/readers/__init__.py +6 -0
  177. particle_imaging_models-0.6.0/pimm/datasets/readers/jaxtpc_corr_reader.py +190 -0
  178. particle_imaging_models-0.6.0/pimm/datasets/readers/jaxtpc_labl_reader.py +150 -0
  179. particle_imaging_models-0.6.0/pimm/datasets/readers/jaxtpc_resp_reader.py +180 -0
  180. particle_imaging_models-0.6.0/pimm/datasets/readers/jaxtpc_seg_reader.py +281 -0
  181. particle_imaging_models-0.6.0/pimm/datasets/readers/lucid_seg_reader.py +201 -0
  182. particle_imaging_models-0.6.0/pimm/datasets/readers/lucid_sensor_reader.py +223 -0
  183. particle_imaging_models-0.6.0/pimm/datasets/sphere_prior/__init__.py +5 -0
  184. particle_imaging_models-0.6.0/pimm/datasets/sphere_prior/dataset.py +56 -0
  185. particle_imaging_models-0.6.0/pimm/datasets/sphere_prior/episode.py +43 -0
  186. particle_imaging_models-0.6.0/pimm/datasets/sphere_prior/geometry.py +81 -0
  187. particle_imaging_models-0.6.0/pimm/datasets/sphere_prior/sampling.py +55 -0
  188. particle_imaging_models-0.6.0/pimm/datasets/stateful.py +235 -0
  189. particle_imaging_models-0.6.0/pimm/datasets/test_fragments.py +40 -0
  190. particle_imaging_models-0.6.0/pimm/datasets/transform/__init__.py +10 -0
  191. particle_imaging_models-0.6.0/pimm/datasets/transform/base.py +393 -0
  192. particle_imaging_models-0.6.0/pimm/datasets/transform/color.py +806 -0
  193. particle_imaging_models-0.6.0/pimm/datasets/transform/common.py +223 -0
  194. particle_imaging_models-0.6.0/pimm/datasets/transform/detector.py +367 -0
  195. particle_imaging_models-0.6.0/pimm/datasets/transform/instance.py +363 -0
  196. particle_imaging_models-0.6.0/pimm/datasets/transform/multiview.py +468 -0
  197. particle_imaging_models-0.6.0/pimm/datasets/transform/preparation.py +241 -0
  198. particle_imaging_models-0.6.0/pimm/datasets/transform/spatial.py +1650 -0
  199. particle_imaging_models-0.6.0/pimm/datasets/utils.py +118 -0
  200. particle_imaging_models-0.6.0/pimm/datasets/wand.py +779 -0
  201. particle_imaging_models-0.6.0/pimm/distributed/__init__.py +17 -0
  202. particle_imaging_models-0.6.0/pimm/distributed/distributed.py +183 -0
  203. particle_imaging_models-0.6.0/pimm/engines/__init__.py +0 -0
  204. particle_imaging_models-0.6.0/pimm/engines/_execution.py +97 -0
  205. particle_imaging_models-0.6.0/pimm/engines/_train_utils.py +406 -0
  206. particle_imaging_models-0.6.0/pimm/engines/defaults.py +187 -0
  207. particle_imaging_models-0.6.0/pimm/engines/hooks/__init__.py +12 -0
  208. particle_imaging_models-0.6.0/pimm/engines/hooks/builder.py +18 -0
  209. particle_imaging_models-0.6.0/pimm/engines/hooks/checkpoint.py +361 -0
  210. particle_imaging_models-0.6.0/pimm/engines/hooks/default.py +145 -0
  211. particle_imaging_models-0.6.0/pimm/engines/hooks/diagnostics.py +1402 -0
  212. particle_imaging_models-0.6.0/pimm/engines/hooks/eval/__init__.py +7 -0
  213. particle_imaging_models-0.6.0/pimm/engines/hooks/eval/events.py +206 -0
  214. particle_imaging_models-0.6.0/pimm/engines/hooks/eval/final.py +82 -0
  215. particle_imaging_models-0.6.0/pimm/engines/hooks/eval/instance.py +980 -0
  216. particle_imaging_models-0.6.0/pimm/engines/hooks/eval/probes/__init__.py +4 -0
  217. particle_imaging_models-0.6.0/pimm/engines/hooks/eval/probes/events.py +856 -0
  218. particle_imaging_models-0.6.0/pimm/engines/hooks/eval/probes/mae.py +285 -0
  219. particle_imaging_models-0.6.0/pimm/engines/hooks/eval/probes/points.py +955 -0
  220. particle_imaging_models-0.6.0/pimm/engines/hooks/eval/probes/wc.py +276 -0
  221. particle_imaging_models-0.6.0/pimm/engines/hooks/eval/rings.py +518 -0
  222. particle_imaging_models-0.6.0/pimm/engines/hooks/eval/semantic.py +438 -0
  223. particle_imaging_models-0.6.0/pimm/engines/hooks/eval/synthetic.py +406 -0
  224. particle_imaging_models-0.6.0/pimm/engines/hooks/export.py +348 -0
  225. particle_imaging_models-0.6.0/pimm/engines/hooks/logging.py +394 -0
  226. particle_imaging_models-0.6.0/pimm/engines/hooks/optimizer.py +205 -0
  227. particle_imaging_models-0.6.0/pimm/engines/hooks/profiling.py +139 -0
  228. particle_imaging_models-0.6.0/pimm/engines/hooks/resources.py +334 -0
  229. particle_imaging_models-0.6.0/pimm/engines/metrics/__init__.py +15 -0
  230. particle_imaging_models-0.6.0/pimm/engines/metrics/fm4npp.py +26 -0
  231. particle_imaging_models-0.6.0/pimm/engines/metrics/instance.py +318 -0
  232. particle_imaging_models-0.6.0/pimm/engines/metrics/panoptic.py +218 -0
  233. particle_imaging_models-0.6.0/pimm/engines/metrics/semseg.py +128 -0
  234. particle_imaging_models-0.6.0/pimm/engines/test.py +851 -0
  235. particle_imaging_models-0.6.0/pimm/engines/train.py +1321 -0
  236. particle_imaging_models-0.6.0/pimm/export/__init__.py +23 -0
  237. particle_imaging_models-0.6.0/pimm/export/api.py +648 -0
  238. particle_imaging_models-0.6.0/pimm/export/checkpoint.py +284 -0
  239. particle_imaging_models-0.6.0/pimm/launch/__init__.py +2 -0
  240. particle_imaging_models-0.6.0/pimm/launch/_exex.py +333 -0
  241. particle_imaging_models-0.6.0/pimm/launch/compat.py +161 -0
  242. particle_imaging_models-0.6.0/pimm/launch/config.py +373 -0
  243. particle_imaging_models-0.6.0/pimm/launch/local.py +349 -0
  244. particle_imaging_models-0.6.0/pimm/launch/schema.py +288 -0
  245. particle_imaging_models-0.6.0/pimm/launch/submit.py +596 -0
  246. particle_imaging_models-0.6.0/pimm/launch/torchrun.sh +31 -0
  247. particle_imaging_models-0.6.0/pimm/launch/utils.py +173 -0
  248. particle_imaging_models-0.6.0/pimm/launch/watchdog.py +369 -0
  249. particle_imaging_models-0.6.0/pimm/models/__init__.py +23 -0
  250. particle_imaging_models-0.6.0/pimm/models/builder.py +16 -0
  251. particle_imaging_models-0.6.0/pimm/models/classifier/__init__.py +4 -0
  252. particle_imaging_models-0.6.0/pimm/models/classifier/event_classifier.py +533 -0
  253. particle_imaging_models-0.6.0/pimm/models/classifier/sparse_event_classifier.py +32 -0
  254. particle_imaging_models-0.6.0/pimm/models/default.py +417 -0
  255. particle_imaging_models-0.6.0/pimm/models/litept/__init__.py +1 -0
  256. particle_imaging_models-0.6.0/pimm/models/litept/litept.py +677 -0
  257. particle_imaging_models-0.6.0/pimm/models/lora.py +220 -0
  258. particle_imaging_models-0.6.0/pimm/models/losses/__init__.py +17 -0
  259. particle_imaging_models-0.6.0/pimm/models/losses/builder.py +42 -0
  260. particle_imaging_models-0.6.0/pimm/models/losses/instance.py +1000 -0
  261. particle_imaging_models-0.6.0/pimm/models/losses/lovasz.py +369 -0
  262. particle_imaging_models-0.6.0/pimm/models/losses/misc.py +591 -0
  263. particle_imaging_models-0.6.0/pimm/models/modules.py +95 -0
  264. particle_imaging_models-0.6.0/pimm/models/next/__init__.py +1 -0
  265. particle_imaging_models-0.6.0/pimm/models/next/blobs.py +180 -0
  266. particle_imaging_models-0.6.0/pimm/models/next/kekic_resnet.py +115 -0
  267. particle_imaging_models-0.6.0/pimm/models/panda/__init__.py +5 -0
  268. particle_imaging_models-0.6.0/pimm/models/panda/detector/__init__.py +3 -0
  269. particle_imaging_models-0.6.0/pimm/models/panda/detector/layers.py +407 -0
  270. particle_imaging_models-0.6.0/pimm/models/panda/detector/matcher.py +307 -0
  271. particle_imaging_models-0.6.0/pimm/models/panda/detector/panda_detector_v2m1.py +925 -0
  272. particle_imaging_models-0.6.0/pimm/models/panda/detector/postprocess.py +577 -0
  273. particle_imaging_models-0.6.0/pimm/models/panda/encoder/__init__.py +3 -0
  274. particle_imaging_models-0.6.0/pimm/models/panda/encoder/panda_encoder_v2m1.py +307 -0
  275. particle_imaging_models-0.6.0/pimm/models/panda/pretrain/__init__.py +3 -0
  276. particle_imaging_models-0.6.0/pimm/models/panda/pretrain/panda_ssl_v2m1.py +533 -0
  277. particle_imaging_models-0.6.0/pimm/models/panda_detector/__init__.py +1 -0
  278. particle_imaging_models-0.6.0/pimm/models/panda_detector/layers.py +594 -0
  279. particle_imaging_models-0.6.0/pimm/models/panda_detector/matcher_fast.py +289 -0
  280. particle_imaging_models-0.6.0/pimm/models/panda_detector/panda_detector_v1m1.py +695 -0
  281. particle_imaging_models-0.6.0/pimm/models/panda_detector/postprocess.py +520 -0
  282. particle_imaging_models-0.6.0/pimm/models/point_transformer_v3/__init__.py +3 -0
  283. particle_imaging_models-0.6.0/pimm/models/point_transformer_v3/point_transformer_v3m1_base.py +726 -0
  284. particle_imaging_models-0.6.0/pimm/models/point_transformer_v3/point_transformer_v3m2_sonata.py +867 -0
  285. particle_imaging_models-0.6.0/pimm/models/point_transformer_v3/point_transformer_v3m8.py +997 -0
  286. particle_imaging_models-0.6.0/pimm/models/polarmae/__init__.py +2 -0
  287. particle_imaging_models-0.6.0/pimm/models/polarmae/data.py +58 -0
  288. particle_imaging_models-0.6.0/pimm/models/polarmae/layers.py +640 -0
  289. particle_imaging_models-0.6.0/pimm/models/polarmae/ops.py +288 -0
  290. particle_imaging_models-0.6.0/pimm/models/polarmae/polarmae.py +225 -0
  291. particle_imaging_models-0.6.0/pimm/models/polarmae/polarmae_semseg.py +256 -0
  292. particle_imaging_models-0.6.0/pimm/models/sonata/__init__.py +3 -0
  293. particle_imaging_models-0.6.0/pimm/models/sonata/sonata_v1m1_base.py +653 -0
  294. particle_imaging_models-0.6.0/pimm/models/sonata/sonata_v1m2_uni_teacher_head.py +531 -0
  295. particle_imaging_models-0.6.0/pimm/models/sparse_unet/__init__.py +4 -0
  296. particle_imaging_models-0.6.0/pimm/models/sparse_unet/mink_unet.py +442 -0
  297. particle_imaging_models-0.6.0/pimm/models/sparse_unet/spconv_unet_v1m1_base.py +463 -0
  298. particle_imaging_models-0.6.0/pimm/models/sparse_unet/spconv_unet_v1m2_bn_momentum.py +290 -0
  299. particle_imaging_models-0.6.0/pimm/models/sparse_unet/spconv_unet_v1m3_pdnorm.py +429 -0
  300. particle_imaging_models-0.6.0/pimm/models/utils/__init__.py +9 -0
  301. particle_imaging_models-0.6.0/pimm/models/utils/checkpoint.py +99 -0
  302. particle_imaging_models-0.6.0/pimm/models/utils/checkpoint_loader.py +6 -0
  303. particle_imaging_models-0.6.0/pimm/models/utils/hierarchical_features.py +257 -0
  304. particle_imaging_models-0.6.0/pimm/models/utils/misc.py +90 -0
  305. particle_imaging_models-0.6.0/pimm/models/utils/serialization/__init__.py +11 -0
  306. particle_imaging_models-0.6.0/pimm/models/utils/serialization/default.py +150 -0
  307. particle_imaging_models-0.6.0/pimm/models/utils/serialization/hilbert.py +369 -0
  308. particle_imaging_models-0.6.0/pimm/models/utils/serialization/z_order.py +126 -0
  309. particle_imaging_models-0.6.0/pimm/models/utils/stats.py +69 -0
  310. particle_imaging_models-0.6.0/pimm/models/utils/structure.py +232 -0
  311. particle_imaging_models-0.6.0/pimm/observability/__init__.py +5 -0
  312. particle_imaging_models-0.6.0/pimm/observability/structured_logger/LICENSE +28 -0
  313. particle_imaging_models-0.6.0/pimm/observability/structured_logger/README.md +234 -0
  314. particle_imaging_models-0.6.0/pimm/observability/structured_logger/__init__.py +54 -0
  315. particle_imaging_models-0.6.0/pimm/observability/structured_logger/gantt_generator.py +587 -0
  316. particle_imaging_models-0.6.0/pimm/observability/structured_logger/jsonl_handler.py +310 -0
  317. particle_imaging_models-0.6.0/pimm/observability/structured_logger/step_state.py +203 -0
  318. particle_imaging_models-0.6.0/pimm/observability/structured_logger/structured_logging.py +569 -0
  319. particle_imaging_models-0.6.0/pimm/ops/README.md +155 -0
  320. particle_imaging_models-0.6.0/pimm/ops/__init__.py +17 -0
  321. particle_imaging_models-0.6.0/pimm/ops/_attention_turing.py +96 -0
  322. particle_imaging_models-0.6.0/pimm/ops/_fused.py +9 -0
  323. particle_imaging_models-0.6.0/pimm/ops/attention.py +420 -0
  324. particle_imaging_models-0.6.0/pimm/ops/hilbert.py +14 -0
  325. particle_imaging_models-0.6.0/pimm/ops/knn.py +65 -0
  326. particle_imaging_models-0.6.0/pimm/ops/rope.py +20 -0
  327. particle_imaging_models-0.6.0/pimm/ops/sinkhorn.py +114 -0
  328. particle_imaging_models-0.6.0/pimm/ops/submconv3d.py +194 -0
  329. particle_imaging_models-0.6.0/pimm/ops/triton/__init__.py +5 -0
  330. particle_imaging_models-0.6.0/pimm/ops/triton/attention.py +389 -0
  331. particle_imaging_models-0.6.0/pimm/ops/triton/ball_query.py +73 -0
  332. particle_imaging_models-0.6.0/pimm/ops/triton/cnms.py +64 -0
  333. particle_imaging_models-0.6.0/pimm/ops/triton/fps.py +72 -0
  334. particle_imaging_models-0.6.0/pimm/ops/triton/hilbert.py +56 -0
  335. particle_imaging_models-0.6.0/pimm/ops/triton/knn.py +82 -0
  336. particle_imaging_models-0.6.0/pimm/ops/triton/knn_points.py +170 -0
  337. particle_imaging_models-0.6.0/pimm/ops/triton/sinkhorn.py +605 -0
  338. particle_imaging_models-0.6.0/pimm/ops/triton/submconv3d.py +364 -0
  339. particle_imaging_models-0.6.0/pimm/ops/triton/window_attention.py +298 -0
  340. particle_imaging_models-0.6.0/pimm/test.py +42 -0
  341. particle_imaging_models-0.6.0/pimm/train.py +84 -0
  342. particle_imaging_models-0.6.0/pimm/utils/__init__.py +19 -0
  343. particle_imaging_models-0.6.0/pimm/utils/cache.py +68 -0
  344. particle_imaging_models-0.6.0/pimm/utils/checkpoints.py +1373 -0
  345. particle_imaging_models-0.6.0/pimm/utils/comm.py +455 -0
  346. particle_imaging_models-0.6.0/pimm/utils/config.py +777 -0
  347. particle_imaging_models-0.6.0/pimm/utils/env.py +52 -0
  348. particle_imaging_models-0.6.0/pimm/utils/events.py +1095 -0
  349. particle_imaging_models-0.6.0/pimm/utils/logger.py +171 -0
  350. particle_imaging_models-0.6.0/pimm/utils/misc.py +145 -0
  351. particle_imaging_models-0.6.0/pimm/utils/optimizer.py +68 -0
  352. particle_imaging_models-0.6.0/pimm/utils/path.py +169 -0
  353. particle_imaging_models-0.6.0/pimm/utils/registry.py +363 -0
  354. particle_imaging_models-0.6.0/pimm/utils/scheduler.py +246 -0
  355. particle_imaging_models-0.6.0/pimm/utils/timer.py +71 -0
  356. particle_imaging_models-0.6.0/pimm/utils/visualization.py +131 -0
  357. particle_imaging_models-0.6.0/pimm/utils/warnings.py +86 -0
  358. particle_imaging_models-0.6.0/pyproject.toml +149 -0
  359. particle_imaging_models-0.6.0/scripts/nersc_env.sh +37 -0
  360. particle_imaging_models-0.6.0/scripts/panda/eval/_common.py +111 -0
  361. particle_imaging_models-0.6.0/scripts/panda/eval/_wc_inputs.py +516 -0
  362. particle_imaging_models-0.6.0/scripts/panda/eval/bootstrap.py +303 -0
  363. particle_imaging_models-0.6.0/scripts/panda/eval/next.py +316 -0
  364. particle_imaging_models-0.6.0/scripts/panda/eval/test_lartpc.py +208 -0
  365. particle_imaging_models-0.6.0/scripts/panda/eval/test_sphenix.py +10 -0
  366. particle_imaging_models-0.6.0/scripts/panda/eval/test_wc.py +517 -0
  367. particle_imaging_models-0.6.0/scripts/panda/eval/two_blob.py +141 -0
  368. particle_imaging_models-0.6.0/scripts/panda/eval/wc_kinematics.py +615 -0
  369. particle_imaging_models-0.6.0/scripts/panda/eval/wc_probes.py +324 -0
  370. particle_imaging_models-0.6.0/scripts/pilarnet/download.py +158 -0
  371. particle_imaging_models-0.6.0/scripts/test.sh +109 -0
  372. particle_imaging_models-0.6.0/scripts/train.sh +303 -0
  373. particle_imaging_models-0.6.0/tests/__init__.py +1 -0
  374. particle_imaging_models-0.6.0/tests/conftest.py +130 -0
  375. particle_imaging_models-0.6.0/tests/integration/cluster/README.md +3 -0
  376. particle_imaging_models-0.6.0/tests/integration/fixtures/metric_baselines.json +107 -0
  377. particle_imaging_models-0.6.0/tests/integration/test_cuda_runtime.py +51 -0
  378. particle_imaging_models-0.6.0/tests/integration/test_hf_model_loading.py +84 -0
  379. particle_imaging_models-0.6.0/tests/integration/test_jaxtpc_dataset.py +209 -0
  380. particle_imaging_models-0.6.0/tests/integration/test_lucid_dataset.py +161 -0
  381. particle_imaging_models-0.6.0/tests/integration/test_metric_baselines.py +119 -0
  382. particle_imaging_models-0.6.0/tests/integration/test_panda_cross_attention.py +82 -0
  383. particle_imaging_models-0.6.0/tests/integration/test_pilarnet_mini.py +66 -0
  384. particle_imaging_models-0.6.0/tests/integration/test_tiny_training.py +261 -0
  385. particle_imaging_models-0.6.0/tests/test_launch_torchrun.py +605 -0
  386. particle_imaging_models-0.6.0/tests/unit/observability/structured_logger/conftest.py +72 -0
  387. particle_imaging_models-0.6.0/tests/unit/observability/structured_logger/test_gantt_generator.py +367 -0
  388. particle_imaging_models-0.6.0/tests/unit/observability/structured_logger/test_step_state.py +141 -0
  389. particle_imaging_models-0.6.0/tests/unit/observability/structured_logger/test_structured_logging.py +536 -0
  390. particle_imaging_models-0.6.0/tests/unit/test_checkpoint_best_metric.py +69 -0
  391. particle_imaging_models-0.6.0/tests/unit/test_checkpoint_retention.py +340 -0
  392. particle_imaging_models-0.6.0/tests/unit/test_config_pretty_text.py +21 -0
  393. particle_imaging_models-0.6.0/tests/unit/test_execution_adapter.py +435 -0
  394. particle_imaging_models-0.6.0/tests/unit/test_execution_checkpoint.py +35 -0
  395. particle_imaging_models-0.6.0/tests/unit/test_fm4npp_metrics.py +31 -0
  396. particle_imaging_models-0.6.0/tests/unit/test_instance_segmentation_joint_selection.py +139 -0
  397. particle_imaging_models-0.6.0/tests/unit/test_launch_command_tracking.py +40 -0
  398. particle_imaging_models-0.6.0/tests/unit/test_launch_compat.py +144 -0
  399. particle_imaging_models-0.6.0/tests/unit/test_launch_rendering.py +113 -0
  400. particle_imaging_models-0.6.0/tests/unit/test_linear_probe_checkpoint_loading.py +25 -0
  401. particle_imaging_models-0.6.0/tests/unit/test_ops_knn.py +77 -0
  402. particle_imaging_models-0.6.0/tests/unit/test_panda_attention.py +125 -0
  403. particle_imaging_models-0.6.0/tests/unit/test_panda_cross_attention.py +91 -0
  404. particle_imaging_models-0.6.0/tests/unit/test_panda_data.py +128 -0
  405. particle_imaging_models-0.6.0/tests/unit/test_panda_engine_compatibility.py +183 -0
  406. particle_imaging_models-0.6.0/tests/unit/test_panda_preparation.py +150 -0
  407. particle_imaging_models-0.6.0/tests/unit/test_panda_sparse_conv.py +32 -0
  408. particle_imaging_models-0.6.0/tests/unit/test_panda_v2_models.py +457 -0
  409. particle_imaging_models-0.6.0/tests/unit/test_pimm_warnings.py +38 -0
  410. particle_imaging_models-0.6.0/tests/unit/test_point_classification_metrics.py +80 -0
  411. particle_imaging_models-0.6.0/tests/unit/test_polarmae_decoder.py +22 -0
  412. particle_imaging_models-0.6.0/tests/unit/test_polarmae_ops.py +240 -0
  413. particle_imaging_models-0.6.0/tests/unit/test_rank_zero_evaluation.py +108 -0
  414. particle_imaging_models-0.6.0/tests/unit/test_ring_panoptic_evaluator.py +104 -0
  415. particle_imaging_models-0.6.0/tests/unit/test_sphere_prior.py +142 -0
  416. particle_imaging_models-0.6.0/tests/unit/test_structured_logging_integration.py +397 -0
  417. particle_imaging_models-0.6.0/tests/unit/test_structured_trace_cli.py +225 -0
  418. particle_imaging_models-0.6.0/tests/unit/test_train_sh.py +94 -0
  419. particle_imaging_models-0.6.0/tests/unit/test_training_entrypoint.py +108 -0
  420. particle_imaging_models-0.6.0/tests/unit/test_training_pause.py +182 -0
  421. particle_imaging_models-0.6.0/tests/unit/test_training_resume_rng.py +136 -0
  422. particle_imaging_models-0.6.0/tests/unit/test_training_split_backward.py +103 -0
  423. particle_imaging_models-0.6.0/tests/unit/test_wandb_launch.py +28 -0
  424. particle_imaging_models-0.6.0/tests/unit/test_wandb_resume.py +361 -0
  425. particle_imaging_models-0.6.0/tests/utils.py +58 -0
  426. particle_imaging_models-0.6.0/uv.lock +3264 -0
@@ -0,0 +1,9 @@
1
+ # Runtime images contain dependencies, never application source or run artifacts.
2
+ **
3
+ !pyproject.toml
4
+ !uv.lock
5
+ !.python-version
6
+ !.github/docker/common/install_system.sh
7
+ !.github/docker/pimm
8
+ !.github/docker/entrypoint.sh
9
+ !scripts/nersc_env.sh
@@ -0,0 +1,39 @@
1
+ # syntax=docker/dockerfile:1
2
+
3
+ ARG TORCH_VERSION=2.10.0
4
+ ARG CUDA_VERSION=12.6
5
+ ARG CUDNN_VERSION=9
6
+ FROM pytorch/pytorch:${TORCH_VERSION}-cuda${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel
7
+
8
+ COPY --from=ghcr.io/astral-sh/uv:0.11.28 /uv /uvx /usr/local/uv/bin/
9
+
10
+ ARG TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6 8.9 9.0"
11
+ ENV CUDA_HOME=/usr/local/cuda \
12
+ FORCE_CUDA=1 \
13
+ MAX_JOBS=1 \
14
+ PATH=/opt/pimm/.venv/bin:/usr/local/uv/bin:$PATH \
15
+ PYTHONNOUSERSITE=1 \
16
+ TORCH_CUDA_ARCH_LIST=${TORCH_CUDA_ARCH_LIST} \
17
+ UV_LINK_MODE=copy \
18
+ UV_PYTHON_INSTALL_DIR=/opt/uv/python \
19
+ UV_PROJECT_ENVIRONMENT=/opt/pimm/.venv
20
+
21
+ RUN rm -f /etc/apt/sources.list.d/*.list
22
+ COPY .github/docker/common /opt/pimm/.github/docker/common
23
+ RUN bash /opt/pimm/.github/docker/common/install_system.sh
24
+
25
+ # the image ships only the locked environment: no pimm source is baked in,
26
+ # so code always comes from a bound checkout (entrypoint puts cwd on PYTHONPATH)
27
+ WORKDIR /opt/pimm
28
+ COPY pyproject.toml uv.lock .python-version ./
29
+ RUN --mount=type=cache,target=/root/.cache/uv \
30
+ uv sync --locked --no-install-project
31
+
32
+ COPY .github/docker/pimm /usr/local/bin/pimm
33
+ COPY .github/docker/entrypoint.sh /opt/pimm/entrypoint.sh
34
+ RUN chmod +x /usr/local/bin/pimm /opt/pimm/entrypoint.sh
35
+
36
+ # default mount point for containerized jobs that bind the checkout
37
+ WORKDIR /opt/pimm/src
38
+ ENTRYPOINT ["/opt/pimm/entrypoint.sh"]
39
+ CMD ["bash"]
@@ -0,0 +1,64 @@
1
+ # syntax=docker/dockerfile:1
2
+
3
+ ARG TORCH_VERSION=2.10.0
4
+ ARG CUDA_VERSION=12.6
5
+ ARG CUDNN_VERSION=9
6
+ FROM pytorch/pytorch:${TORCH_VERSION}-cuda${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel
7
+
8
+ COPY --from=ghcr.io/astral-sh/uv:0.11.28 /uv /uvx /usr/local/uv/bin/
9
+
10
+ ARG TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6 8.9 9.0"
11
+ ENV CUDA_HOME=/usr/local/cuda \
12
+ FORCE_CUDA=1 \
13
+ MAX_JOBS=1 \
14
+ PATH=/opt/pimm/.venv/bin:/usr/local/uv/bin:$PATH \
15
+ PYTHONNOUSERSITE=1 \
16
+ TORCH_CUDA_ARCH_LIST=${TORCH_CUDA_ARCH_LIST} \
17
+ UV_LINK_MODE=copy \
18
+ UV_PYTHON_INSTALL_DIR=/opt/uv/python \
19
+ UV_PROJECT_ENVIRONMENT=/opt/pimm/.venv
20
+
21
+ RUN rm -f /etc/apt/sources.list.d/*.list
22
+ COPY .github/docker/common /opt/pimm/.github/docker/common
23
+ RUN bash /opt/pimm/.github/docker/common/install_system.sh gfortran pkg-config
24
+
25
+ ARG MPICH_VERSION=4.0.2
26
+ RUN wget https://www.mpich.org/static/downloads/${MPICH_VERSION}/mpich-${MPICH_VERSION}.tar.gz \
27
+ && tar xzf mpich-${MPICH_VERSION}.tar.gz \
28
+ && cd mpich-${MPICH_VERSION} \
29
+ && FFLAGS=-fallow-argument-mismatch FCFLAGS=-fallow-argument-mismatch ./configure \
30
+ && make -j 16 && make install \
31
+ && cd .. && rm -rf mpich-${MPICH_VERSION} mpich-${MPICH_VERSION}.tar.gz
32
+ RUN /sbin/ldconfig
33
+
34
+ ARG HDF5_TAG=hdf5_1.14.6
35
+ RUN wget https://github.com/HDFGroup/hdf5/archive/refs/tags/${HDF5_TAG}.tar.gz \
36
+ && tar xzf ${HDF5_TAG}.tar.gz \
37
+ && cd hdf5-${HDF5_TAG} \
38
+ && CC=mpicc CXX=mpicxx ./configure --enable-parallel --enable-build-mode=production \
39
+ --prefix=/opt/hdf5 --enable-static --enable-shared --with-pic \
40
+ && make -j 8 && make install \
41
+ && cd .. && rm -rf hdf5-${HDF5_TAG} ${HDF5_TAG}.tar.gz
42
+ RUN /sbin/ldconfig
43
+ ENV HDF5_DIR=/opt/hdf5
44
+ ENV PATH=/opt/hdf5/bin:$PATH
45
+ ENV LD_LIBRARY_PATH=/opt/hdf5/lib:$LD_LIBRARY_PATH
46
+
47
+ # the image ships only the locked environment: no pimm source is baked in,
48
+ # so code always comes from a bound checkout (entrypoint puts cwd on PYTHONPATH)
49
+ WORKDIR /opt/pimm
50
+ COPY pyproject.toml uv.lock .python-version ./
51
+ RUN --mount=type=cache,target=/root/.cache/uv \
52
+ uv sync --locked --group nersc --no-install-project
53
+
54
+ COPY scripts/nersc_env.sh scripts/nersc_env.sh
55
+ RUN HDF5_VERSION=1.14.6 bash scripts/nersc_env.sh
56
+
57
+ COPY .github/docker/pimm /usr/local/bin/pimm
58
+ COPY .github/docker/entrypoint.sh /opt/pimm/entrypoint.sh
59
+ RUN chmod +x /usr/local/bin/pimm /opt/pimm/entrypoint.sh
60
+
61
+ # default mount point for containerized jobs that bind the checkout
62
+ WORKDIR /opt/pimm/src
63
+ ENTRYPOINT ["/opt/pimm/entrypoint.sh"]
64
+ CMD ["bash"]
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env bash
2
+ # system packages needed to build the CUDA extensions and run pimm
3
+ # extra package names may be passed as args, such as NERSC build dependencies
4
+ set -euo pipefail
5
+
6
+ export DEBIAN_FRONTEND=noninteractive
7
+ apt-get update --no-install-recommends
8
+ apt-get install -y --no-install-recommends \
9
+ git wget tmux vim zsh build-essential cmake ninja-build \
10
+ libopenblas-dev "$@"
11
+ apt-get autoremove -y && apt-get clean -y
12
+ rm -rf /var/lib/apt/lists/*
@@ -0,0 +1,32 @@
1
+ #!/bin/bash
2
+ # Container entrypoint for pimm.
3
+ #
4
+ # When Apptainer/Singularity bind-mounts the user's home directory, their
5
+ # ~/.bashrc is sourced on every shell invocation. This commonly contains
6
+ # conda/mamba init blocks that try to run binaries not present in the
7
+ # container, causing hangs or errors.
8
+ #
9
+ # This entrypoint neutralizes those init blocks by shadowing conda/mamba
10
+ # with no-ops before any shell has a chance to source ~/.bashrc.
11
+
12
+ # Make conda/mamba init blocks harmless — they call `conda shell.bash hook`
13
+ # or `mamba shell.bash hook` which don't exist in this container.
14
+ conda() { :; }
15
+ mamba() { :; }
16
+ micromamba() { :; }
17
+ export -f conda mamba micromamba
18
+
19
+ # Also prevent user site-packages from leaking in
20
+ export PYTHONNOUSERSITE=1
21
+
22
+ # The image ships no pimm source: when the current directory is a pimm
23
+ # checkout (bound by the user or by pimm submit), put it on PYTHONPATH so
24
+ # `import pimm` and the `pimm` shim resolve to it. Set PIMM_NO_CWD=1 to opt
25
+ # out.
26
+ if [ -z "${PIMM_NO_CWD:-}" ] \
27
+ && [ -f "$PWD/pimm/__init__.py" ] \
28
+ && [ -f "$PWD/launch/defaults.yaml" ]; then
29
+ export PYTHONPATH="$PWD${PYTHONPATH:+:$PYTHONPATH}"
30
+ fi
31
+
32
+ exec "$@"
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+ # The image ships only the locked environment; pimm itself imports from the
3
+ # checkout that the entrypoint put on PYTHONPATH.
4
+ if ! python -c 'import importlib.util, sys; sys.exit(0 if importlib.util.find_spec("pimm") else 1)'; then
5
+ echo 'error: no pimm checkout found; run from inside a pimm clone' >&2
6
+ echo '(for example: docker run --rm --gpus all -v "$PWD:$PWD" -w "$PWD" <image> pimm ...)' >&2
7
+ exit 1
8
+ fi
9
+ exec python -m pimm.cli "$@"
@@ -0,0 +1,23 @@
1
+ changelog:
2
+ exclude:
3
+ labels:
4
+ - duplicate
5
+ - invalid
6
+ - question
7
+ - wontfix
8
+ categories:
9
+ - title: Breaking changes
10
+ labels:
11
+ - breaking-change
12
+ - title: Features and improvements
13
+ labels:
14
+ - enhancement
15
+ - title: Fixes
16
+ labels:
17
+ - bug
18
+ - title: Documentation
19
+ labels:
20
+ - documentation
21
+ - title: Other changes
22
+ labels:
23
+ - '*'
@@ -0,0 +1,277 @@
1
+ """Run the pimm test suite on Modal GPUs for trusted branch commits.
2
+
3
+ GitHub-hosted runners have no GPU, so this app ships the committed checkout to
4
+ Modal, builds the locked wheel-based environment (no native compile), primes a
5
+ shared volume with the commit-pinned PILArNet-M-mini dataset and released
6
+ models, and runs the shared pytest suite on CPU plus A100, L40S, and H100 workers.
7
+
8
+ Run locally with:
9
+
10
+ uvx modal run .github/scripts/modal_ci.py
11
+
12
+ Set PIMM_IMAGE to validate a published application image instead of the
13
+ checkout; the suite then runs in the image's venv with the checkout mounted,
14
+ mirroring how containerized jobs use the image:
15
+
16
+ PIMM_IMAGE=youngsm/pimm:pytorch2.10.0-cuda12.6 uvx modal run .github/scripts/modal_ci.py
17
+ """
18
+
19
+ import json
20
+ import os
21
+ import subprocess
22
+ from pathlib import Path
23
+
24
+ import modal
25
+
26
+
27
+ # remote containers re-import this module from a shallower path; PIMM_IMAGE
28
+ # reaches them through the baked image env, so both sides resolve one layout
29
+ _here = Path(__file__).resolve()
30
+ REPO_ROOT = _here.parents[2] if len(_here.parents) > 2 else _here.parent
31
+ PIMM_IMAGE = os.environ.get("PIMM_IMAGE", "")
32
+ if PIMM_IMAGE:
33
+ # the published image ships only the venv; the checkout is mounted at the
34
+ # image's default bind point, mirroring how jobs run it
35
+ REMOTE_ROOT = "/opt/pimm/src"
36
+ VENV = "/opt/pimm/.venv"
37
+ else:
38
+ REMOTE_ROOT = "/opt/pimm"
39
+ # venv lives outside the copied source dir: writes under an add_local_dir
40
+ # target during a build function do not persist into the image layer
41
+ VENV = "/opt/pimm-venv"
42
+ DATA_ROOT = "/opt/pimm-data/pilarnet"
43
+ HF_CACHE = "/opt/pimm-data/hf-cache"
44
+ MANIFEST = "tests/integration/fixtures/metric_baselines.json"
45
+
46
+ UV_VERSION = "0.11.28"
47
+ INTEGRATION_TIMEOUT = 1800
48
+ OUTPUT_TAIL = 8000
49
+
50
+ RUNTIME_ENV = {
51
+ "HF_HUB_DISABLE_XET": "1",
52
+ "PILARNET_DATA_ROOT_V2": DATA_ROOT,
53
+ "HF_HUB_CACHE": HF_CACHE,
54
+ "PIMM_IMAGE": PIMM_IMAGE,
55
+ "PIMM_TEST_DATA_ROOT": DATA_ROOT,
56
+ "PYTHONPATH": REMOTE_ROOT,
57
+ "UV_PROJECT_ENVIRONMENT": VENV,
58
+ "WANDB_MODE": "disabled",
59
+ }
60
+
61
+
62
+ def _sync_environment():
63
+ """Install the locked environment (plus the dev group) into the image.
64
+
65
+ A build function rather than a run_commands layer: uv's ``--locked`` check
66
+ passes in the function sandbox but rejects the lock in a build layer.
67
+ In image mode this re-verifies the published image's venv against its
68
+ lockfile and adds pytest on top.
69
+ """
70
+ command = ["uv", "sync", "--locked", "--group", "dev"]
71
+ if PIMM_IMAGE:
72
+ # keep the published venv project-free; the suite imports the mounted
73
+ # checkout through PYTHONPATH, matching how jobs use the image
74
+ command.append("--no-install-project")
75
+ subprocess.run(
76
+ command,
77
+ cwd=REMOTE_ROOT,
78
+ env={
79
+ **os.environ,
80
+ "UV_PROJECT_ENVIRONMENT": VENV,
81
+ "UV_CACHE_DIR": "/tmp/uv-cache",
82
+ },
83
+ check=True,
84
+ )
85
+
86
+
87
+ data_volume = modal.Volume.from_name("pimm-ci-data", create_if_missing=True)
88
+ VOLUMES = {"/opt/pimm-data": data_volume}
89
+
90
+
91
+ if PIMM_IMAGE:
92
+ # validate the published application image: run the suite against its baked
93
+ # source and venv. The env layer comes first so _sync_environment (which
94
+ # re-imports this module) sees PIMM_IMAGE and resolves the image-mode paths.
95
+ image = (
96
+ modal.Image.from_registry(PIMM_IMAGE, add_python="3.10")
97
+ .apt_install("git")
98
+ # not pip_install: the image's PATH resolves `python` to its pip-less
99
+ # uv venv, so target Modal's interpreter explicitly
100
+ .run_commands(
101
+ f"/usr/local/bin/python -m pip install huggingface_hub uv=={UV_VERSION}"
102
+ )
103
+ .add_local_dir(
104
+ REPO_ROOT,
105
+ REMOTE_ROOT,
106
+ copy=True,
107
+ ignore=[
108
+ ".git",
109
+ ".venv",
110
+ ".venv*",
111
+ "**/__pycache__",
112
+ "**/*.pyc",
113
+ "**/build",
114
+ "**/*.egg-info",
115
+ "**/*.so",
116
+ "docs/build",
117
+ ],
118
+ )
119
+ .env(RUNTIME_ENV)
120
+ .run_function(_sync_environment)
121
+ )
122
+ else:
123
+ image = (
124
+ # base CUDA/cuDNN must match the locked torch stack (torch 2.10.0, cu126)
125
+ modal.Image.from_registry(
126
+ "pytorch/pytorch:2.10.0-cuda12.6-cudnn9-devel",
127
+ add_python="3.10",
128
+ )
129
+ .apt_install("git")
130
+ .pip_install("huggingface_hub", f"uv=={UV_VERSION}")
131
+ .add_local_dir(
132
+ REPO_ROOT,
133
+ REMOTE_ROOT,
134
+ copy=True,
135
+ ignore=[
136
+ ".git",
137
+ ".venv",
138
+ ".venv*",
139
+ "**/__pycache__",
140
+ "**/*.pyc",
141
+ "**/build",
142
+ "**/*.egg-info",
143
+ "**/*.so",
144
+ "docs/build",
145
+ ],
146
+ )
147
+ .run_function(_sync_environment)
148
+ .env(RUNTIME_ENV)
149
+ )
150
+
151
+ app = modal.App("pimm-ci", image=image)
152
+
153
+
154
+ @app.function(volumes=VOLUMES, timeout=INTEGRATION_TIMEOUT)
155
+ def prime_cache():
156
+ """Populate the shared dataset/model volume, verifying every hash.
157
+
158
+ A regular function on a volume rather than an image build step: baking
159
+ the data into an image layer proved unreliable (a mid-build container
160
+ restart committed a layer without the downloaded files), and the volume
161
+ survives image rebuilds so the data downloads only once.
162
+ """
163
+ import hashlib
164
+
165
+ from huggingface_hub import hf_hub_download, snapshot_download
166
+
167
+ manifest = json.loads(Path(REMOTE_ROOT, MANIFEST).read_text())
168
+ dataset = manifest["dataset"]
169
+
170
+ for filename, info in dataset["files"].items():
171
+ path = Path(DATA_ROOT, filename)
172
+ expected_sha256 = info["sha256"]
173
+ digest = (
174
+ hashlib.sha256(path.read_bytes()).hexdigest()
175
+ if path.is_file()
176
+ else None
177
+ )
178
+ if digest != expected_sha256:
179
+ if digest is not None:
180
+ print(f"Refreshing stale dataset fixture: {filename}")
181
+ hf_hub_download(
182
+ repo_id=dataset["repo_id"],
183
+ repo_type=dataset["repo_type"],
184
+ revision=dataset["revision"],
185
+ filename=filename,
186
+ local_dir=DATA_ROOT,
187
+ force_download=True,
188
+ )
189
+ digest = hashlib.sha256(path.read_bytes()).hexdigest()
190
+ if digest != expected_sha256:
191
+ raise SystemExit(f"sha256 mismatch for {filename}: {digest}")
192
+
193
+ for baseline in manifest["baselines"].values():
194
+ repo_id = baseline["model_uri"].removeprefix("hf://").split("@", 1)[0]
195
+ snapshot_download(
196
+ repo_id=repo_id,
197
+ revision=baseline["model_revision"],
198
+ cache_dir=HF_CACHE,
199
+ )
200
+ data_volume.commit()
201
+
202
+
203
+ def _pytest(*args):
204
+ """Run pytest with the given args in the locked environment and report the result."""
205
+ result = subprocess.run(
206
+ ["uv", "run", "--no-sync", "pytest", "-v", *args],
207
+ cwd=REMOTE_ROOT,
208
+ capture_output=True,
209
+ text=True,
210
+ )
211
+ output = result.stdout + result.stderr
212
+ print(output)
213
+ return {"returncode": result.returncode, "tail": output[-OUTPUT_TAIL:]}
214
+
215
+
216
+ # single-GPU cells skip the distributed tests; the A10:2 cell runs only those
217
+ SINGLE_GPU_ARGS = ("tests/integration", "-m", "not distributed")
218
+
219
+
220
+ @app.function()
221
+ def unit():
222
+ return _pytest("tests/unit")
223
+
224
+
225
+ @app.function(gpu="A100", timeout=INTEGRATION_TIMEOUT, volumes=VOLUMES)
226
+ def integration_a100():
227
+ return _pytest(*SINGLE_GPU_ARGS)
228
+
229
+
230
+ @app.function(gpu="L40S", timeout=INTEGRATION_TIMEOUT, volumes=VOLUMES)
231
+ def integration_l40s():
232
+ return _pytest(*SINGLE_GPU_ARGS)
233
+
234
+
235
+ @app.function(gpu="H100", timeout=INTEGRATION_TIMEOUT, volumes=VOLUMES)
236
+ def integration_h100():
237
+ return _pytest(*SINGLE_GPU_ARGS)
238
+
239
+
240
+ @app.function(gpu="A10:2", timeout=INTEGRATION_TIMEOUT, volumes=VOLUMES)
241
+ def integration_distributed():
242
+ return _pytest("tests/integration", "-m", "distributed")
243
+
244
+
245
+ @app.local_entrypoint()
246
+ def main():
247
+ # the shared data volume must be primed before any integration cell starts
248
+ prime_cache.remote()
249
+
250
+ # image mode certifies one published artifact; the full GPU matrix already
251
+ # ran against the same commit through the checkout-based suite
252
+ calls = {
253
+ "cpu-unit": unit.spawn(),
254
+ "a100-integration": integration_a100.spawn(),
255
+ }
256
+ if not PIMM_IMAGE:
257
+ calls.update(
258
+ {
259
+ "l40s-integration": integration_l40s.spawn(),
260
+ "h100-integration": integration_h100.spawn(),
261
+ "a10x2-distributed": integration_distributed.spawn(),
262
+ }
263
+ )
264
+ results = {name: call.get() for name, call in calls.items()}
265
+
266
+ failed = []
267
+ for name, result in results.items():
268
+ status = "PASS" if result["returncode"] == 0 else "FAIL"
269
+ print(f"[{status}] {name} (returncode={result['returncode']})")
270
+ if result["returncode"] != 0:
271
+ print(result["tail"])
272
+ failed.append(name)
273
+
274
+ target = PIMM_IMAGE or "the checkout"
275
+ if failed:
276
+ raise SystemExit(f"modal ci failed for {target}: " + ", ".join(sorted(failed)))
277
+ print(f"modal ci passed for {target} on: " + ", ".join(sorted(calls)))