Port the frozen and CUDA finders to FastPedestal
Build on RHEL8 / build (push) Successful in 3m38s
Build on RHEL9 / build (push) Successful in 3m49s
Run tests using data on local RHEL8 / build (push) Successful in 4m46s

- main moved ClusterFinder to FastPedestal and dropped Pedestal's
  push_fast/get_sum/get_sum2, which ClusterFinderFrozen and both CUDA
  drivers still called.

- Move all three to FastPedestal. Its uniform sample count is what the
  CUDA kernel already assumes, and matching ClusterFinder keeps CPU and
  GPU warm-up identical, which ClusterFinderFrozen exists to verify.
  FastPedestal gains get_sum/get_sum2 to de-interleave its internal
  Entry{sum,sum2} for the CUDA upload.

- Also expose min_pedestal_samples on these constructors and factories,
  make the factories keyword-only after image_size. Same API in C++ and Python.
This commit is contained in:
kferjaoui committed 2026-09-23 15:54:16 +02:00
1 parent 7a8f918a56
commit d9bead2a07
10 files changed
+128 -47

No files matched your search

+23 -12
View File
@@ -88,7 +88,7 @@
"# reached, which is how you size this for a new dataset.\n",
"CAP = 3000\n",
"\n",
"capacity = 10_000 # initial ClusterVector capacity, CPU side\n",
"capacity = 3_000 # initial ClusterVector capacity, CPU side\n",
"N_BINS = 200\n",
"E_MIN, E_MAX = -2, 4000 # spectrum range, ADU\n",
"\n",
@@ -113,12 +113,12 @@
"outputs": [],
"source": [
"cf_cpu = ClusterFinderMT(image_size, cluster_size, n_sigma=N_SIGMA,\n",
" capacity=capacity, n_threads=N_THREADS)\n",
" capacity=capacity, min_pedestal_samples=n_frames_pd, n_threads=N_THREADS)\n",
"sink = ClusterCollector(cf_cpu)\n",
"\n",
"cf_cuda = ClusterFinderCUDA(image_size, cluster_size, n_sigma=N_SIGMA,\n",
" max_clusters_per_frame=CAP, n_streams=N_STREAMS, \n",
" time_kernels=False, algorithm=\"fixed_window\")"
" n_pedestal_frames=n_frames_pd, algorithm=\"fixed_window\", time_kernels=False)"
]
},
{
@@ -175,7 +175,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Reading 100000 frames: 82.39s (1,214 FPS, 32.00 GB at 0.39 GB/s)\n"
"Reading 100000 frames: 5.20s (19,219 FPS, 32.00 GB at 6.15 GB/s)\n"
]
}
],
@@ -207,14 +207,14 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████████████████████████████████████████████| 100000/100000 [00:23<00:00, 4191.14it/s]\n"
"100%|██████████████████████████████████████████████████████████████| 100000/100000 [00:23<00:00, 4310.91it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU MT (24 threads): 23.86s 4,190 FPS 233,099,227 clusters (2331.0/frame)\n"
"CPU MT (24 threads): 23.20s 4,310 FPS 233,099,227 clusters (2331.0/frame)\n"
]
}
],
@@ -253,10 +253,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"id": "cuda",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CUDA batched: 3.18s 31,484 FPS 233,093,554 clusters (2330.9/frame)\n",
" input pinned in 0.84s, once, outside the loop\n",
" vs CPU: 7.30x\n",
" peak clusters in one frame: 2,545 of CAP 3,000\n"
]
}
],
"source": [
"t0 = time.perf_counter()\n",
"cf_cuda.register_input_buffer(data)\n",
@@ -309,10 +320,10 @@
"output_type": "stream",
"text": [
" s FPS us/frame clusters\n",
"CPU MT (24 thr) 23.86 4,190 238.6 233,099,227\n",
"CUDA batched 3.34 29,926 33.4 233,093,554\n",
"CPU MT (24 thr) 23.20 4,310 232.0 233,099,227\n",
"CUDA batched 3.18 31,484 31.8 233,093,554\n",
"\n",
"speedup: 7.14x\n"
"speedup: 7.30x\n"
]
}
],
@@ -429,7 +440,7 @@
" genuine add / drop 31,395 25,871\n",
"\n",
"frames touched by a genuine difference: 41,569 of 100,000\n",
"[40.6s]\n"
"[40.2s]\n"
]
}
],