Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23692
Note: Links to docs will display an error until the docs builds have been completed.
|
Contributor
Author
|
@pytorchbot label "release notes: devtools" |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
If you pass an ETRecord object to the Inspector (
Inspector(etdump_path=..., etrecord=program_manager.get_etrecord())) instead of a path, debug handle resolution quietly finds nothing. The ETRecord object keys_debug_handle_map,_delegate_mapand_instruction_id_to_num_outs_mapby int instruction id, but once an ETRecord goes through save() / parse_etrecord() (JSON) the keys are strs, and_gen_resolve_debug_handleslooks them up as strs. So with the object every event ends up withdebug_handles=Noneand no op_types, and things likecalculate_numeric_gapjust return an empty DataFrame. No error or warning.The fix converts those keys to str once in
_consume_etrecord, before handing the maps to the event blocks. It builds new dicts, so the caller's ETRecord isn't modified, and the file path case behaves the same as before.Test plan
Added test_inspector_with_etrecord_object_resolves_debug_handles to devtools/inspector/tests/inspector_test.py. It builds one Inspector from the ETRecord object and one from the same ETRecord saved to a file, and checks they resolve the same debug handles and op types. It fails on main (the object version gets None) and passes with the fix, and the rest of devtools/inspector/tests passes. ufmt and flake8 are clean with the versions from requirements-lintrunner.txt.
cc @nil-is-all