-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test:[nvbug 5415268] add kv_cache_free_gpu_mem_fraction param and llama4 rcca cases #6432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,4 @@ ruff==0.9.4 | |
lm_eval[api]==0.4.8 | ||
docstring_parser | ||
genai-perf==0.0.13 | ||
triton==3.3.1; platform_machine == "x86_64" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ | |
"llama_v4_maverick_17b_128e_instruct": | ||
"llama4-models/Llama-4-Maverick-17B-128E-Instruct", | ||
"llama_v4_maverick_17b_128e_instruct_fp8": | ||
"llama4-models/Llama-4-Maverick-17B-128E-Instruct-FP8", | ||
"llama4-models/nvidia/Llama-4-Maverick-17B-128E-Instruct-FP8", | ||
# "llama_30b": "llama-models/llama-30b-hf", | ||
"mixtral_8x7b_v0.1": "Mixtral-8x7B-v0.1", | ||
"mixtral_8x7b_v0.1_instruct": "Mixtral-8x7B-Instruct-v0.1", | ||
|
@@ -321,34 +321,33 @@ class PerfTestConfig: | |
This should hold only the attributes that distinguish different tests. | ||
""" | ||
|
||
def __init__( | ||
self, | ||
*, | ||
model_name: str = "", | ||
runtime: str = "python", | ||
static_batching: str = "", | ||
api: str = "", | ||
streaming: str = "", | ||
backend: str = "", | ||
mode: str = "plugin", | ||
data_type: str = "float16", | ||
max_batch_size: int = 512, | ||
max_num_tokens: int = 2048, | ||
gpu_weights_percent: float = -1, | ||
batch_sizes: List[int] = [0], | ||
input_lens: List[int] = [8], | ||
output_lens: List[int] = [1], | ||
num_beams: int = 1, | ||
num_loras: int = 0, | ||
num_reqs: int = 512, | ||
concurrency: int = -1, | ||
quantization: str = "", | ||
kv_cache_dtype: str = "auto", | ||
ep_size: int = None, | ||
tp_size: int = 1, | ||
pp_size: int = 1, | ||
num_gpus: int = 1, | ||
): | ||
def __init__(self, | ||
*, | ||
model_name: str = "", | ||
runtime: str = "python", | ||
static_batching: str = "", | ||
api: str = "", | ||
streaming: str = "", | ||
backend: str = "", | ||
mode: str = "plugin", | ||
data_type: str = "float16", | ||
max_batch_size: int = 512, | ||
max_num_tokens: int = 2048, | ||
kv_cache_free_gpu_mem_fraction: float = 0.9, | ||
gpu_weights_percent: float = -1, | ||
batch_sizes: List[int] = [0], | ||
input_lens: List[int] = [8], | ||
output_lens: List[int] = [1], | ||
num_beams: int = 1, | ||
num_loras: int = 0, | ||
num_reqs: int = 512, | ||
concurrency: int = -1, | ||
quantization: str = "", | ||
kv_cache_dtype: str = "auto", | ||
ep_size: int = None, | ||
tp_size: int = 1, | ||
pp_size: int = 1, | ||
num_gpus: int = 1): | ||
# The model name. | ||
self.model_name = model_name | ||
# Python or cpp/cppmanager runtime. | ||
|
@@ -371,6 +370,8 @@ def __init__( | |
self.max_batch_size = max_batch_size | ||
# Max number of tokens to build TRT engine with. | ||
self.max_num_tokens = max_num_tokens | ||
# kv cache free gpu mem fraction | ||
self.kv_cache_free_gpu_mem_fraction = kv_cache_free_gpu_mem_fraction | ||
# List of batch sizes to run benchmark with. | ||
self.batch_sizes = batch_sizes | ||
# List of input lens to run benchmark with. | ||
|
@@ -401,6 +402,8 @@ def __init__( | |
self.num_gpus = num_gpus | ||
# Just build engines | ||
self.build_only = False | ||
# kv cache free gpu mem fraction | ||
self.kv_cache_free_gpu_mem_fraction = kv_cache_free_gpu_mem_fraction | ||
|
||
def to_string(self, | ||
custom_bs: int = None, | ||
|
@@ -444,6 +447,10 @@ def to_string(self, | |
# Add Max number of tokens. | ||
entries.append(f"maxnt:{self.max_num_tokens}") | ||
|
||
# Add kv cache free gpu mem fraction. | ||
if self.kv_cache_free_gpu_mem_fraction != 0.9: | ||
entries.append(f"kv_frac:{self.kv_cache_free_gpu_mem_fraction}") | ||
|
||
Comment on lines
+450
to
+453
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove duplicate string representation logic. The Remove the duplicate logic: # Add number of GPUs.
if self.num_gpus > 1:
entries.append(f"gpus:{self.num_gpus}")
- # Add kv cache free gpu mem fraction.
- if self.kv_cache_free_gpu_mem_fraction != 0.9:
- entries.append(f"kv_frac:{self.kv_cache_free_gpu_mem_fraction}")
-
# Concatenate labels with "-".
return "-".join(entries) Also applies to: 527-530 🤖 Prompt for AI Agents
|
||
if self.build_only: | ||
entries.append(f"build_only") | ||
|
||
|
@@ -514,6 +521,10 @@ def to_string(self, | |
if self.num_gpus > 1: | ||
entries.append(f"gpus:{self.num_gpus}") | ||
|
||
# Add kv cache free gpu mem fraction. | ||
if self.kv_cache_free_gpu_mem_fraction != 0.9: | ||
entries.append(f"kv_frac:{self.kv_cache_free_gpu_mem_fraction}") | ||
|
||
# Concatenate labels with "-". | ||
return "-".join(entries) | ||
|
||
|
@@ -553,6 +564,10 @@ def load_from_str(self, test_param_labels) -> None: | |
if labels[0].startswith("maxnt"): | ||
self.max_num_tokens = int(labels.pop(0).replace("maxnt:", "")) | ||
|
||
if labels[0].startswith("kv_frac:"): | ||
self.kv_cache_free_gpu_mem_fraction = float( | ||
labels.pop(0).replace("kv_frac:", "")) | ||
|
||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if labels[0] == "build_only": | ||
self.build_only = True | ||
labels.pop(0) | ||
|
@@ -621,6 +636,11 @@ def load_from_str(self, test_param_labels) -> None: | |
self.num_gpus = 1 if not labels[0].startswith("gpus:") else int( | ||
labels.pop(0).replace("gpus:", "")) | ||
|
||
if len(labels) > 0: | ||
self.kv_cache_free_gpu_mem_fraction = 0.9 if not labels[ | ||
0].startswith("kv_frac:") else float( | ||
labels.pop(0).replace("kv_frac:", "")) | ||
|
||
assert len( | ||
labels | ||
) == 0, f"Invalid test name! Some labels cannot be parsed: {labels}" | ||
|
@@ -1210,9 +1230,10 @@ def get_trtllm_bench_command(self, engine_dir): | |
f"--model_path={model_dir}", | ||
"throughput", | ||
f"--dataset={dataset_path}", | ||
f"--max_batch_size={self._config.max_batch_size}", | ||
f"--max_num_tokens={self._config.max_num_tokens}", | ||
# f"--max_batch_size={self._config.max_batch_size}", | ||
# f"--max_num_tokens={self._config.max_num_tokens}", | ||
f"--report_json={report_path}", | ||
f"--kv_cache_free_gpu_mem_fraction={self._config.kv_cache_free_gpu_mem_fraction}" | ||
] | ||
if self._config.backend != "pytorch": | ||
benchmark_cmd += [f"--engine_dir={engine_dir}"] | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.