Skip to content

Commit

Permalink
FIX: Distributed Dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
User3574 committed Aug 9, 2023
1 parent a9a22dd commit f4e032e
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions ai/src/itwinai/backend/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,27 @@ def __init__(self, pipeline, class_dict, param_space):
self.param_space = param_space

# Init ray
ray.init()
ray.init(ignore_reinit_error=True, num_gpus=2)
print('Ray is initialized')

def worker_fn(self, config, pipeline, class_dict):
print('Worker fn')
# Should have same structure pipe and params
# def replace(pipe, params):
# for param in params:
# if type(pipe[param]) != dict:
# pipe[param] = params[param]
# else:
# replace(pipe[param], params[param])
# return pipe
#
# template = pipeline
# with open(template, 'r') as f:
# doc = yaml.safe_load(f)
# doc = replace(doc, config)
#
# executor = LocalExecutor(doc, class_dict)
# executor.setup(None)
# executor.execute(None)
return {"test": 1}
def replace(pipe, params):
for param in params:
if type(pipe[param]) != dict:
pipe[param] = params[param]
else:
replace(pipe[param], params[param])
return pipe

template = pipeline
with open(template, 'r') as f:
doc = yaml.safe_load(f)
doc = replace(doc, config)

executor = LocalExecutor(doc, class_dict)
executor.setup(None)
executor.execute(None)

def execute(self, args):
print('Execute')
Expand Down

0 comments on commit f4e032e

Please sign in to comment.