-
Notifications
You must be signed in to change notification settings - Fork 364
Closed the perf gap of resnet and enabled refit #3629
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
base: main
Are you sure you want to change the base?
Conversation
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.
minor comment. LGTM
@@ -90,7 +91,18 @@ def construct_refit_mapping_from_weight_name_map( | |||
) -> dict[Any, Any]: | |||
engine_weight_map = {} | |||
for engine_weight_name, (sd_weight_name, np_weight_type) in weight_name_map.items(): | |||
if sd_weight_name not in state_dict: | |||
if engine_weight_name.split(" ")[-1] in ["SCALE", "SHIFT"]: |
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.
We should abstract this imo. Like if there are any weight types that require constant folding in converter this should be associated with the converter. Then the refit system will just iterate through all these constant fold operations. Ideally the converter can use the same implementation
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.
Currently BN is the only one. Do you think we should have a constant_fold function and have refit
and conversion
call that function?
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: