You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
};
`
Consider this: calling Example2Generator five times takes several times longer than calling Example1Generator once. Is this because the input to output dimensionality increased? What if my requirement necessitates going from low-dimensional input to high-dimensional output?
The text was updated successfully, but these errors were encountered:
It's nothing to do with dimensionality. It's because calling Example2Generator five times reads the input from memory five times, and calling Example1Generator once reads the input from memory once (and then does five things with it). You'd see the same effect in C.
In Example1Generator the innermost dimension in memory of the output buffer is 'c'. That's a small dimension - probably length five in practice given that you're muxing together five things. That means any use of SIMD (vectorization) is going to need to do a strided store to memory instead of a dense vector store, which is very bad for performance.
So if Example1Generator is slow it's probably due to the memory layout of your output buffer. It looks like you're using an autoscheduler, but this is not something an autoscheduler can help with because the memory layout of the output buffer is controlled by the caller.
A fast version of Example1Generator would look like:
`class Example1Generator : public Generator
{
public:
Input<Buffer<uint8_t, 2>> input{"input"};
Output<Buffer<uint8_t, 3>> output{"output"};
};
class Example2Generator : public Generator
{
public:
Input<Buffer<uint8_t, 2>> input{"input"};
Output<Buffer<uint8_t, 2>> output{"output"};
};
`
Consider this: calling Example2Generator five times takes several times longer than calling Example1Generator once. Is this because the input to output dimensionality increased? What if my requirement necessitates going from low-dimensional input to high-dimensional output?
The text was updated successfully, but these errors were encountered: