Warning, /jana2/docs/offloading.md is written in an unsupported language. File is not indexed.
0001
0002
0003
0004
0005 Work package: GPU arrows
0006 ------------------------
0007
0008 Problem: Arrows can only have _one_ next_input at any given time
0009 Solution:
0010 - GPU tasks can all be pushed by GPUArrow to _one_ queue per physical GPU
0011
0012 Design:
0013 - GPUMapArrow
0014 - Knows which factory needs the GPU
0015 - Knows which factories need to run upstream
0016 - Knows how to pack and unpack the offloaded data
0017
0018 - GPUTapArrow
0019 - Knows what to do with the packed input data. How does it know this?
0020 - Doesn't worry about pipelining the memory movement for now
0021
0022 - GPUFactory
0023 - I'm hoping we can reuse Inputs and Outputs for pack() and unpack(), because
0024 they need to be in the JEvent _somehow_
0025
0026
0027 Problem: GPUTapArrow doesn't know what to do! Needs some kind of indication of
0028 - What factory needs to be run on this thing?
0029 - What arrow (what queue, technically) does the JEvent need to be returned to?
0030
0031 One of the reasons this is a problem is because JEvent databundles are supposed to
0032 be immutable, so this cannot be a factory output. Probably has to be a separate
0033 field on the JEvent. Who sets this field, though? And via what interface?
0034
0035 Note that the GPUMapArrow knows the factory and output queue (which MIGHT just be
0036 its own input queue. Is this always the case?). Maybe GPUMapArrow should set this.
0037
0038 So what should this be? (databundle_name, next_input_queue).
0039 Quickly check whether next_input_queue is a arrow-local port index or a topology-wide queue id.
0040 - Sadly it is an arrow-local port index
0041 - The queue doesn't know it's own id
0042 - So it's the responsibility of the TopologyBuilder to inform the GPUTapArrow what the output queue index is
0043 - OR we only store the factoryname, and the GPUTapArrow looks up the correct port index for the given factoryname
0044
0045 Problem:
0046 I'm not sure if the concept of a continuation name is general enough to stick onto JEvent. Let's
0047 think about the calibration workflow a little more. That might require re-running factories that have already run,
0048 which poses a problem for immutability, but which we might be able to solve via event levels.
0049
0050
0051 Suppose I unroll the loop and avoid having continuations. What a relief! Now each GPUTapArrow knows exactly what to do.
0052 However, now I need to do a lot more in my JTopologyBuilder (to figure out this unroll) and my scheduler needs to enforce
0053 mutual exclusion _across_ arrows. Both of these are very unpleasant to implement. I might need them eventually. But not today.
0054
0055
0056 Resuming this!
0057 Goal: Check whether I call Preprocess on a JFactory
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072