Skip to content

Commit d6bde0a

Browse files
authored
Revert "Bug Fix in namespace (#95)"
This reverts commit 5bf9e42.
1 parent 5bf9e42 commit d6bde0a

File tree

5 files changed

+2
-15
lines changed

5 files changed

+2
-15
lines changed

trinity/cli/launcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def run(config_path: str, dlc: bool = False, plugin_dir: str = None):
191191
activate_data_module(
192192
f"{data_processor_config.data_processor_url}/experience_pipeline", config_path
193193
)
194-
ray_namespace = config.ray_namespace
194+
ray_namespace = f"{config.project}-{config.name}"
195195
if dlc:
196196
from trinity.utils.dlc_utils import setup_ray_cluster
197197

trinity/common/config.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ class InferenceModelConfig:
181181

182182
# ! DO NOT SET
183183
bundle_indices: str = ""
184-
ray_namespace: str = ""
185184

186185

187186
@dataclass
@@ -354,8 +353,6 @@ class Config:
354353
checkpoint_root_dir: str = ""
355354
# ! DO NOT SET, automatically generated as `checkpoint_root_dir/project/name`
356355
checkpoint_job_dir: str = ""
357-
# ! DO NOT SET, automatically generated as f"{config.project}-{config.name}"
358-
ray_namespace: str = ""
359356

360357
algorithm: AlgorithmConfig = field(default_factory=AlgorithmConfig)
361358
data_processor: DataProcessorConfig = field(default_factory=DataProcessorConfig)
@@ -578,9 +575,6 @@ def check_and_update(self) -> None: # noqa: C901
578575
"""Check and update the config."""
579576
self._check_deprecated()
580577

581-
# set namespace
582-
self.ray_namespace = f"{self.project}-{self.name}"
583-
584578
# check algorithm
585579
self._check_algorithm()
586580

@@ -611,9 +605,6 @@ def check_and_update(self) -> None: # noqa: C901
611605
self.explorer.rollout_model.max_prompt_tokens = self.model.max_prompt_tokens
612606
if self.explorer.rollout_model.max_response_tokens is None:
613607
self.explorer.rollout_model.max_response_tokens = self.model.max_response_tokens
614-
self.explorer.rollout_model.ray_namespace = self.ray_namespace
615-
for model in self.explorer.auxiliary_models:
616-
model.ray_namespace = self.ray_namespace
617608

618609
# check synchronizer
619610
self.synchronizer.explorer_world_size = (

trinity/common/models/vllm_async_model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ async def init_process_group(
298298
timeout,
299299
update_with_checkpoint,
300300
state_dict_meta,
301-
self.config.ray_namespace,
302301
),
303302
)
304303

trinity/common/models/vllm_model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def init_process_group(
112112
timeout,
113113
update_with_checkpoint,
114114
state_dict_meta,
115-
self.config.ray_namespace,
116115
),
117116
)
118117

trinity/common/models/vllm_worker.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def init_process_group(
2323
timeout: int = 1200,
2424
update_with_checkpoint: bool = True,
2525
state_dict_meta: list = None,
26-
namespace: str = "",
2726
):
2827
"""Init torch process group for model weights update"""
2928
assert torch.distributed.is_initialized(), "default torch process group must be initialized"
@@ -53,7 +52,6 @@ def init_process_group(
5352
group_name=group_name,
5453
)
5554
logger.info("vLLM init_process_group finished.")
56-
self.namespace = namespace
5755
self._explorer_actor = None
5856

5957
def set_state_dict_meta(self, state_dict_meta):
@@ -63,7 +61,7 @@ def update_weight(self):
6361
"""Broadcast weight to all vllm workers from source rank 0 (actor model)"""
6462
assert self._state_dict_meta is not None
6563
if self._explorer_actor is None:
66-
self._explorer_actor = ray.get_actor(name=EXPLORER_NAME, namespace=self.namespace)
64+
self._explorer_actor = ray.get_actor(name=EXPLORER_NAME)
6765
for name, dtype_str, shape in self._state_dict_meta:
6866
if self._weight_update_rank == 0:
6967
weight = ray.get(self._explorer_actor.get_weight.remote(name))

0 commit comments

Comments
 (0)