Skip to content

Commit 018cd9c

Browse files
committed
Add FAQ file.
1 parent be3f458 commit 018cd9c

File tree

1 file changed

+158
-0
lines changed

1 file changed

+158
-0
lines changed

labs/faq.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
### TOC: FAQ
2+
3+
### TOCEntry: Install
4+
5+
- _What Python version to use_
6+
7+
The recommended Python version is **3.11**. This version is used by ReCodEx to
8+
evaluate your solutions. Supported Python versions are 3.11-3.13 (some
9+
dependencies do not yet provide wheels for Python 3.14).
10+
11+
You can find out the version of your Python installation using `python3 --version`.
12+
13+
- _Installing to central user packages repository_
14+
15+
You can install all required packages to central user packages repository using
16+
`python3 -m pip install --user --no-cache-dir --extra-index-url=https://download.pytorch.org/whl/cu128 npfl139`.
17+
18+
On Linux and Windows, the above command installs CUDA 12.8 PyTorch build, but you can change `cu128` to:
19+
- `cpu` to get CPU-only (smaller) version,
20+
- `cu124` to get CUDA 12.4 build,
21+
- `rocm7.1` to get AMD ROCm 7.1 build (Linux only).
22+
23+
On macOS, the `--extra-index-url` has no effect and the Metal support is
24+
installed in any case.
25+
26+
**To update the `npfl139` package later, use `python3 -m pip install --user --upgrade npfl139`.**
27+
- _Installing to a virtual environment_
28+
29+
Python supports virtual environments, which are directories containing
30+
independent sets of installed packages. You can create a virtual environment
31+
by running `python3 -m venv VENV_DIR` followed by
32+
`VENV_DIR/bin/pip install --no-cache-dir --extra-index-url=https://download.pytorch.org/whl/cu128 npfl139`.
33+
(or `VENV_DIR/Scripts/pip` on Windows).
34+
35+
Again, apart from the CUDA 12.8 build, you can change `cu128` on Linux and
36+
Windows to:
37+
- `cpu` to get CPU-only (smaller) version,
38+
- `cu124` to get CUDA 12.4 build,
39+
- `rocm7.1` to get AMD ROCm 7.1 build (Linux only).
40+
41+
**To update the `npfl139` package later, use `VENV_DIR/bin/pip install --upgrade npfl139`.**
42+
43+
- _**Windows** installation_
44+
45+
- On Windows, it can happen that `python3` is not in PATH, while `py` command
46+
is – in that case you can use `py -m venv VENV_DIR`, which uses the newest
47+
Python available, or for example `py -3.11 -m venv VENV_DIR`, which uses
48+
Python version 3.11.
49+
50+
- If **MuJoCo environments fail** during construction, make sure the path of
51+
the Python site packages contains no non-ASCII characters. If it does, you
52+
can create a new virtual environment in a suitable directory to circumvent
53+
the problem.
54+
55+
- If you encounter a problem creating the logs in the `args.logdir` directory,
56+
a possible cause is that the path is longer than 260 characters, which is
57+
the default maximum length of a complete path on Windows. However, you can
58+
increase this limit on Windows 10, version 1607 or later, by following
59+
the [instructions](https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation).
60+
61+
- _**MacOS** installation_
62+
63+
- If you encounter issues with SSL certificates (_certificate verify failed:
64+
self-signed certificate in certificate chain_), you probably need to run the
65+
`Install Certificates.command`, which should be executed after installation;
66+
see https://docs.python.org/3/using/mac.html#installation-steps.
67+
68+
- _**GPU** support on Linux and Windows_
69+
70+
PyTorch supports NVIDIA GPU or AMD GPU out of the box, you just need to select
71+
appropriate `--extra-index-url` when installing the packages.
72+
73+
If you encounter problems loading CUDA or cuDNN libraries, make sure your
74+
`LD_LIBRARY_PATH` does not contain paths to older CUDA/cuDNN libraries.
75+
76+
### TOCEntry: Git
77+
78+
- _Is it possible to keep the solutions in a Git repository?_
79+
80+
Definitely. Keeping the solutions in a branch of your repository,
81+
where you merge them with the course repository, is probably a good idea.
82+
However, please keep the cloned repository with your solutions **private**.
83+
84+
- _On GitHub, do not create a **public** fork containing **your solutions**._
85+
86+
If you keep your solutions in a GitHub repository, please do not create
87+
a clone of the repository by using the Fork button; this way, the cloned
88+
repository would be **public**.
89+
- If you created a public fork and want to make it private, you need to start
90+
by pressing **Leave fork network** in the repository settings; only then you
91+
can change the visibility to **private**.
92+
93+
Of course, if you want to create a pull request, GitHub requires a public
94+
fork and you need to create it, just do not store your solutions in it (so you
95+
might end up with two repositories, a public fork for pull requests and
96+
a private repo for your own solutions).
97+
98+
- _How to clone the course repository?_
99+
100+
To clone the course repository, run
101+
```
102+
git clone https://github.com/ufal/npfl139
103+
```
104+
This creates the repository in the `npfl139` subdirectory; if you want a different
105+
name, add it as an additional parameter.
106+
107+
To update the repository, run `git pull` inside the repository directory.
108+
109+
- _How to merge the course repository updates into a private repository with additional changes?_
110+
111+
It is possible to have a private repository that combines your solutions and
112+
the updates from the course repository. To do that, start by cloning your
113+
empty private repository, and then run the following commands in it:
114+
```
115+
git remote add course_repo https://github.com/ufal/npfl139
116+
git fetch course_repo
117+
git checkout --no-track course_repo/master
118+
```
119+
This creates a new remote `course_repo` and a clone of the `master` branch
120+
from it; however, `git pull` and `git push` in this branch will operate
121+
on the repository your cloned originally.
122+
123+
To update your branch with the changes from the course repository, run
124+
```
125+
git fetch course_repo
126+
git merge course_repo/master
127+
```
128+
while in your branch (the command `git pull --no-rebase course_repo master`
129+
has the same effect). Of course, it might be necessary to resolve conflicts
130+
if both you and the course repository modified the same lines in the same files.
131+
132+
### TOCEntry: ReCodEx
133+
134+
- _What files can be submitted to ReCodEx?_
135+
136+
You can submit multiple files of any type to ReCodEx. There is a limit of
137+
**20** files per submission, with a total size of **20MB**.
138+
139+
- _What file does ReCodEx execute and what arguments does it use?_
140+
141+
Exactly one file with `py` suffix must contain a line starting with `def main(`.
142+
Such a file is imported by ReCodEx and the `main` method is executed
143+
(during the import, `__name__ == "__recodex__"`).
144+
145+
The file must also export an argument parser called `parser`. ReCodEx uses its
146+
arguments and default values, but it overwrites some of the arguments
147+
depending on the test being executed; the template always indicates which
148+
arguments are set by ReCodEx and which are left intact.
149+
150+
- _What are the time and memory limits?_
151+
152+
The memory limit during evaluation is **1.5GB**. The time limit varies, but it should
153+
be at least 10 seconds and at least twice the running time of my solution.
154+
155+
- _Do agents need to be trained directly in ReCodEx?_
156+
157+
No, you can pre-train your agent locally (unless specified otherwise in the task
158+
description).

0 commit comments

Comments
 (0)