Skip to content

Commit 2a27ab2

Browse files
ishandhananilifuhuang
authored andcommitted
feat(engine): add bootstrap parameters to generate methods (dynamo) (sgl-project#6075)
1 parent e9a1b1c commit 2a27ab2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

python/sglang/srt/entrypoints/engine.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ def generate(
163163
custom_logit_processor: Optional[Union[List[str], str]] = None,
164164
return_hidden_states: bool = False,
165165
stream: bool = False,
166+
bootstrap_host: Optional[Union[List[str], str]] = None,
167+
bootstrap_port: Optional[Union[List[int], int]] = None,
168+
bootstrap_room: Optional[Union[List[int], int]] = None,
166169
) -> Union[Dict, Iterator[Dict]]:
167170
"""
168171
The arguments of this function is the same as `sglang/srt/managers/io_struct.py::GenerateReqInput`.
@@ -181,6 +184,9 @@ def generate(
181184
custom_logit_processor=custom_logit_processor,
182185
return_hidden_states=return_hidden_states,
183186
stream=stream,
187+
bootstrap_host=bootstrap_host,
188+
bootstrap_port=bootstrap_port,
189+
bootstrap_room=bootstrap_room,
184190
)
185191
loop = asyncio.get_event_loop()
186192
generator = self.tokenizer_manager.generate_request(obj, None)
@@ -227,6 +233,9 @@ async def async_generate(
227233
lora_path: Optional[List[Optional[str]]] = None,
228234
custom_logit_processor: Optional[Union[List[str], str]] = None,
229235
stream: bool = False,
236+
bootstrap_host: Optional[Union[List[str], str]] = None,
237+
bootstrap_port: Optional[Union[List[int], int]] = None,
238+
bootstrap_room: Optional[Union[List[int], int]] = None,
230239
) -> Union[Dict, AsyncIterator[Dict]]:
231240
"""
232241
The arguments of this function is the same as `sglang/srt/managers/io_struct.py::GenerateReqInput`.
@@ -244,6 +253,9 @@ async def async_generate(
244253
lora_path=lora_path,
245254
stream=stream,
246255
custom_logit_processor=custom_logit_processor,
256+
bootstrap_host=bootstrap_host,
257+
bootstrap_port=bootstrap_port,
258+
bootstrap_room=bootstrap_room,
247259
)
248260
generator = self.tokenizer_manager.generate_request(obj, None)
249261

0 commit comments

Comments
 (0)