[Benchmark][Bugfix] Fix SonnetDataset default values in benchmark_throughput.py (#16556)

This commit is contained in:
Jennifer Zhao 2025-04-13 17:20:26 -07:00 committed by GitHub
parent d085a44082
commit 63d2705edb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -597,18 +597,26 @@ if __name__ == "__main__":
parser.add_argument( parser.add_argument(
"--prefix-len", "--prefix-len",
type=int, type=int,
default=0, default=None,
help="Number of fixed prefix tokens before the random " help=f"Number of prefix tokens to be used in RandomDataset "
"context in a request (default: 0).", "and SonnetDataset. For RandomDataset, the total input "
) "length is the sum of prefix-len (default: "
f"{RandomDataset.DEFAULT_PREFIX_LEN}) and a random context length "
"sampled from [input_len * (1 - range_ratio), "
"input_len * (1 + range_ratio)]. For SonnetDataset, "
f"prefix_len (default: {SonnetDataset.DEFAULT_PREFIX_LEN}) "
"controls how much of the input is fixed lines versus "
"random lines, but the total input length remains approximately "
"input_len tokens.")
# random dataset # random dataset
parser.add_argument( parser.add_argument(
"--random-range-ratio", "--random-range-ratio",
type=float, type=float,
default=0.0, default=None,
help="Range ratio for sampling input/output length, " help=f"Range ratio (default : {RandomDataset.DEFAULT_RANGE_RATIO}) "
"used only for RandomDataset. Must be in the range [0, 1) to define " "for sampling input/output length, "
"a symmetric sampling range " "used only for RandomDataset. Must be in the range [0, 1) to "
"define a symmetric sampling range "
"[length * (1 - range_ratio), length * (1 + range_ratio)].", "[length * (1 - range_ratio), length * (1 + range_ratio)].",
) )