mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-24 17:31:18 +08:00
Put prompt processing in same stream (#1122)
* put prompt processing in same stream * patch
This commit is contained in:
parent
a5e173802e
commit
cfc29c29f4
@ -1,3 +1,3 @@
|
|||||||
# Copyright © 2023-2024 Apple Inc.
|
# Copyright © 2023-2024 Apple Inc.
|
||||||
|
|
||||||
__version__ = "0.20.0"
|
__version__ = "0.20.1"
|
||||||
|
@ -274,6 +274,7 @@ def generate_step(
|
|||||||
y = sampler(logprobs)
|
y = sampler(logprobs)
|
||||||
return y, logprobs.squeeze(0)
|
return y, logprobs.squeeze(0)
|
||||||
|
|
||||||
|
with mx.stream(generation_stream):
|
||||||
while y.size > prefill_step_size:
|
while y.size > prefill_step_size:
|
||||||
model(y[:prefill_step_size][None], cache=prompt_cache)
|
model(y[:prefill_step_size][None], cache=prompt_cache)
|
||||||
mx.eval([c.state for c in prompt_cache])
|
mx.eval([c.state for c in prompt_cache])
|
||||||
|
Loading…
Reference in New Issue
Block a user