|
1 | | -# Challenges |
| 1 | +# M3 Challenges |
2 | 2 |
|
3 | 3 | ## Challenge 1 |
4 | 4 |
|
5 | | -Something simple to start off. Create a bash script called `hello.sh` that prints "Hello World" to the screen. Submit this job to the queue using `sbatch`. Check the status of the job using `squeue`. Once the job has finished, check the output using `cat`. You can find the output file in the directory you submitted the job from. |
| 5 | +Navigate to your scratch directory and, using vim (or your chosen in-terminal editor) create a file called `hello.txt` that contains the text "Hello World". Once you have created the file, use the `cat` command to print the contents of the file to the screen. |
6 | 6 |
|
7 | 7 | ## Challenge 2 |
8 | 8 |
|
9 | | -Something a bit more involved. Clone your [challenges repository](https://github.com/MonashDeepNeuron/HPC-Training-Challenges.git) into your personal folder in the scratch directory. Then, in this same directory, create a submission script that will install python 3.10 using miniconda, create a virtual environment, install the necessary dependencies, and clone and run the `alexnet_stl10.py` script in the M3 section. Remember, don't directly load python using module, follow the instructions in the [software tooling](./software-tooling.md#python) chapter. |
10 | | -Once completed, commit and push your changes as well as the output. |
| 9 | +Write a bash script that prints the contents of the above hello.txt file to the screen and run it locally (on your login node). |
11 | 10 |
|
12 | 11 | ## Challenge 3 |
13 | 12 |
|
14 | | -A continuation of challenge 2. Edit your submission script so that you get a gpu node, and run the script using the gpu. |
15 | | -Commit and push your changes as well as the output. |
| 13 | +Submit the above script to the queue by writing another SLURM bash script. Check the status of the job using `squeue`. Once the job has finished, check the output using `cat`. You can find the output file in the directory you submitted the job from. |
| 14 | + |
| 15 | +## Challenge 4 |
| 16 | + |
| 17 | +Request an interactive node and attach to it. Once you have done this, install python 3.7 using conda. |
| 18 | + |
| 19 | +## Challenge 5 |
| 20 | + |
| 21 | +Clone and run [this](./dl_on_m3/alexnet_stl10.py) script. You will need to first install the dependencies for it. You don't need to wait for it to finish, just make sure it is working. You will know its working if it starts listing out the loss and accuracy for each epoch. You can stop it by pressing `ctrl + c`. |
| 22 | + |
| 23 | +Once you have confirmed that it is working, deactivate and delete the conda environment, and then end the interactive session. |
| 24 | + |
| 25 | +> Hint: I have included the dependencies and their versions (make sure you install the right version) in the `requirements.txt` file. You will need python 3.7 to run this script. |
| 26 | +
|
| 27 | +## Challenge 6 |
| 28 | + |
| 29 | +Go back to the login node. Now you are going to put it all together. Write a bash script that does the following: |
| 30 | + |
| 31 | +- (1) requests a compute node |
| 32 | +- (2) installs python using conda |
| 33 | +- (3) clones and runs the above script |
| 34 | + |
| 35 | +Let this run fully. Check the output of the script to make sure it ran correctly. Does it match the output of the script you ran in challenge 5? |
| 36 | +> Hint: You can check the output of the script at any time by `cat`ing the output file. The script does not need to have finished running for you to do this. |
| 37 | +
|
| 38 | +## Challenge 7 |
| 39 | + |
| 40 | +Edit your submission script so that you get a gpu node, and run the script using the gpu. |
| 41 | +> Hint: Use the m3h partition |
| 42 | +
|
| 43 | +## Challenge 8 |
| 44 | + |
| 45 | +Now you want to clean up your working directory. First, push your solutions to your challenges repo. Then, delete the challenges directory, as well as the conda environment you created in challenge 6. |
0 commit comments