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

[BUG] Missing extra_params when constructing operands #2998

Closed
fyrestone opened this issue May 5, 2022 · 0 comments · Fixed by #2999
Closed

[BUG] Missing extra_params when constructing operands #2998

fyrestone opened this issue May 5, 2022 · 0 comments · Fixed by #2999
Assignees

Comments

@fyrestone
Copy link
Contributor

Describe the bug
Some operands will pass the extra_params from client to mars server. But, this PR #2756 changes the operand constructing behaviour, it overwrites the value of extra_params from the kwargs.

# mars/core/operand/base.py
class Operand(Base, OperatorLogicKeyGeneratorMixin, metaclass=OperandMetaclass):
    def __init__(self: OperandType, *args, **kwargs):
        self._parse_kwargs(kwargs)
        super().__init__(*args, **kwargs)

    @classmethod
    def _parse_kwargs(cls, kwargs: Dict[str, Any]):
        kwargs["extra_params"] = extras = AttributeDict()  # <--- Here the extra_params should be initialized from the kwargs
        kwargs["scheduling_hint"] = scheduling_hint = kwargs.get(
            "scheduling_hint", SchedulingHint()
        )
        for k in set(kwargs):
            if k in cls._FIELDS:
                continue
            elif k in SchedulingHint.all_hint_names:
                setattr(scheduling_hint, k, kwargs.pop(k))
            else:
                extras[k] = kwargs.pop(k)

To Reproduce
To help us reproducing this bug, please provide information below:

  1. Your Python version 3.7.7
  2. The version of Mars you use Latest master
  3. Versions of crucial packages, such as numpy, scipy and pandas
  4. Full stack of the error.
  5. Minimized code to reproduce the error.
~/miniconda3/lib/python3.7/site-packages/mars/core/entity/tileables.py in execute(self, session, **kw)
    460 
    461     def execute(self, session=None, **kw):
--> 462         result = self.data.execute(session=session, **kw)
    463         if isinstance(result, TILEABLE_TYPE):
    464             return self

~/miniconda3/lib/python3.7/site-packages/mars/core/entity/executable.py in execute(self, session, **kw)
    140 
    141         session = _get_session(self, session)
--> 142         return execute(self, session=session, **kw)
    143 
    144     def _check_session(self , session: SessionType, action: str):

~/miniconda3/lib/python3.7/site-packages/mars/deploy/oscar/session.py in execute(tileable, session, wait, new_session_kwargs, show_progress, progress_update_interval, *tileables, **kwargs)
   1862         show_progress=show_progress,
   1863         progress_update_interval=progress_update_interval,
-> 1864         **kwargs,
   1865     )
   1866 

~/miniconda3/lib/python3.7/site-packages/mars/deploy/oscar/session.py in execute(self, tileable, show_progress, warn_duplicated_execution, *tileables, **kwargs)
   1651         try:
   1652             execution_info: ExecutionInfo = fut.result(
-> 1653                 timeout=self._isolated_session.timeout
   1654             )
   1655         except KeyboardInterrupt:  # pragma: no cover

~/miniconda3/lib/python3.7/concurrent/futures/_base.py in result(self, timeout)
    433                 raise CancelledError()
    434             elif self._state == FINISHED:
--> 435                 return self.__get_result()
    436             else:
    437                 raise TimeoutError()

~/miniconda3/lib/python3.7/concurrent/futures/_base.py in __get_result(self)
    382     def __get_result(self):
    383         if self._exception:
--> 384             raise self._exception
    385         else:
    386             return self._result

~/miniconda3/lib/python3.7/site-packages/mars/deploy/oscar/session.py in _execute(session, wait, show_progress, progress_update_interval, cancelled, *tileables, **kwargs)
   1836             # set cancelled to avoid wait task leak
   1837             cancelled.set()
-> 1838         await execution_info
   1839     else:
   1840         return execution_info

~/miniconda3/lib/python3.7/site-packages/mars/deploy/oscar/session.py in wait()
    105 
    106             async def wait():
--> 107                 return await self._aio_task
    108 
    109             self._future_local.future = fut = asyncio.run_coroutine_threadsafe(

~/miniconda3/lib/python3.7/site-packages/mars/deploy/oscar/session.py in _run_in_background(self, tileables, task_id, progress, profiling)
    955                     )
    956                 if task_result.error:
--> 957                     raise task_result.error.with_traceback(task_result.traceback)
    958             if cancelled:
    959                 return

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/services/task/supervisor/processor.py in run()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/services/task/supervisor/processor.py in _iter_stage_chunk_graph()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/services/task/supervisor/processor.py in _get_next_chunk_graph()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/lib/aio/_threads.py in to_thread()

/usr/local/python3/lib/python3.7/concurrent/futures/thread.py in run()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/services/task/supervisor/processor.py in next_chunk_graph()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/services/task/supervisor/preprocessor.py in tile()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/core/graph/builder/chunk.py in build()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/core/graph/builder/chunk.py in _build()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/services/task/supervisor/preprocessor.py in _iter_without_check()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/core/graph/builder/chunk.py in _iter()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/core/graph/builder/chunk.py in _tile()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/core/graph/builder/chunk.py in _tile_handler()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/mars/core/entity/tileables.py in tile()

/home/admin/ray-pack/tmp/job/35000080/pyenv/lib/python3.7/site-packages/dsmp/extensions/mars/odps_op_with_dsmp.py in _tile()

Exception: pyodps not support dsmp, the extra_param is {'_sparse': False, '_memory_scale': None}

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant