Skip to content

Commit 4511b74

Browse files
committed
hope I fixed it for good
1 parent f9adc0a commit 4511b74

File tree

479 files changed

+1954
-43
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

479 files changed

+1954
-43
lines changed

paper/.Rprofile_debian

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Setting HTTP User Agent to identify OS, such that P3M can detect compatibility
2+
options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"])))
3+
4+
# Ensure curl is used for downloading packages
5+
options(download.file.method = "curl")
6+
7+
# Enable verbose output for curl and again set HHTP user agent
8+
options(download.file.extra = paste(
9+
# Follow redirects, show errors, and display the HTTP status and URL
10+
'-fsSL -w "%{stderr}curl: HTTP %{http_code} %{url_effective}\n"',
11+
# Configure the R user agent header to install Linux binary packages
12+
sprintf('--header "User-Agent: R (%s)"', paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"]))
13+
))
14+
15+
options(
16+
repos = c(CRAN = "https://packagemanager.posit.co/cran/__linux__/bookworm/latest"),
17+
pkgType = "binary",
18+
install.packages.check.source = "no"
19+
)
20+
21+
# Use default library paths; do not hardcode Linux-specific locations

paper/Dockerfile_cpu

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# -------- CPU-only base image (R 4.5) --------
2+
FROM rocker/r-ver:4.5.0
3+
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
python3 python3-venv python3-dev python3-pip ca-certificates curl \
6+
&& rm -rf /var/lib/apt/lists/*
7+
8+
# Create and use venv
9+
RUN python3 -m venv /opt/venv
10+
ENV PATH="/opt/venv/bin:${PATH}"
11+
12+
RUN pip install --no-cache-dir --upgrade pip \
13+
&& pip install --no-cache-dir \
14+
torch --index-url https://download.pytorch.org/whl/cpu \
15+
numpy
16+
17+
COPY .Rprofile /usr/local/lib/R/etc/Rprofile.site
18+
RUN R -q -e "install.packages('torch'); torch::install_torch()"
19+
20+
RUN R -q -e "install.packages(c( \
21+
'mlr3mbo', \
22+
'torchdatasets', \
23+
'mlr3viz', \
24+
'batchtools', \
25+
'here', \
26+
'reticulate', \
27+
'cowplot', \
28+
'remotes', \
29+
'precrec', \
30+
'knitr', \
31+
'mlr3learners', \
32+
'ranger', \
33+
'rgenoud', \
34+
'DiceKriging' \
35+
))"
36+
37+
RUN R -q -e "remotes::install_github('mlr-org/mlr3torch@4f43857')"
38+
39+
CMD ["bash"]
40+
41+

paper/Dockerfile_mkl

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,23 @@ ENV LD_LIBRARY_PATH=$R_HOME/lib:$LD_LIBRARY_PATH
9191

9292
# -------- install R packages
9393
RUN R -q -e "install.packages('torch'); torch::install_torch()"
94-
RUN R -q -e "install.packages('mlr3mbo')"
95-
RUN R -q -e "install.packages('torchdatasets')"
96-
RUN R -q -e "install.packages('mlr3viz')"
97-
RUN R -q -e "install.packages('batchtools')"
98-
RUN R -q -e "install.packages('here')"
99-
RUN R -q -e "install.packages('reticulate')"
100-
RUN R -q -e "install.packages('cowplot')"
101-
RUN R -q -e "install.packages('remotes')"
102-
RUN R -q -e "install.packages('precrec')"
103-
RUN R -q -e "remotes::install_github('mlr-org/mlr3torch@53c0262')"
104-
105-
CMD ["bash"]
94+
RUN R -q -e "install.packages(c( \
95+
'mlr3mbo', \
96+
'torchdatasets', \
97+
'mlr3viz', \
98+
'batchtools', \
99+
'here', \
100+
'reticulate', \
101+
'cowplot', \
102+
'remotes', \
103+
'precrec', \
104+
'knitr', \
105+
'mlr3learners', \
106+
'ranger', \
107+
'rgenoud', \
108+
'DiceKriging' \
109+
))"
110+
111+
RUN R -q -e "remotes::install_github('mlr-org/mlr3torch@4f43857')"
112+
113+
CMD ["bash"]

paper/benchmark/benchmark.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ library(batchtools)
22
library(mlr3misc)
33

44
reg = makeExperimentRegistry(
5-
file.dir = here::here("paper", "benchmark", "registry"),
5+
file.dir = "/registry",
66
packages = "checkmate"
77
)
88
reg$cluster.functions = makeClusterFunctionsInteractive()
@@ -50,7 +50,7 @@ addAlgorithm("pytorch", fun = function(instance, job, data, jit, ...) {
5050
library(reticulate)
5151
x = try(
5252
{
53-
reticulate::use_python("/usr/bin/python3", required = TRUE)
53+
reticulate::use_python("/opt/venv/bin/python3", required = TRUE)
5454
reticulate::source_python(here::here("paper/benchmark/time_pytorch.py"))
5555
print(reticulate::py_config())
5656
time_pytorch(...)
@@ -113,17 +113,17 @@ addExperiments(
113113
),
114114
algo.designs = list(
115115
rtorch = data.frame(
116-
jit = c(FALSE),
116+
jit = c(FALSE, TRUE),
117117
opt_type = c("ignite"),
118118
tag = "cuda_exp"
119119
),
120120
mlr3torch = data.frame(
121-
jit = c(FALSE),
121+
jit = c(FALSE, TRUE),
122122
opt_type = c("ignite"),
123123
tag = "cuda_exp"
124124
),
125125
pytorch = data.frame(
126-
jit = c(FALSE),
126+
jit = c(FALSE, TRUE),
127127
tag = "cuda_exp"
128128
)
129129
),
@@ -154,17 +154,17 @@ addExperiments(
154154
),
155155
algo.designs = list(
156156
rtorch = data.frame(
157-
jit = c(FALSE),
157+
jit = c(FALSE, TRUE),
158158
opt_type = c("ignite"),
159159
tag = "cpu_exp"
160160
),
161161
mlr3torch = data.frame(
162-
jit = c(FALSE),
162+
jit = c(FALSE, TRUE),
163163
opt_type = c("ignite"),
164164
tag = "cpu_exp"
165165
),
166166
pytorch = data.frame(
167-
jit = c(FALSE),
167+
jit = c(FALSE, TRUE),
168168
tag = "cpu_exp"
169169
)
170170
),
-18.9 KB
Binary file not shown.
12.3 KB
Binary file not shown.
12.5 KB
Binary file not shown.
12.3 KB
Binary file not shown.
20.6 KB
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### [bt]: This is batchtools v0.9.17.9000
2+
### [bt]: Starting calculation of 1 jobs
3+
### [bt]: Setting working directory to '/Users/sebi/mlr/mlr3torch'
4+
### [bt]: Memory measurement disabled
5+
### [bt]: Starting job [batchtools job.id=355]
6+
### [bt]: Generating problem instance for problem 'runtime_train' ...
7+
### [bt]: Applying algorithm 'rtorch' on problem 'runtime_train' for job 355 (seed = 8547) ...
8+
9+
### [bt]: Job terminated successfully [batchtools job.id=355]
10+
### [bt]: Calculation finished!

0 commit comments

Comments
 (0)