Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Autotuning example clblast
[ Home ]
Table of Contents
Collective Knowledge workflow framework let us abstract autotuning from underlying programs and continuously changing platforms (see CK-powered compiler autotuning wiki and portable CK workflows). It also allows the community to share various multi-objective autotuning scenarios, crowdsource autotuning across diverse hardware provided by volunteers, and share results in a unified and reusable way.
Based on requests from our colleagues and CK users, we implemented CK autotuning and crowd-tuning scenario for CLBlast library (OpenCL-based BLAS library) as a part of our long term community initiative to make machine-learning based optimization practical (see P1, P2 and P3 for more details).
We expect that you have CK framework already installed on your Windows, Linux or MacOS-based machine.
We suggest you to update already installed CK repositories via
$ ck pull all
You can install CK repository with CLBlast library and CK crowd-tuner as follows:
$ ck pull repo:ck-math $ ck pull repo:ck-crowdtuning
You can invoke CLBlast crowd-tuning via CK (which will in turn download and build CLBlast for your platform and run CK wrapper around internal CLBlast tuner) as follows:
$ ck crowdtune clblast or $ ck crowdsource experiment.tune.opencl.clblast
Depending on your platform, CLBlast tuner may run from several minutes to several hours so please be patient!
Best results (optimization parameters and GFLOPs) for your platform will be shared at http://cKnowledge.org/repo . Just select "auto/crowd-tune OpenCL-based CLBlast (GFLOPs)". You can open web browser with these results as follows:
ck browse experiment.tune.opencl.clblast
Note that default size of matrices (M,N,K) is 512x512x512, however you can change it as follows:
$ ck crowdtune clblast --m=1024 --n=1024 --k=1024
You can also optimize CLBlast library for any OpenCL-enabled Android device as follows:
$ ck crowdtune clblast --target_os=android21-arm64
You will just need to have Android NDK and SDK installed on your machine. See CK-powered compiler autotuning for more details.
You can see other available CK flags for crowdtuning as follows:
$ ck crowdsource experiment.tune.opencl.clblast --help
Finally, you can run local autotuning instead of crowd-tuning as follows:
$ ck autotune clblast
We are now working to convert internal CLBlast tuner to CK to let the community unify, customize and improve optimization strategies across diverse data sets shared by volunteers and enable run-time adaptation similar to P1, P2 and P3 - please stay tuned!
You are welcome to get in touch with the CK community if you have questions or comments!