Skip to content

Commit

Permalink
fixes to preview tasks (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszsrebrny authored Sep 26, 2023
1 parent dc4a33c commit d22e885
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 38 deletions.
57 changes: 57 additions & 0 deletions preview_tasks/pre-alpha-preview-task-bonus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

# (Bonus task) Parallelize the hash cracker script with Ray and execute it on Ray on Golem

**Goal**: Evaluate if Ray on Golem makes it easier to parallelize Python code

**Task**: Parallelize the provided hash cracker code. Please show us the resulting code and logs from running it with Ray on Golem.

**Steps**:
- Consider the provided piece of code.
- Parallelize it with Ray (i.e. make it run faster for bigger inputs)
- Run it on Ray on Golem
- Send us your code, the console logs of the code execution on Ray on Golem
- Fill out the [submission form](todo) (code, logs and meaningful and thought-out feedback)

## The code
Take a look at this [piece of code](https://github.com/golemfactory/ray-on-golem/raw/main/examples/hash_cracker_ray_ready.py)

It takes a sha256 hash of some unknown word as input and looks for a word that results in a match.
The code doesn't know anything about Golem or Ray.

```bash
python hash_cracker_ray_ready.py -l 4 de6c0da53ac2bf2b6954e400767106011e4471db7a412cce0388e3441e0ad2ec
```
```
scanning: de6c0da53ac2bf2b6954e400767106011e4471db7a412cce0388e3441e0ad2ec: a, fffg
scanning: de6c0da53ac2bf2b6954e400767106011e4471db7a412cce0388e3441e0ad2ec: fffg, lllm
scanning: de6c0da53ac2bf2b6954e400767106011e4471db7a412cce0388e3441e0ad2ec: lllm, rrrs
scanning: de6c0da53ac2bf2b6954e400767106011e4471db7a412cce0388e3441e0ad2ec: rrrs, xxxy
scanning: de6c0da53ac2bf2b6954e400767106011e4471db7a412cce0388e3441e0ad2ec: xxxy, DDDE
scanning: de6c0da53ac2bf2b6954e400767106011e4471db7a412cce0388e3441e0ad2ec: DDDE, JJJK
scanning: de6c0da53ac2bf2b6954e400767106011e4471db7a412cce0388e3441e0ad2ec: JJJK, PPPQ
scanning: de6c0da53ac2bf2b6954e400767106011e4471db7a412cce0388e3441e0ad2ec: PPPQ, VVVW
scanning: de6c0da53ac2bf2b6954e400767106011e4471db7a412cce0388e3441e0ad2ec: VVVW, 1112
scanning: de6c0da53ac2bf2b6954e400767106011e4471db7a412cce0388e3441e0ad2ec: 1112, 7778
scanning: de6c0da53ac2bf2b6954e400767106011e4471db7a412cce0388e3441e0ad2ec: 7778, ###$
finished in 0:01:45.139588, match found: 9Lm!
```

You can find a couple of other hashes to crack in the code's comments.

## Parallelize to make the code run faster.

You will notice that it runs very fast for hashes of 3-character words, ok-ish for 4-character words (30-120 seconds), and very slowly for longer words (over 20 mins for 5-character words).

Your task is to parallelize the code and execute it on the Ray on Golem cluster.
The goal is to benefit from distributed execution on the Ray on Golem cluster so that it takes less time than executed locally.

Our original hash cracker code was a bit more straightforward, but it was more challenging to parallelize as the obvious candidate for the Ray task was too small.
So now the code is a bit more complex, but it should be easier to parallelize as it now allows more control over the sizes of the tasks.

One additional challenge (and a learning opportunity) here is that we would like to avoid waiting for Ray on Golem to scan the whole of the word space.
We would like to stop the computation when we find the match.

## Fill out the submission form

At the end, we would like a code that finds the `golem` word for `4c5cddb7859b93eebf26c551518c021a31fa0013b2c03afa5b541cbc8bd079a6` hash in 10 minutes.

65 changes: 27 additions & 38 deletions preview_tasks/pre-alpha-preview-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,55 @@
Welcome to the Ray on Golem pre-alpha Preview Program description!

Thank you for your interest in the Preview Program.
Its purpose is to test the new Ray on Golem solution with its documentation at https://golem-docs-git-mateusz-ray-on-golem-pre-alpha-golem.vercel.app/docs/creators/ray.
Its purpose is to test the new Ray on Golem solution with its documentation: https://docs.golem.network/docs/creators/ray.

The pre-alpha release is a sneak-peak, with happy path working on our test network. We publish the release and run the preview program
to get it out of the building - to start verifying the potential to decide on further investment in Ray on Golem.
The pre-alpha release is a sneak-peak, with a happy path working on our test network. We published the release and decided
to run the preview program to get it out of the building - to start verifying the potential
and decide if further investment in Ray on Golem is justified.

This article contains a set of tasks that you can complete to broaden your knowledge and help improve the Golem Network.
**We want to test Ray on Golem on Linux**.
The set of tasks described below will help you broaden your knowledge while contributing to the improvement of the Golem Network.

We have rewards for 10 people (USD 120 each) - we will communicate via the Upwork platform.
We want to test Ray on Golem on Linux.
We have rewards for 10 people (100 USD each) - that you will be able to claim via Upwork after completing the task.
Note that only those who filled the qualification survey and were contacted on Discord with a link to Upwork are eligible to participate.

If you have any questions, we encourage you to contact the Ray on Golem team directly - join our community on [Discord](https://chat.golem.network) and find the `#Ray on Golem` channel in the Golem projects section.
If you have any questions, we encourage you to contact the `Ray on Golem` team directly on Discord: `#Ray on Golem` channel in the Golem projects section.

We also encourage you to visit https://www.golem.network/, where you can find more basic information about our open-source project.

## Preview tasks

There are four tasks. You need to complete them all to apply for the reward.
There are three tasks. You need to complete them all to apply for the reward.

### #1 Setup tutorial

Go through the [setup tutorial](https://golem-docs-git-mateusz-ray-on-golem-pre-alpha-golem.vercel.app/docs/creators/ray/setup-tutorial) and send us your console outputs (copy the content of all the terminals you used and paste them to a text file)
**Goal**: We want to test how our solution behaves in different environments and how helpful our tutorial is.

We want to test how our solution behaves in different environments and how helpful our tutorial is.
**Task**: Send us the console logs from going through the setup tutorial. Be mindful, as we also need constructive feedback on the tutorial.

### #2 Converting a real-life use case to Ray on Golem

Go through the [converting a real-life use case to Ray on Golem tutorial](https://golem-docs-git-mateusz-ray-on-golem-pre-alpha-golem.vercel.app/docs/creators/ray/conversion-to-ray-on-golem-tutorial) and send us your console outputs (just copy the content of all the terminals you used and paste them to a text file)

We want to test how our solution behaves in different environments and how helpful our tutorial is.

### #3 Parallelize the hash cracker script with Ray and execute it on Ray on Golem

Take a look at this [piece of code](https://github.com/golemfactory/ray-on-golem/raw/main/examples/hash_cracker_ray_ready.py)
**Steps**:
- Go through the [concept article](https://docs.golem.network/docs/creators/ray/concept) to get you started.
- Go through the [setup tutorial](https://docs.golem.network/docs/creators/ray/setup-tutorial) and check if it works out.
- Send us your console outputs (copy the content of all the terminals you used and paste them to a text file)

It takes a sha256 hash of some unknown word as an input and looks for a word that results in a match.
The code doesn't know anything about Golem nor Ray.

```bash
python hash_cracker_ray_ready.py -l 4 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
```
```
finished in 0:00:40.953827, match found: test
```

You can find a couple of other hashes to crack in the code's comments.

### #2 Converting a real-life use case to Ray on Golem

Your task is to parallelize the code and execute it on Ray on Golem cluster.
The goal is to benefit from distributed execution on Ray on Golem cluster so that it takes less time than executed locally.
**Goal**: We want to test how our solution behaves in different environments and how helpful our tutorial is.

Please send us your code and console output from running the code on Ray on Golem.
**Task**: Send us the console logs from going through the conversion a real-life use case to Ray on Golem tutorial. Be mindful, we also need constructive feedback on the tutorial.

As a result of this task, we'd like to learn whether, and how, our documentation helped you run such an arbitrary piece of python code on a Ray on Golem cluster.
**Steps**:
- Go through the [conversion of a real-life use case to Ray on Golem tutorial](https://docs.golem.network/docs/creators/ray/conversion-to-ray-on-golem-tutorial)
- Send us your console outputs (copy the content of all the terminals you used and paste them to a text file)

### #4 Fill out the feedback form

### #3 Fill out the feedback form

Please fill out the [submission form](https://qkjx8blh5hm.typeform.com/to/GtaCVz0b)
We are looking for meaningful and thought-out feedback that will help us drive the solution.
Please fill out the [submission form](https://bit.ly/461V1ET).
We are looking for **meaningful and thought-out feedback** that will help us drive the solution.

The form will ask you to upload console logs from the first three tasks.
The form will ask you to upload console logs from the first two tasks.

### Useful links

Expand Down

0 comments on commit d22e885

Please sign in to comment.