Closed toelli-msft closed 2 years ago
[Now rebased]
Interestingly, the version using if
is as fast as the version using masking, when these new compiler flags are on (c8aea069c857c089bd916e6c6d77bd69a004cd75)
Cool! Do we think that float is more than 2x the speed of double? I realize that's not easily checkable from here, just wondering.
Looks like it, based on the difference between these two (from https://github.com/microsoft/knossos-ksc/pull/877). PyTorch backwards goes from 3.4ms on float64
to 1.3ms on float32
, which is a bit more than 2x faster. That would be consistent with vectorisation.
float64
float32
We still have great performance post https://github.com/microsoft/knossos-ksc/pull/931/files
We still have great performance post https://github.com/microsoft/knossos-ksc/pull/931/files
Tables updated above?
Tables updated above?
I'm not sure what you mean, but if you're asking whether the tables above have been updated to show performance after https://github.com/microsoft/knossos-ksc/pull/931/files was merged, then no, they haven't been updated. Here are such tables though:
(86af4427236297713424a21f88c5806279c31686)
This allows to set compiler flags for the compilation of embedded C++ and KS benchmarks. See https://github.com/microsoft/knossos-ksc/pull/942#issuecomment-880665282 for up-to-date benchmark numbers. Most important feature of benchmark: with the right compiler flags
if
is as fast as masking (and they're both a bit faster than PyTorch)!This PR introduces the
CFlags
class for bundling together compiler flags we might feed togcc
orcl
. It's a bit hokey but seems to strike a good balance between simplicity and robustness. An alternative could be to pass around flags for both compilers separately, but that's rather messy and not robust to adding a new compiler in the future.Old
As of 207d412f6b8885dfa8a9272443d6929eff1f6c91 we get a 10%-30% improvement by using compiler flags (
-march=native- -funroll-loops -ffast-math -mprefer-vector-width=512
. I don't (yet) know which specific flags here make the difference.).