-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Support fusion options for benchmark.py #10900
Conversation
|
||
if 'pt' in model_source: | ||
with torch.no_grad(): | ||
onnx_model_file, is_valid_onnx_model, vocab_size, max_sequence_length = export_onnx_model_from_pt( | ||
model_name, MODELS[model_name][1], MODELS[model_name][2], MODELS[model_name][3], model_class, | ||
config_modifier, cache_dir, onnx_dir, input_names, use_gpu, precision, optimizer_info, | ||
validate_onnx, use_raw_attention_mask, overwrite, model_fusion_statistics) | ||
validate_onnx, use_raw_attention_mask, overwrite, model_fusion_statistics, fusion_options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might log some warning as fusion_options will only take effect when optimizer_info is set to by_script.
class OptimizerInfo(Enum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a warning.
can we append one example of fusion options here? Refers to: onnxruntime/python/tools/transformers/benchmark.py:35 in 0c79f92. [](commit_id = 0c79f92, deletion_comment = False) |
Yes, added an example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* Support fusion options for benchmark.py * Add fusion options for tf model export as well. * Add command example and warning related to fusion options.
* Support fusion options for benchmark.py * Add fusion options for tf model export as well. * Add command example and warning related to fusion options.
Description: Describe your changes.
Motivation and Context