Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Dask kwargs to Ray backend #1380

Merged
merged 1 commit into from
Oct 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ludwig/backend/ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,10 @@ def __call__(self, df: pd.DataFrame) -> pd.DataFrame:


class RayBackend(RemoteTrainingMixin, Backend):
def __init__(self, horovod_kwargs=None, cache_format=PARQUET, engine=None, **kwargs):
def __init__(self, dask_kwargs=None, horovod_kwargs=None, cache_format=PARQUET, engine=None, **kwargs):
super().__init__(cache_format=cache_format, **kwargs)
self._df_engine = _get_df_engine(engine)
self._dask_kwargs = dask_kwargs or {}
self._horovod_kwargs = horovod_kwargs or {}
self._tensorflow_kwargs = {}
if cache_format not in [PARQUET, TFRECORD]:
Expand All @@ -268,8 +269,10 @@ def initialize(self):
logger.info('Initializing new Ray cluster...')
ray.init(ignore_reinit_error=True)

dask_kwargs = {**get_dask_kwargs(), **self._dask_kwargs}
logger.info(f"Dask params: {dask_kwargs}")
dask.config.set(scheduler=ray_dask_get)
self._df_engine.set_parallelism(**get_dask_kwargs())
self._df_engine.set_parallelism(**dask_kwargs)

def initialize_tensorflow(self, **kwargs):
# Make sure we don't claim any GPU resources on the head node
Expand Down