-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added changes to enable dynamo exporter
- Loading branch information
1 parent
16c94c8
commit 6af5245
Showing
4 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
get_sample_inputs, | ||
get_sample_with_past_kv_inputs, | ||
verify_ort_inputs, | ||
get_dynamo_inputs | ||
) | ||
from llama_torch import setup_torch_model | ||
from transformers import AutoConfig | ||
|
@@ -41,8 +42,10 @@ def get_inputs(args: argparse.Namespace, config: AutoConfig): | |
world_size = get_size() | ||
batch_size = 2 | ||
past_sequence_length, sequence_length, max_sequence_length = get_sequence_lengths(args, config) | ||
|
||
if args.merged: | ||
|
||
Check warning Code scanning / lintrunner RUFF/W293 Warning
Blank line contains whitespace.
See https://docs.astral.sh/ruff/rules/blank-line-with-whitespace |
||
if args.dynamo: | ||
inputs = get_dynamo_inputs(config, args.device, batch_size, sequence_length, return_dict=True) | ||
Check failure Code scanning / CodeQL Wrong number of arguments in a call Error
Call to
function get_dynamo_inputs Error loading related location Loading |
||
elif args.merged: | ||
inputs = get_merged_sample_with_past_kv_inputs( | ||
config, | ||
args.device, | ||
|
@@ -166,6 +169,7 @@ def verify_parity( | |
def get_args(argv: list[str]): | ||
parser = argparse.ArgumentParser() | ||
|
||
|
||
Check warning Code scanning / lintrunner RUFF/W293 Warning
Blank line contains whitespace.
See https://docs.astral.sh/ruff/rules/blank-line-with-whitespace |
||
parser.add_argument( | ||
"-m", | ||
"--model_name", | ||
|
@@ -236,6 +240,14 @@ def get_args(argv: list[str]): | |
choices=["int4", "int8", "fp16", "fp32"], | ||
help="Precision of model", | ||
) | ||
|
||
Check warning Code scanning / lintrunner RUFF/W293 Warning
Blank line contains whitespace.
See https://docs.astral.sh/ruff/rules/blank-line-with-whitespace |
||
parser.add_argument( | ||
"--dynamo", | ||
action="store_true", | ||
help="Use Dynamo model inputs for parity check", | ||
) | ||
parser.set_defaults(dynamo=False) | ||
|
||
|
||
parser.add_argument( | ||
"--cache_dir", | ||
|
This file contains 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