Skip to content

Commit

Permalink
V2.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
gfursin committed May 14, 2021
1 parent 86c73d1 commit 6e7b03c
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 118 deletions.
3 changes: 2 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
* V2.0.6.1
* V2.0.7
* fixed problem in module:program to return error when pre/post processing fails
* added more tests to catch bugs in program workflows
* fixed a new bug in the program workflow
* updated docs

* V2.0.6
* improved module:program meta to be able to use global CMD run_time parameters
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ with any compatible data set on any compatible platform:
```bash
python3 -m pip install ck

ck pull repo --url=https://github.com/ctuning/ck-crowdtuning
ck pull repo:octoml@mlops

ck ls program:*susan*

Expand All @@ -89,19 +89,22 @@ ck detect soft --tags=compiler,llvm

ck show env --tags=compiler

ck compile program:cbench-automotive-susan --speed
ck compile program:image-corner-detection --speed

ck run program:cbench-automotive-susan --cmd_key=corners --repeat=1 --env.MY_ENV=123 --env.TEST=xyz
ck run program:image-corner-detection --repeat=1 --env.MY_ENV=123 --env.TEST=xyz
```

You can check output of this program in the following directory:
```bash
cd `ck find program:cbench-automotive-susan`/tmp
ls -l
cd `ck find program:image-corner-detection`/tmp
ls

tmp-output.tmp - image with detected corners (rename to ppm to view it)
processed-image.pgm
```

You can now view this image with detected corners.


Check [CK docs](https://ck.readthedocs.io/en/latest/src/introduction.html) for further details.

### MLPerf benchmark workflows
Expand Down
2 changes: 1 addition & 1 deletion ck/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


# We use 3 digits for the main (released) version and 4th digit for development revision
__version__ = "2.0.6.1"
__version__ = "2.0.7"
# Do not use characters (to detect outdated version)!

# Import packages that are global for the whole kernel
Expand Down
2 changes: 1 addition & 1 deletion docs/mlperf-automation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using the open-source [CK workflow framework](https://github.com/ctuning/ck).
* [Install CK framework](tools/ck.md)
* [Install CK virtual environment (optional)](tools/ck-venv.md)
* [Use adaptive CK container](tools/ck-docker.md)
* [Prepare and run native MLPerf](tasks/README.md)
* [**Prepare and run native MLPerf**](tasks/README.md)
* [Analyze MLPerf inference results](results/README.md)
* [Example of CK dashboards for ML Systems DSE](results/ck-dashboard.md)
* [Reproduce MLPerf results and DSE](reproduce/README.md)
Expand Down
100 changes: 22 additions & 78 deletions docs/src/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if you encounter any problem or have questions.
Now you can pull CK repo with the universal program workflow.

```bash
ck pull repo --url=https://github.com/ctuning/ck-crowdtuning
ck pull repo:octoml@mlops
```

CK will automatically pull all required CK repositories with different automation actions, benchmarks, and datasets in the CK format.
Expand All @@ -53,34 +53,34 @@ You can now see all shared program workflows in the CK format:
ck ls program
```

You can find and investigate the CK format for a given program (such as *cbench-automotive-susan*) as follows:
You can find and investigate the CK format for a given program (such as *image-corner-detection*) as follows:

```bash
ck find program:cbench-automotive-susan
ck search program --tags=demo,image,corner-detection
```

You can see the CK meta description of this program from the command line as follows:
```bash
ck load program:cbench-automotive-susan
ck load program:cbench-automotive-susan --min
ck load program:image-corner-detection
ck load program:image-corner-detection --min
```

It may be more convenient to check the structure of this entry at [GitHub](https://github.com/ctuning/ctuning-programs/tree/master/program/cbench-automotive-susan) with all the sources and meta-descriptions.
It may be more convenient to check the structure of this entry at [GitHub](https://github.com/ctuning/ck-ml/tree/master/program/image-corner-detection) with all the sources and meta-descriptions.

You can also see the CK JSON meta description for this CK program entry [here](https://github.com/ctuning/ctuning-programs/blob/master/program/cbench-automotive-susan/.cm/meta.json).
You can also see the CK JSON meta description for this CK program entry [here](https://github.com/ctuning/ck-ml/blob/master/program/image-corner-detection/.cm/meta.json).
When you invoke automation actions in the CK module *program*, the automation code will read this meta description and perform actions for different programs accordingly.

## Invoke CK automation actions

You can now try to compile this program on your platform:

```bash
ck compile program:cbench-automotive-susan --speed
ck compile program:image-corner-detection --speed
```

CK will invoke the function "compile" in the module "program" (you can see it at [GitHub](https://github.com/ctuning/ck-autotuning/blob/master/module/program/module.py#L3551)
CK will invoke the function "compile" in the module "program" (you can see it at [GitHub](https://github.com/ctuning/ck/blob/master/ck/repo/module/program/module.py#L3594)
or you can find the source code of this CK module locally using "ck find module:program"),
read the JSON meta of *cbench-automotive-susan*, and perform a given action.
read the JSON meta of *image-corner-detection*, and perform a given action.

Note, that you can obtain all flags for a given action as follows:
```bash
Expand Down Expand Up @@ -122,7 +122,7 @@ Such approach allows us to separate CK workflows from hardwired dependencies and

You can now run this program as follows:
```bash
ck run program:cbench-automotive-susan
ck run program:image-corner-detection
```

While running the program, CK will collect and unify various characteristics (execution time, code size, etc).
Expand All @@ -131,7 +131,7 @@ Furthermore, we can continue improving this universal program workflow to monito
performing statistical analysis of collected characteristics, validating outputs, etc:

```bash
ck benchmark program:cbench-automotive-susan --repetitions=4 --record --record_uoa=ck_entry_to_record_my_experiment
ck benchmark program:image-corner-detection --repetitions=4 --record --record_uoa=ck_entry_to_record_my_experiment
ck replay experiment:ck_entry_to_record_my_experiment
```

Expand Down Expand Up @@ -216,7 +216,7 @@ You can even participate in [crowd-tuning](https://cKnowledge.org/rpi-crowd-tuni
of multiple programs and data sets across diverse platforms:.

```
ck crowdtune program:cbench-automotive-susan
ck crowdtune program:image-corner-detection
ck crowdtune program
```

Expand All @@ -230,15 +230,15 @@ You can also run CK automation actions directly from any Python (2.7+ or 3.3+) u
```python
import ck.kernel as ck

# Equivalent of "ck compile program:cbench-automotive-susan --speed"
r=ck.access({'action':'compile', 'module_uoa':'program', 'data_uoa':'cbench-automotive-susan',
# Equivalent of "ck compile program:image-corner-detection --speed"
r=ck.access({'action':'compile', 'module_uoa':'program', 'data_uoa':'image-corner-detection',
'speed':'yes'})
if r['return']>0: return r # unified error handling

print (r)

# Equivalent of "ck run program:cbench-automotive-susan --env.OMP_NUM_THREADS=4
r=ck.access({'action':'run', 'module_uoa':'program', 'data_uoa':'cbench-automotive-susan',
# Equivalent of "ck run program:image-corner-detection --env.OMP_NUM_THREADS=4
r=ck.access({'action':'run', 'module_uoa':'program', 'data_uoa':'image-corner-detection',
'env':{'OMP_NUM_THREADS':4}})
if r['return']>0: return r # unified error handling

Expand All @@ -247,58 +247,11 @@ print (r)
```


## Try the CK ML workflow
## Try the CK MLPerf workflow

You can now try a more complex example with TensorFlow.
You should pull the related CK repository and install the prebuilt version of TensorFlow CPU via CK:

```bash
ck pull repo:ck-tensorflow
ck install package --tags=lib,tensorflow,vcpu,vprebuilt
```

Check that it was successfully installed:

```bash
ck show env --tags=lib,tensorflow
```

You can find a path to a given entry describing this TF installation as follows:
```bash
ck find env:{env UID from above list}
```

Run the CK virtual environment and test TF:
```bash
ck virtual env --tags=lib,tensorflow
ipython
> import tensorflow as tf
>
```

You can try to run the CK image classification workflow example using the installed TF:

```bash
ck run program:tensorflow --cmd_key=classify
```

You can even try to rebuild TensorFlow via CK for your platform with CUDA:

```bash
ck install package:lib-tensorflow-1.7.0-cuda
```

CK will attempt detect your CUDA compiler and related libraries and tools
including Java, Basel, and will then try to rebuild TF.
Note that you may still need to install some extra dependencies yourself
as described in this [readme](https://github.com/ctuning/ck-tensorflow#prerequisites-for-ubuntu).


You can also try to run ML workflows from the [MLPerf benchmarking initiative](https://mlperf.org)
using this [CK MLPerf repository](https://github.com/ctuning/ck-mlperf).

Finally, you can try our recent [MLPerf automation demo](https://cKnowledge.io/test)
to automate submissions and validations of MLPerf results.
Feel free to try more complex CK MLPerf workflows to benchmark ML Systems
across different models, data sets, frameworks and hardware
as described [here](https://github.com/ctuning/ck/blob/master/docs/mlperf-automation/README.md).


## Further information
Expand All @@ -308,17 +261,8 @@ of reusable components with common automation actions and unified meta descripti
The goal is to promote artifact sharing and reuse while gradually substituting and unifying
all tedious and repetitive research tasks!

You can find shared CK repositories, components, automation actions, and live scoreboards
at the open [cKnowledge.io platform](https://cKnowledge.io).

You can also check how the universal CK program workflow was successfully reused in
[different projects](https://doi.org/10.5281/zenodo.4005588)
including the [ACM REQUEST tournaments](http://cKnowledge.org/request) to collaboratively co-design SW/HW stack for deep learning
([Report about results of the 1st ReQuEST-ASPLOS'18 tournament and next steps](https://portalparts.acm.org/3230000/3229762/fm/frontmatter.pdf)
and [ACM ReQuEST-ASPLOS'18 proceedings with artifact descriptions](https://doi.org/10.1145/3229762))
and [reproducible quantum tournaments](https://cKnowledge.org/quantum).

Finally, check this [guide](how-to-contribute.md) to learn how to add your own repositories, workflows, and components!
Please check this [guide](how-to-contribute.md) to learn how to add your own repositories, workflows, and components!


## Contact the CK community
Expand Down
33 changes: 12 additions & 21 deletions docs/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,24 @@ on any platform, and then create a copy of the ***CK program component***:
```bash
pip install ck

ck pull repo --url=https://github.com/ctuning/ck-crowdtuning
ck pull repo:octoml@mlops

ck search dataset --tags=jpeg

ck search program:cbench-automotive-*
ck search program:image*

ck find program:cbench-automotive-susan
ck find program:image-corner-detection

ck load program:cbench-automotive-susan
ck load program:image-corner-detection --min

ck help program

ck compile program:cbench-automotive-susan --speed
ck run program:cbench-automotive-susan --env.OMP_NUM_THREADS=4
ck compile program:image-corner-detection --speed
ck run program:image-corner-detection --env.OMP_NUM_THREADS=4

ck run program --help

ck cp program:cbench-automotive-susan local:program:new-program-workflow
ck cp program:image-corner-detection local:program:new-program-workflow

ck find program:new-program-workflow

Expand All @@ -148,7 +148,7 @@ ck replay experiment:my-test
```

The [CK program module](https://cKnowledge.io/c/module/program) describes dependencies on software detection plugins
and meta packages usin simple tags with version ranges that the community has to agree on:
and meta packages using simple tags with version ranges that the community has agreed on:

```json
{
Expand All @@ -173,15 +173,15 @@ CK also provides a Python library with a simple API that can be easily used in w
```python
import ck.kernel as ck

# Equivalent of "ck compile program:cbench-automotive-susan --speed"
r=ck.access({'action':'compile', 'module_uoa':'program', 'data_uoa':'cbench-automotive-susan',
# Equivalent of "ck compile program:image-corner-detection --speed"
r=ck.access({'action':'compile', 'module_uoa':'program', 'data_uoa':'image-corner-detection',
'speed':'yes'})
if r['return']>0: return r # unified error handling

print (r)

# Equivalent of "ck run program:cbench-automotive-susan --env.OMP_NUM_THREADS=4
r=ck.access({'action':'run', 'module_uoa':'program', 'data_uoa':'cbench-automotive-susan',
# Equivalent of "ck run program:image-corner-detection --env.OMP_NUM_THREADS=4
r=ck.access({'action':'run', 'module_uoa':'program', 'data_uoa':'image-corner-detection',
'env':{'OMP_NUM_THREADS':4}})
if r['return']>0: return r # unified error handling

Expand Down Expand Up @@ -270,15 +270,6 @@ and [ACM artifact review and badging](https://www.acm.org/publications/policies/
![cKnowledge platform concept](../static/platform.png)


You can learn more about the CK project from [CK presentations and white papers](https://github.com/ctuning/ck/wiki/Publications).

*Even though the CK technology is used [in production](https://cKnowledge.org/partners.html) for more than 5 years,
it is still a proof-of-concept prototype requiring further improvements
and standardization. Depending on the available resources, we plan
to develop a new, backward-compatible and more user-friendly version - please [get in touch](https://cKnowledge.org/contacts.html) if you are
interested to know more!*





Expand Down
8 changes: 4 additions & 4 deletions docs/src/portable-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ A user describes dependencies on CK packages in the CK program meta as well as c

Examples:
```bash
ck pull repo:ck-crowdtuning
ck pull repo:octoml@mlops

ck compile program:cbench-automotive-susan --speed
ck run program:cbench-automotive-susan --repeat=1 --env.OMP_NUM_THREADS=4
ck compile program:image-corner-detection --speed
ck run program:image-corner-detection --repeat=1 --env.OMP_NUM_THREADS=4

```

Expand All @@ -140,7 +140,7 @@ This module records all resolved dependencies, inputs and outputs when running a
thus allowing to preserve experiments with all the provenance and replay them later on the same or different machine:

```bash
ck benchmark program:cbench-automotive-susan --record --record_uoa=my_experiment
ck benchmark program:image-corner-detection --record --record_uoa=my_experiment

ck find experiment:my_experiment

Expand Down
12 changes: 6 additions & 6 deletions docs/src/typical-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,26 +127,26 @@ Since CK concept is about reusing and extending existing components with a commo
we suggest you to look at [this index]( https://cKnowledge.io/programs ) of shared CK programs
in case someone have already shared a CK workflows for the same or similar program!

If you found a similar program, for example "cbench-automotive-susan"
If you found a similar program, for example "image-corner-detection"
you can create a working copy of this program in your new CK repository
for further editing as follows:

```bash
ck pull repo:ctuning-programs
ck cp program:cbench-automotive-susan my-new-repo:program:my-copy-of-cbench-automotive-susan
ck cp program:image-corner-detection my-new-repo:program:my-copy-of-image-corner-detection
```

You now have a working copy of the CK "cbench-automotive-susan" program entry in your new repository
You now have a working copy of the CK "image-corner-detection" program entry in your new repository
that contains sources and the CK meta information about how to compile and run this program:

```bash
ck compile program:my-copy-of-cbench-automotive-susan --speed
ck run program:my-copy-of-cbench-automotive-susan
ck compile program:my-copy-of-image-corner-detection --speed
ck run program:my-copy-of-image-corner-detection
```

You can find and explore the new CK entry from command line as follows:
```bash
ck find program:my-copy-of-cbench-automotive-susan
ck find program:my-copy-of-image-corner-detection
```

You will see the following files in this directory:
Expand Down

0 comments on commit 6e7b03c

Please sign in to comment.