Skip to content

JF: more strixels

David Hammer requested to merge jf-new-strixel into master

As discussed on Redmine and https://git.xfel.eu/calibration/planning/-/issues/195 we're getting more strixels.

Design decision: LUT

I currently feel like prebaking and shipping some simple LUTs is much more convenient than including custom Cython / CUDA kernels for each and every strixel transformation we meet. Therefore, I've used the reference Python implementations to generate flat LUTs with masks (see added tests for comparison) and then strixel transformation is just loading one of these and applying it. Bonus: one less Cython kernel to compile, one less CUDA kernel to maintain. Also it's plenty fast.

Brief test

Quick check in Karabo:

  • using arbitrary uncorrected data looking roughly like this: 2023-10-25T12_01_39.583097_image
  • cols_A0123 (HED strixels) makes it look like this: 2023-10-25T12_02_21.006475_image
  • rows_A1256 (SCS strixels) makes it look like this: 2023-10-25T12_03_01.464027_image

Should probably check with actual strixel data - preferably burst mode for better performance analysis. But as the test shows, the mapping should be the same as what the reference implementations yield. Also, on max-jhub, applying the rows_A1256 to 16 frames with a thread pool (which the CPU runner has anyway) takes less than 5 ms.

In my Karabo test, timing looked like this:

2023-10-25T12_05_00.433902_image

  1. GPU warmup time (pinned memory? caching?)
  2. GPU regular (keep in mind: no correction applied and single frame mode)
  3. GPU applying cols_A0123 (brief slowness while switching; here, the LUT was loaded)
  4. GPU applying rows_A1256 (somehow not noticeable hiccup when switching)
  5. CPU version also doing no corrections (though kernels are still run doing nothing interesting)
  6. CPU applying cols_A0123
  7. CPU applying rows_A1256

Masking non-standard size pixels

Non-standard size pixels (well, ones that are not like the other long ones) are not corrected. As discussed with Nuno and Marco, the ones on the border are cropped out and the ones between the ASICs are not handled (both of these in the version Nuno wrote). In the gaps between ASICs, the otherwise unset pixels get corrections.badPixels.maskingValue - this is done regardless of corrections.subsetToUse.NON_STANDARD_SIZE, because we don't want to send uninitialized data.

Future work

Nuno and Marco discussed a bit what to do with the very long strixels on the inner ASIC borders and the weird extra column of small strixels on the outermost ASIC borders. They agreed that, for an initial deployment, the former can be left masked rather than corrected and the latter can be cropped. Also, they didn't find it likely that we'll ever bother going back for these pixels.

Edited by David Hammer

Merge request reports