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

Apply replica id to model seed default for vllm_module_v2. #193

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions chatlearn/models/vllm_module_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,16 @@ def setup_vllm(self, workers):
else:
model_loader_extra_config = None

if self.model_args.get("apply_replica_id_to_seed", True):
seed = self.model_args.get("seed", 0) + self.replica_id
haolin-nju marked this conversation as resolved.
Show resolved Hide resolved
else:
seed = self.model_args.get("seed", 0)

self.llm = LLM(
model=self.model_args['tokenizer'],
tokenizer=self.model_args['tokenizer'],
max_seq_len_to_capture=self.model_args.get("seq_length"),
seed=seed,
# load model: 'dummy' for megatron ckpt or mock weight; others for hf ckpt.
load_format=load_format,
model_loader_extra_config=model_loader_extra_config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ tensor_model_parallel_size: ${policy_tp}
pipeline_model_parallel_size: ${policy_pp}

vllm_load_format: ${vllm_load_format:dummy}
apply_replica_id_to_seed: ${apply_replica_id_to_seed:True}
Loading