Ruprecht-Karls-Universität Heidelberg
Bilder vom Neuenheimer Feld, Heidelberg und der Universität Heidelberg
Siegel der Uni Heidelberg

Begleitveranstaltung zum Softwareprojekt - Tutorium

« zurück

Disclaimer

This session is an unofficial offer. Not related to any credit points, grading criteria etc.

Date & Room

3rd May 2022, 13:15–14:45, SR24 INF325 (or CIP pool, if available)

Cluster Login

[INFO] for new cluster users
Please subscribe the mailing list: https://lists.cl.uni-heidelberg.de/listinfo/cluster-users


[ATTENTION] Please check if you can login to the cluster:

$ ssh <username>@cluster.cl.uni-heidelberg.de
If not, please send an email to Gruppe Technik (ohta@cl.uni-heidelberg.de) with the following information:
  • Your Name
  • Your ICL email address (@cl.uni-heidelberg.de)
  • What for you need cluster access (tell them you are participating in SWP ss22.)
They will grand access to the cluster for the participants of the software project.

Preparation

The goal of the session is to share your experience with other participants. Since peer-to-peer learning is a part of the learning objectives of the software project, I decided to hold this session in "inverted classroom" style. I propose several pre-class materials here, and in-class, I'll ask the questions listed below. Please prepare your own answer to these questions. It doesn't mean I expect a correct answer, but includes something like: "I got this error message: XXX when I executed the command YYY. To solve this, I tried the option proposed in stackoverflow..."

I look forward to your active participation!

Topic 1: Cluster

[Preparation Workload: 90 min.]
First, go through the following tutorials:

Questions

  1. How can you login to the Cluster? Which command?
  2. You logged in the Cluster. Are Slurm commands (srun, squeue, scancel, etc.) available in your environment? If not, what should you do to make these available?
  3. Which partitions are there? Out of them, which partitions are dedicated to `students` (not for `mitarb`)? Which node is currently occupied by whom?
  4. How many jobs are currently running on the partition gpulong?
  5. Allocate resources for an interactive job with salloc command. Provide the following options:
    • The task can run max. 10 min.
    • The task needs 100MB memory.
    • The task needs 4 CPUs.
  6. Check if your job does appear in the job queue. Which node is assigned for you?
  7. Call srun hostname command. What does the returned value mean?
  8. Call hostname command without srun. Why it's different from srun hostname?
  9. Confirm the python version currently available on the allocated node.
  10. Call sacct command to monitor your job. Which ID is assigned to your job?
  11. Revoke the allocated resources. Check if your job doesn't appear in the job queue.
  12. Write a bash script that prints the visible GPU devices of one gpushort node.
  13. Execute the bash script: first, reserve resources with salloc, then call the script with sbatch, check the output logs. How do you know whether your jobs are completed or not?
  14. How can you enter the console shell of a GPU node?
  15. You entered the shell of a GPU node. Which CUDA version is currently available on the node?
  16. You entered the shell of a GPU node. Install Pytorch under your virtual environment, and check if `torch.cuda.is_available()` returns True in Python.
  17. You entered the shell of a GPU node, and started a GPU-required job. How you can monitor the GPU memory usage?
  18. You entered the shell of a GPU node, and started a job which takes for 2 days. How can you keep the job running even after you logged out from the cluster?
    • Hint: console multiplexer i.e. tmux, screen, byobu are globally installed on Cluster!
  19. How do you exit the console of the node and go back to `login` node?
  20. Install jupyter (jupyterlab) in your virtual environment. Start jupyter notebook server on a cluster node. Open it via web-browser from your local computer. Import pytorch, check which version number has your pytorch.
  21. Shutdown the jupyter server. Make sure, the port you used to connect jupyter is free, now.
  22. [EXTRA] You can find no free slot on the Cluster GPUs. Is there any other possibility to access GPUs?

Topic 2: Remote development / useful tools

[Preparation Workload: 60 min.]

Questions

  1. Does your IDE support remote development? If yes, set up the connection to the Cluster.
    • Hint: VSCode, PyCharm (you may be able to apply for educational license to get free access to professional features)
  2. You have your own data on your laptop. Which command will transfer the data to the Cluster? Try a file transfer tool with GUI.
  3. How can you edit a file stored on the Cluster without explicitly downloading it to your local computer?
  4. You keep getting Quota exceeded error. What you can do to avoid it?
    • Hint: Read our internal FAQ wiki. (Project directory in Cluster: /scratch and /workspace)
  5. Create a repository in gitlab hosted by the institute. (either an empty one or imported from other sources.)
  6. You don't want to create a repo under your namespace, but you want to have a shared namespace for your group. What you can do?
  7. Say, you found a publicly available codebase somewhere (github, bitbucket, etc.) Clone your CL gitlab repo to your local, and add the public repo with the name "upstream". That is, you will have two remote repos "origin" and "upstream".
  8. During development, you've seen some changes in the "upstream". How can you take these changes into your local repo, without overwriting?
  9. Have you worked with python debugger? python unittest? *this will be skipped in the session...
  10. Have you tried any linter, such as pylint, flake8, black, isort? *this will be skipped in the session...
  11. [EXTRA] You want to install XXX on the cluster, and the instruction says you need `sudo` to install it. How can you avoid sudo? (ex. sentencepiece)

Topic 3: Frameworks

[Preparation Workload: 30 min.]

Choose one framework / package below, and run a quick-start tutorial on the Cluster. Most of them are provided in Jupyter Notebook format. You don't have to write any code! Just run the provided notebook as is. Do you encounter any error?

Imagine, you are writing a quick-start tutorial of your code developed in the software project. Do you think the tutorial you executed above can be a good template?

Topic 4: Work in a team

  1. Documentation
    • Take meeting notes everytime you meet. Share it online.
    • Set one static access point for all.
    • Use pictures, graphs, etc.
    • Start writing TODAY!
  2. Planning
    • Plan iterative, incremental cycles. Linear project management often fails!
    • Simple first, easy first.
    • Working demo is more convincing than a fancy theory.
  3. Coding
    • Do code reviews.
    • Keep a pull request small.
    • Make a commit self-explanatory.
    • cf.) the 15 min. rule of software development
    • cf.) Rubber-duck debugging
  4. Communication
Good Luck!

Do you have any other topics should be covered in the session? Please write me an email! (ohta@cl.uni-heidelberg.de)

zum Seitenanfang