Update exir_deserialize logic
Summary: For model hand_tracking_dpe_v26 we have this metadata string that is being deserialized.
"L__self__,,on_device_ai.helios.compiler_tests.e2e_test_gen.configs.hand_track ing_dpe_v26.hand_tracking_dpe_v26.Test_dpe_v26_dpefeedforward_only_por_qconfig _executorch;140317725696144,mods,nimble.ml_libs.problems.mview.models.dpe_infe rence_v2.DPEFeedForward;140317579086400,getattr(getattr(L['self'].mods.image encoder._image_backbone._layers, '0'), '3'),torch.nn.modules.pooling.MaxPool2d"
This string has multiple entries separated by ";" with format "key,path,type_str"
For 140317579086400,getattr(getattr(L['self'].mods._image_encoder._image_backbone._layers, '0'),'3'),torch.nn.modules.pooling.MaxPool2d
Should be split into 3 parts:
- key: 140317579086400
- path: getattr(getattr(L['self'].mods._image_encoder._image_backbone._layers,'0'), '3')
- type: torch.nn.modules.pooling.MaxPool2d
The original code removes parenthases and content in it and then splits on commas Result: "getattrgetattr, '0', '3',torch.nn.modules.pooling.MaxPool2d"
This issue pops up when we have nested getattr() within layers such as this: self._layers = nn.Sequential( Conv2d(...), ReLU(), Conv2d(...), MaxPool2d(...), )
Differential Revision: D87112636
:link: Helpful Links
:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15840
- :page_facing_up: Preview Python docs built from this PR
Note: Links to docs will display an error until the docs builds have been completed.
:white_check_mark: No Failures
As of commit f1003ce4873cd89a847ecad3cf1bf1b724ef54d7 with merge base 3826f44a843a5cb425973cf3acbc59d5ec294998 ():
:green_heart: Looks good so far! There are no failures yet. :green_heart:
This comment was automatically generated by Dr. CI and updates every 15 minutes.
@ethansfng has exported this pull request. If you are a Meta employee, you can view the originating Diff in D87112636.
This PR needs a release notes: label
If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.
To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"
For more information, see https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.
@ethansfng Please see the copilot recommendations, they look pretty good