You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: paper/README.md
+23-17Lines changed: 23 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
# Reproducing the Results
2
2
3
+
Note that there is also a brief section on reproducibility in the appendix of the paper, which includes a description of the hardware.
4
+
3
5
## Computational Environment
4
6
5
7
In order to reproduce the results, you can either use the provided docker images or recreate the `renv` environment that is described in `paper/renv.lock`.
@@ -9,6 +11,12 @@ To work with the renv environment, go into the `paper` directory, which will boo
9
11
renv::restore()
10
12
```
11
13
14
+
Afterwards, you need to install torch:
15
+
16
+
```{r}
17
+
torch::install_torch()
18
+
```
19
+
12
20
We are providing two docker images, one for CPU and one for CUDA GPU that have the same packages from the `renv.lock` file installed.
13
21
The images can be downloaded from Zenodo: https://doi.org/10.5281/zenodo.17130368.
14
22
You can, for example, use the [zenodo_client](https://pypi.org/project/zenodo-client/) library to download the images:
The `Dockerfile`s used to create the images are available in the `./paper/envs` directory.
28
36
29
-
After downloading the images, you can load them into Docker, e.g. via:
37
+
If you have downloaded the images like shown above, you can load them into Docker, e.g. via the command below (or otherwise adjust the path accordingly).
The CUDA image can be started with the command below, which requires the [nvidia extension](https://docs.nvidia.com/ai-enterprise/deployment/vmware/latest/docker.html).
53
+
54
+
```bash
55
+
docker run -it --gpus all --rm -v ../:/mnt/data sebffischer/mlr3torch-jss:gpu
56
+
cd /mnt/data/paper
57
+
```
58
+
44
59
Note that the `.Rprofile` file ensures that when running R programs from the `paper` directory, the renv environment will be used unless the code is run in the docker container, where we are not relying on renv directly.
45
60
46
61
## Running the Benchmark
47
62
48
-
Note that while the benchmark uses `batchtools` for experiment definition, we don't use it for job submission in order to ensure that all GPU and CPU benchmarks respectively are run on the same machine.
63
+
While the benchmark uses `batchtools` for experiment definition, we don't use it for job submission in order to ensure that all GPU and CPU benchmarks respectively are run on the same machine.
49
64
For running the benchmarks, we strongly recommend using the docker images, because we need both PyTorch and (R-)torch, which can be somewhat tricky to setup, especially when using CUDA.
50
65
51
-
If you want to run it without the docker image, you need to ajust the `PYTHON_PATH` variable in the benchmarking scripts to the path to your Python installation, ensure that `pytorch` is installed and the `"pytorch"` algorithm in `paper/benchmark/benchmark.R` initializes the correct python environment.
66
+
If you want to run it without the docker image, you need to adjust the `PYTHON_PATH` variable in the benchmarking scripts to the path to your Python installation, ensure that `pytorch` is installed and the `"pytorch"` algorithm in `paper/benchmark/benchmark.R` initializes the correct python environment.
52
67
But again, we strongly recommend using the provided docker images for the benchmarks.
53
68
54
69
You can still reproduce the results that compare (R) `torch` with `mlr3torch` without the python environment.
55
70
To do so, you can subset the experiments that are run to not include the `"pytorch"` algorithm.
56
71
This has to be done in the benchmarking scripts, e.g. `paper/benchmark/linux-gpu.R`.
57
72
We show further down how to run only a subset of the jobs.
58
73
74
+
Note that the CUDA benchmarks were run on a machine with 80 GB VRAM, so errors are expected if you have less.
75
+
To address this, you can filter the jobs to restrict the number of layers or latent dimensions as shown further down.
76
+
59
77
### Running the Benchmarks
60
78
61
79
Note that the benchmarks take quite some time, which was required to ensure results with high precision that cover many different configurations.
@@ -114,21 +132,9 @@ For the main benchmark shown in the paper, run the following command from the `p
114
132
115
133
```r
116
134
Rscriptbenchmark/plot_benchmark.R
117
-
```
118
-
119
-
For the comparison of "ignite" with standard optimizers, run:
120
-
121
-
```r
122
135
Rscriptbenchmark/plot_optimizer.R
123
136
```
124
137
125
-
These commands generate the files:
126
-
127
-
*`paper/benchmark/plot_benchmark.png`
128
-
*`paper/benchmark/plot_benchmark_relative.png`
129
-
*`paper/benchmark/plot_optimizer.png`
130
-
*`paper/benchmark/plot_optimizer_relative.png`
131
-
132
138
## Recreating the Paper Code
133
139
134
140
The file `paper/paper_code.R` contains the code from the paper.
0 commit comments