Conversation
|
Too many files changed for review. ( |
| opacity=0.2, | ||
| background="#484981", | ||
| ), | ||
| "world/camera_info": _convert_camera_info, |
There was a problem hiding this comment.
The reason this change is needed is because multiprocessing can't pickle lambdas. Lambdas don't have names so they can't be pickled because there's nothing to reference them from the other side.
Dask cheats by serializing the bytecode of the lambda.
86f65d9 to
889662a
Compare
| @@ -1,278 +0,0 @@ | |||
| from __future__ import annotations | |||
There was a problem hiding this comment.
deleted dask stuff here
| self._close_module() | ||
|
|
||
| def _close_module(self) -> None: | ||
| with self._module_closed_lock: |
There was a problem hiding this comment.
don't double close
| raise TypeError(f"Input {input_name} is not a valid stream") | ||
| input_stream.connection = remote_stream | ||
|
|
||
| def dask_receive_msg(self, input_name: str, msg: Any) -> None: |
There was a problem hiding this comment.
no longer need these dask functions
| for module_class, module in reversed(self._deployed_modules.items()): | ||
| logger.info("Stopping module...", module=module_class.__name__) | ||
| try: | ||
| module.stop() |
There was a problem hiding this comment.
continue stopping other modules even if one errors
|
|
||
|
|
||
| @pytest.mark.slow | ||
| def test_worker_pool_modules_share_workers(create_worker_manager): |
There was a problem hiding this comment.
add test that verifies that two modules can deploy to the same worker
| self._module_class: type[ModuleT] = module_class | ||
| self._args: tuple[Any, ...] = args | ||
| self._kwargs: dict[Any, Any] = kwargs or {} | ||
| """Generic worker process that can host multiple modules.""" |
There was a problem hiding this comment.
Changed Worker to support deploying multiple modules to it.
| self._closed = False | ||
| self._started = False | ||
|
|
||
| def start(self) -> None: |
There was a problem hiding this comment.
Start the workers beforehand.
| @@ -1,60 +0,0 @@ | |||
| # Copyright 2025-2026 Dimensional Inc. | |||
There was a problem hiding this comment.
I don't think this was used and we have a blueprint to test the cam
| Returns: | ||
| Detection2DBBox instance or None if invalid | ||
| """ | ||
| from dimos.perception.detection.type import Detection2DBBox |
There was a problem hiding this comment.
Inline to avoid torch import.
| else: | ||
| logger.warning("Tracking module failed to start") | ||
|
|
||
| self.connection.start() |
There was a problem hiding this comment.
start no longer returns a boolean
| from dimos.robot.unitree.g1.blueprints.basic.unitree_g1_basic import unitree_g1_basic | ||
|
|
||
|
|
||
| def _person_only(det: Any) -> bool: |
There was a problem hiding this comment.
cannot serialize lambdas, so using functions
04f07b2 to
31f8829
Compare
leshy
left a comment
There was a problem hiding this comment.
large PR but actually acan't find any objections to core/ stuff
| model = MockModel(json_path=self.config.model_fixture) | ||
|
|
||
| with self._lock: | ||
| # Here to prevent unwanted imports in the file. |
There was a problem hiding this comment.
@paul-nechifor I assume LLM generated comments its on every import shift. not useful and looks ugly
There was a problem hiding this comment.
They're not LLM generated. I specifically added them there to indicate that those imports should not be moved to the top because they cause imports (like that of torch) which slow down the start of dimos run.
Without those comments, people might move them to the top. I often move unnecessary local imports because they're added by LLMs. LLMs often prefer to add local imports because they have the habit of producing the smallest diff possible, even when it doesn't make sense.
|
|
||
| with self._lock: | ||
| if self._tracker is None: | ||
| # Here to prevent unwanted imports in the file. |
| super().__init__() | ||
| self._skill_started = False | ||
|
|
||
| # Here to prevent unwanted imports in the file. |
Problem
core/__init__.pyCloses DIM-609
Solution
dimos.core. Now you have to import from the original place.dimos/core/__init__.py.dimosshut down cleanly, without any exceptions, and right away.Breaking Changes
multiprocessingrequires params to be pickleable, and lambdas are not because they don't have names. This worked with Dask because Dask serialized the bytecode of the lambda and reconstructed it on the other side.How to Test
Test any blueprint. Example:
Contributor License Agreement