Code Monkey home page Code Monkey logo

ctuning / ck-autotuning Goto Github PK

View Code? Open in Web Editor NEW
57.0 14.0 21.0 22.94 MB

CK automation actions to let users implement portable, customizable and reusable program workflows for reproducible, collaborative and multi-objective benchmarking, optimization and SW/HW co-design:

Home Page: https://CodeReef.ai/portal/c/program

License: BSD 3-Clause "New" or "Revised" License

Shell 1.75% Python 88.55% C 6.98% Cuda 0.49% Batchfile 1.68% HTML 0.17% Roff 0.01% C++ 0.11% Java 0.15% Fortran 0.11%
autotuning statistical-analysis multiple-dimensions multiple-objectives json-api pareto python portable-workflows linux windows

ck-autotuning's People

Contributors

chunosov avatar clappis avatar ctuning-admin avatar dsavenko avatar ens-lg4 avatar gfursin avatar psyhtest avatar sztaylor avatar taskset avatar tomerpaz76 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ck-autotuning's Issues

Autotuning on Windows (using Microsoft Compilers) fails when md5sum is unavailable

Running a compile program on Windows e.g.

$ ck compile program:tool-print-cuda-devices

fails with "md5sum is not recognized as an internal or external command..."

I've nearly solved it by downloading "File Checksum Integrity Verifier" (fciv.exe) from Microsoft into ~CK/ck/bin and placing a file md5sum.bat there:

fciv.exe -md5 %1

But the Microsoft tool prints a comment before the actual checksum:

//
// File Checksum Integrity Verifier version 2.05.
//
2a084556e80926ce59f81cd51520ae08 a.exe

If this is an acceptable solution, CK should ignore the lines starting with //.

Add "ck test program"

Add functionality to compile and run program with each available data set and data set file for testing ...

Additional support for 'target' in program module

My issue: I have added a new android machine to my local ck repo. I want to use the update_target_os_dict key inside the machines meta file to update the adb commands to connect via an adb server. This seems to work when I use 'ck run program:...' but when I use 'ck pipeline program:...' I get some issues. The problems relate to the 'target' not being passed to some actions in the program module such as set_freq. These actions seem to handle being passed a 'target' and extracting the device_cfg from it.
I have attached a patch which seems to fix the current issues I am seeing. Hopefully you're happy with the changes?

Thanks,
Stuart

program_module.patch.txt

target not passed to platform.gpgpu detect in program/module

Hi all,

I am using the machine update_target_os_dict parameter to override some target_os parameters. Unfortunately program/module.py was not passing the target when calling platform.gpgpu detect which meant that the update_target_os_dict overrides were not available. This is only an issue for programs which use the need_compute_device flag. The detect action does accept a target parameter so I've provided a patch which provides it to the action if not empty.

Note: I have only tested this when passing a target to the pipeline.

Let me know if you require more information for testing etc.
platform_gpgpu_detect_with_target.patch.txt

Regards,
Stuart

Problem with shared libs compiling or linking on Mac OS (OSX)

Hi,

Looks like there is a problem with compiling or linking shared libs while doing ck run program on OSX. I do compile and get this:

$ ck compile program:cbench-automotive-susan

***************************************************************************************
Current directory: /Users/dsavenko/CK/ctuning-programs/program/cbench-automotive-susan/tmp
***************************************************************************************

Resolving software dependencies ...

*** Dependency 1 = compiler (C compiler):

    Resolved. CK environment UID = 2a0247258e6fae60 (detected version 3.8.0)

*** Dependency 2 = xopenme (xOpenME library):

    Resolved. CK environment UID = 0dc79501048b7bb2

***************************************************************************************
Detected compiler version: 3.8.0

***************************************************************************************
Compiler vars:
  XOPENME=
***************************************************************************************

Executing prepared batch file tmp-5qVXpo.sh ...

clang -c   -I../ -DXOPENME -I/Users/dsavenko/si/checker/include -I/Users/dsavenko/CK-TOOLS/lib-rtl-xopenme-0.3-llvm-3.8.0-macos-64/include  ../susan.c  -o susan.o
../susan.c:688:9: warning: implicit conversion from 'double' to 'TOTAL_TYPE' (aka 'int') changes value from 0.1 to 0 [-Wliteral-conversion]
  total=0.1; /* test for total's type */
       ~^~~
1 warning generated.
clang    susan.o  -o a.out    -L/Users/dsavenko/CK-TOOLS/lib-rtl-xopenme-0.3-llvm-3.8.0-macos-64/lib -lrtlxopenme -lm
***************************************************************************************
Compilation time: 0.201 sec.; Object size: 47244; MD5: 

(Note there's no MD5 hash which is unusual)

Then, I do run:

$ ck run program:cbench-automotive-susan


OS CK UOA:            macos-64 (fb7d7f63b44b9ea3)

OS name:              Mac OS X 10.11.6
Short OS name:        Darwin 15.6.0
Long OS name:         Darwin-15.6.0-x86_64-i386-64bit
OS bits:              64

Platform init UOA:    42818da3a0789331
***************************************************************************************
Current directory: /Users/dsavenko/CK/ctuning-programs/program/cbench-automotive-susan/tmp

Reloading depedencies from compilation tmp-deps.json ...
***************************************************************************************

Resolving software dependencies ...

*** Dependency 1 = compiler (C compiler):

    Resolved. CK environment UID = 2a0247258e6fae60 (detected version 3.8.0)

*** Dependency 2 = xopenme (xOpenME library):

    Resolved. CK environment UID = 0dc79501048b7bb2


More than one commmand line is found to run this program:

0) corners ($#BIN_FILE#$ $#dataset_path#$$#dataset_filename#$ tmp-output.tmp -c)
1) edges ($#BIN_FILE#$ $#dataset_path#$$#dataset_filename#$ tmp-output.tmp -e)
2) smoothing ($#BIN_FILE#$ $#dataset_path#$$#dataset_filename#$ tmp-output.tmp -s)

Select command line (or Enter to select 0): 

More than one dataset entry is found for this program:

0) image-pgm-0001 (b2130844c38e4a56)
1) image-pgm-clean-gray-square-600-450-8 (c5a378cde441bbb7)
2) image-pgm-from-pamela-100 (d11ad4b49f2b9f45)

Select dataset UOA (or Enter to select 0): 
  Cleaning output files and directories:
    tmp-output1.tmp
    tmp-output2.tmp
    tmp-output.tmp
    tmp-ck-timer.json

***************************************************************************************
### Calibration 1 out of 10 ; Kernel repeat number = 1
***************************************************************************************
***************************************************************************************
Prepared script:

#! /bin/bash


export PATH=/Users/dsavenko/CK/ck-env/platform.init/generic-linux:$PATH


. /Users/dsavenko/CK/local/env/2a0247258e6fae60/env.sh
. /Users/dsavenko/CK/local/env/0dc79501048b7bb2/env.sh

. /Users/dsavenko/CK/local/env/2a0247258e6fae60/env.sh 1

export CT_REPEAT_MAIN=1


export CK_DATASET_PATH=/Users/dsavenko/CK/ctuning-datasets-min/dataset/image-pgm-0001/

export CK_DATASET_FILENAME=data.pgm

echo    executing code ...
 ./a.out /Users/dsavenko/CK/ctuning-datasets-min/dataset/image-pgm-0001/data.pgm tmp-output.tmp -c > tmp-output1.tmp 2> tmp-output2.tmp

***************************************************************************************
  (bash -c "chmod 755 ./tmp-i7Rhe2.sh; . ./tmp-i7Rhe2.sh")

  (sleep 0.5 sec ...)

  (run ...)
executing code ...
./tmp-i7Rhe2.sh: line 20: 20215 Trace/BPT trap: 5       ./a.out /Users/dsavenko/CK/ctuning-datasets-min/dataset/image-pgm-0001/data.pgm tmp-output.tmp -c > tmp-output1.tmp 2> tmp-output2.tmp

  (reading fine grain timers from tmp-ck-timer.json ...)


Program execution likely failed (can't find fine grain timers)!

Stderr (the tmp-output2.tmp file) contains this:

dyld: Library not loaded: librtlxopenme.so
  Referenced from: /Users/dsavenko/CK/ctuning-programs/program/cbench-automotive-susan/tmp/./a.out
  Reason: image not found

The problem reproduces for each program with shared dependencies.

I suspect the library either compiled improperly (e.g. this is no .dylib file), or there may be a problem with linking.

failed tests

Hi @ens-lg4. I just noticed that tests fail on this repo - is it possible to check what is happening, please? Thanks a lot!

Propagate the "--sudo" flag to the new compute detection widget

On one of my platforms, OpenCL programs only run under super user e.g.

# ck run program:arm-mali-sgemm

It used to be the case that OpenCL programs could be launched under normal user with the --sudo flag:

$ ck run program:arm-mali-sgemm --sudo

Not anymore. It appears that CK doesn't propagate the --sudo flag to the new widget for detecting the compute platform and devices (itself an OpenCL program).

Proposal: templates for programs

Currently in order to make a new program we have to make a copy of some existed one to get non-empty meta populated with correct values: compiler dep, run-time entry and so on.

ck cp some-repo:program:some-cpp-program some-repo:program:another-cpp-program

It would be nice to have some templates, so one could call:

ck add some-repo:program:new-cpp-program --template=cpp

and get correct meta, initial source file, and may be even readme.

Just after previous command, one could call

ck compile new-cpp-program
ck run new-cpp-program

and this should be working and producing some dummy output.

Throw an error before working long hours

Reported by @w-simon . The last fix caused problems in other pipelines, so I reverted the patch and we need to check where the problem happens. To reproduce:

We test according to the method described in the documentation(https://github.com/ctuning/ck/wiki/Autotuning).

$ rm _setup_program_pipeline_tmp.json
$ ck pipeline program:cbench-automotive-susan --cmd_key=edges --compiler_description_uoa=gcc-44x --prepare --save_to_file=_setup_program_pipeline_tmp.json
$ ck autotune pipeline:program pipeline_from_file=_setup_program_pipeline_tmp.json record=yes
The program runs for a while, but at the end, this error occurs:

CK error: [pipeline] meta is not defined - can't aggregate!

Enabling remote execution on Windows (desktop,laptop,mobile)

We currently have support to compile code for Android devices and run them there via

$ ck pull repo:ctuning-programs
$ ck compile program:cbench-automotive-susan --target_os=android19-arm --speed
$ ck run program:cbench-automotive-susan --target_os=android19-arm

It requires Android NDK and SDK installed, as well as device connected via ADB to a host with CK.
CK then takes meta information of ''os:android19-arm'' to understand how to copy data sets, binaries and other files to the device, run them, collect stats and other files and send them back to the host.

We would like to do something similar for Windows-based devices (mobile phone or laptop/deskop) via simple CK node (possibly written in C) that just opens telnet, takes JSON input in CK format, collect files, run binary and send files back - for now that's all. In fact such approach may help us unify running workloads on any remote device (even very small ones if there is no python or java available)...

So the "CK node" should be very simple and portable ...

This ticket is related to the new 'device' module from the 'ck-autotuning' repo:

Further discussion is required.

Reproducing MILEPOST GCC optimization prediction service

Originally, we connected our MILEPOST GCC with the cTuning optimization prediction service:

Later, we implemented as a Collective Mind service (cTuning3):

We would like to implement it in CK and connect it with live optimization crowd-tuning results from http://cknowledge.org/repo

Add --valgring option to run program under valgring

It requires mostly then we getting "Segmentation fault" error for some programs.
Work around if

$ ck run program:caffe-time  --keep 
$ ./tmp-PrUGAu.sh #or some other generated file name 
$  valgrind fully_connected

it will be much better to have option and run it it one ck command

$ ck run program:caffe-time  --valgrind

For this need to add valgrind as package and soft
and pass ENV CK_ENV_VALGRIND_TOOL at env.sh

Then also valgrind could be compiled and run under android.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.