MCPcopy Index your code
hub / github.com/hpcaitech/ColossalAI / step

Method step

colossalai/inference/core/rpc_engine.py:273–284  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

271 return ret[0]
272
273 def step(self) -> List[str]:
274 batch = self.request_handler.schedule()
275
276 input_token_ids, input_meta_data = self.prepare_input(batch)
277 # TODO: padding_id is used for generating attn_mask and will be removed if nopad version is supported.
278 next_tokens = asyncio.run(self.step_(input_token_ids, input_meta_data))
279
280 # update the request_handler
281 next_tokens = torch.tensor(next_tokens, dtype=torch.int)
282 self.request_handler.append_next_tokens(next_tokens)
283 finished_sequences = self.request_handler.update()
284 return finished_sequences
285
286 def kill_workers(self):
287 """

Callers

nothing calls this directly

Calls 6

prepare_inputMethod · 0.95
step_Method · 0.95
append_next_tokensMethod · 0.80
scheduleMethod · 0.45
runMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected