Closed pixelspark closed 2 years ago
This PR now also includes logic to skip identity ops altogether (when they are followed by some other op) by stringing together the input of the identity op and the input of the next op. The copy shader is still executed when an identity op is last, or is the only op in the graph (tested by the additional test). Fixes #33
Would it be possible to just skip the node?. The thing is by passing on the next node. There is a chance that we miss on some sequence optimisiation.
Would it be possible to just skip the node?. The thing is by passing on the next node. There is a chance that we miss on some sequence optimisiation.
Technically the current implementation already skips the node, only it does so inside the sequencer. Are you suggesting to instead add a preprocessing step before we feed the model into the sequencer, which removes these nodes (by editing the ModelProto basically)? Fine with me (just a little bit more fiddly I guess), I can have a go at this later hopefully.
Ok, i'm fine with the current implementation for now.
Yeah, adding a new step is going to be a lot of dev. Let's keep it simple for now.
Shall i merge?
Ok, i'm fine with the current implementation for now.
Yeah, adding a new step is going to be a lot of dev. Let's keep it simple for now.
Shall i merge?
Agreed, let's merge this, it's complicated enough already 👍
These ops appear to only change shape (which we don't care about as we require the dimensions to be inferred up front anyway), not data. Squeeze was already there so I added Unsqueeze and Identity as well.
We should probably not bother copying data between buffers but have a step in the compiler that simply aliases buffers, i.e. in
input_a -> Identity -> SomeOtherOp
, theSomeOtherOp
should just takeinput_a
as input rather than the output from identity (which we then won't generate).