This site contains documentation for v0.2 of the Intrepydd programming system being developed in the DDARING research project with contributors from Georgia Tech, UIUC, U.Michigan, and USC. Intrepydd is a Python-based domain-specific programming language for data analytics kernels, suitable for ahead-of-time compilation on current and future hardware platforms and accelerators. Intrepydd is not intended for writing complete/main programs. This release (v0.2) contains an implementation of an early version of the Intrepydd language. We welcome feedback from testers of this release; your feedback will influence future enhancements to the Intrepydd language, its implementation, and its documentation.
As mentioned earlier, our current interest is in using Energy-Delay-Squared (EDS) product, in units of Joules-seconds^2, as a performance goal metric. To that end, Intrepydd includes APIs to compute estimates of this metric, so that testers can work on improving the metric as they refine their implementations of Intrepydd code. These APIs access hardware performance monitors (HPMs), which usually require running the docker container in privileged mode. Intrepydd testers just call the high level APIs, and not need be aware of the details of the HPM accesses performed by the APIs. Further, the docker container should be run in single-tenancy mode so as to avoid the possibility of other jobs perturbing performance evaluations of the Intrepydd code.
There are four APIs that need to be used to obtain goal metrics:
Note: Every perf_api.start_metric() call must have a perf_api.stop_metric call associated with it. Nesting calls or missing stop calls will result in erroneous outputs.
The API internally rely on PAPI (The Performance API) and Linux Perf. These should already be bundles within the Docker container provided to you. If not, please install the pre-requisite packages before going on to next steps. Before you can use the performance model, you must compile it. Do the following:
$ export PAPI_INCLUDE=/usr/include/papi.h
$ export PAPI_LIB=/usr/lib/x86_64-linux-gnu/libpapi.so
$ export PFM_LIB=/usr/lib/x86_64-linux-gnu/libpfm.so
$ export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:$PAPI_INCLUDE
$ export LD_PRELOAD=$LD_PRELOAD:$PAPI_LIB:$PFM_LIB
$ export PYTHONPATH=$PYTHONPATH:$PWD
'/intrepydd/compiler/pyddc perf_api.cpp'
$ cd sample
$ ../../compiler/pyddc matopt_kernel.pydd
$ python matopt_pydd_main.py
You should see a output similar to the one below (Numbers may be different):
ESTIMATED ENERGY = 0.396943
ESTIMATED DELAY = 1.25747
ENERGY-DELAY-SQUARED METRIC = 0.627656
Once the Performance Model has been built, it can be used in any intrepydd program.
To import the perf model in your main files, you can add an import perf_api
statement along with other imports.
The code snippet below demonstrates the API usage in an Intrepydd program:
import perf_api
perf_api.init_metric() # Once at very beginning
perf_api.start_metric() # Every time at start of a kernel
r = matopt.inner_product(v1, v2)
perf_api.stop_metric() # Every time at end of a kernel
perf_api.print_metric() # Once at very end