mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
activate past_present_share_buffer for sampling node (#14166)
This commit is contained in:
parent
be879c11ee
commit
74fe45bf09
1 changed files with 2 additions and 2 deletions
|
|
@ -245,7 +245,7 @@ def parse_arguments(argv: Optional[List[str]] = None) -> argparse.Namespace:
|
|||
"--past_present_share_buffer",
|
||||
required=False,
|
||||
action="store_true",
|
||||
help="Use shared buffer for past and present, currently work for gpt2 greedy search.",
|
||||
help="Use shared buffer for past and present, currently work for gpt2 greedy/sampling search.",
|
||||
)
|
||||
model_group.set_defaults(past_present_share_buffer=False)
|
||||
|
||||
|
|
@ -1365,7 +1365,7 @@ def convert_generation_model(args: argparse.Namespace, generation_type: Generati
|
|||
is_beamsearch: bool = generation_type == GenerationType.BEAMSEARCH
|
||||
is_greedysearch: bool = generation_type == GenerationType.GREEDYSEARCH
|
||||
is_sampling: bool = generation_type == GenerationType.SAMPLING
|
||||
past_present_share_buffer: bool = args.past_present_share_buffer and is_greedysearch
|
||||
past_present_share_buffer: bool = args.past_present_share_buffer and (is_greedysearch or is_sampling)
|
||||
|
||||
logger.info(f"**** past_present_share_buffer={past_present_share_buffer}, is_greedysearch={is_greedysearch}")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue