-
Notifications
You must be signed in to change notification settings - Fork 668
Fix regnet on XNNPACK #14396
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?
Fix regnet on XNNPACK #14396
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/14396
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 3 Cancelled JobsAs of commit 5798adb with merge base cb42db2 ( CANCELLED JOBS - The following jobs were cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
INVALID_CHARS = [".", "-"] | ||
|
||
sanitized = name | ||
for c in INVALID_CHARS: | ||
sanitized = sanitized.replace(c, "_") | ||
return sanitized |
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.
This is more performant
return name.translate(str.maketrans('.-', '__'))
Can you put the error log? I am trying to figure out what's the exact issue.. |
) | ||
else: | ||
fused_bias_name = (input_node_bias_name + "_fused_bn").replace(".", "_") | ||
fused_bias_name = sanitize_node_name(input_node_bias_name + "_fused_bn") |
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.
Seems like we are sensitive to names, we should put assert somewhere downstream where we check not INVALID_CHARS sneaks in..
Summary
The regnet_y_32gf model from torchvision does not lower on XNNPACK. This is because a "-" in a generated weight name (from conv + bn fusion) causes things to blow up. I've updated the fusion logic to properly sanitize the generated weight name and added a test for regnet to validate the fix.
Here's the part of the eager mode model responsible for this:
cc @digantdesai @mcr229 @cbilgin