From 02844be8caefe763a3c93da908db42e58789997b Mon Sep 17 00:00:00 2001
From: PGijsbers
Date: Fri, 14 May 2021 12:21:16 +0200
Subject: [PATCH] Convert single task study calls to a task call
This avoids performing a call to retrieve the study and all their
dataset metadata (2 calls total).
---
amlb/runners/aws.py | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/amlb/runners/aws.py b/amlb/runners/aws.py
index 8f58efa76..54de66362 100644
--- a/amlb/runners/aws.py
+++ b/amlb/runners/aws.py
@@ -333,14 +333,23 @@ def _setup(_self):
def _run(_self):
try:
resources_root = "/custom" if rconfig().aws.use_docker else "/s3bucket/user"
+ benchmark = (self._forward_params['benchmark_name']if self.benchmark_path is None or self.benchmark_path.startswith(rconfig().root_dir)
+ else "{}/{}".format(resources_root, self._rel_path(self.benchmark_path)))
+
+ if benchmark.startswith('openml/s/') and len(task_names) == 1:
+ task_id = next(task['openml_task_id'] for task in self.benchmark_def if task['name'] == task_names[0])
+ benchmark = f'openml/t/{task_id}'
+ _task_names = []
+ else:
+ _task_names = task_names
+
_self.ext.instance_id = self._start_instance(
instance_def,
script_params="{framework} {benchmark} {constraint} {task_param} {folds_param} -Xseed={seed}".format(
framework=self._forward_params['framework_name'],
- benchmark=(self._forward_params['benchmark_name']if self.benchmark_path is None or self.benchmark_path.startswith(rconfig().root_dir)
- else "{}/{}".format(resources_root, self._rel_path(self.benchmark_path))),
+ benchmark=benchmark,
constraint=self._forward_params['constraint_name'],
- task_param='' if len(task_names) == 0 else ' '.join(['-t']+task_names),
+ task_param='' if len(_task_names) == 0 else ' '.join(['-t']+_task_names),
folds_param='' if len(folds) == 0 else ' '.join(['-f']+folds),
seed=seed,
),