Unverified Commit 516c3f78 authored by Thomas Parnell's avatar Thomas Parnell Committed by GitHub
Browse files

[Bugfix] Fix logic for choosing default prefix caching setting (#29393)


Signed-off-by: default avatarThomas Parnell <tpa@zurich.ibm.com>
parent 51fc9e01
......@@ -277,8 +277,9 @@ def test_prefix_cache_default():
parser = EngineArgs.add_cli_args(FlexibleArgumentParser())
args = parser.parse_args([])
# should be None by default (depends on model).
engine_args = EngineArgs.from_cli_args(args=args)
assert engine_args.enable_prefix_caching, "prefix caching should default to on."
assert engine_args.enable_prefix_caching is None
# with flag to turn it on.
args = parser.parse_args(["--enable-prefix-caching"])
......
......@@ -880,7 +880,11 @@ class EngineArgs:
"--num-gpu-blocks-override", **cache_kwargs["num_gpu_blocks_override"]
)
cache_group.add_argument(
"--enable-prefix-caching", **cache_kwargs["enable_prefix_caching"]
"--enable-prefix-caching",
**{
**cache_kwargs["enable_prefix_caching"],
"default": None,
},
)
cache_group.add_argument(
"--prefix-caching-hash-algo", **cache_kwargs["prefix_caching_hash_algo"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment