microsoft / knossos-ksc

Compiler with automatic differentiation
Other
45 stars 10 forks source link

Use sum in sqrl instead of mean #975

Closed toelli-msft closed 2 years ago

toelli-msft commented 2 years ago

in a place where the two have the same effect but sum is likely to be faster. There is a lot of noise in the benchmarks so it's not completely obvious it is faster.

Fixes https://github.com/microsoft/knossos-ksc/issues/967

I don't understand why a version of aten::sum with an extra (Tuple) argument is required.

awf commented 2 years ago

Yes, makes sense. aten has a huge number of signatures for each function, with different optional arguments. We supply a separate implementation for each concrete signature. Of course we can commmon up our implementations, but when we do this for real, we will just autogenerate like in https://github.com/nunoplopes/torchy/blob/a8aab1ae5a04c0c1bcbb96b0b02dc6470fb19500/autogen/dispatch_wrappers.h#L7236