Inability to benchmark the performance of KS code run from Python (except KS code generated by ts2ks). Without that ability it's hard to inspect the impact of potential optimisations that could be added to ksc.
Solution implemented
ksc_string_to_autograd_function allows embedding KS code in a Python source file (in a fairly low level way). conftest.py has been amended to support benchmarking such usages (for functions prefixed with <benchmarkname>_ks_embedded_).
Why solution should work
It is now straightforward to embed KS code in Python and benchmark it.
Completes ADO 19518. Supersedes #857 and https://github.com/microsoft/knossos-ksc/pull/859.
Problem addressed
Inability to benchmark the performance of KS code run from Python (except KS code generated by ts2ks). Without that ability it's hard to inspect the impact of potential optimisations that could be added to ksc.
Solution implemented
ksc_string_to_autograd_function
allows embedding KS code in a Python source file (in a fairly low level way).conftest.py
has been amended to support benchmarking such usages (for functions prefixed with<benchmarkname>_ks_embedded_
).Why solution should work
It is now straightforward to embed KS code in Python and benchmark it.
Results
Discussion
The API is quite low level. It may be possible to make a higher level API that's easier to use, but it will do for now.
It's not clear what the name for the
map f
derivativemap sufrev$f
should be (or even if we really need to give it a name).