-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow unsafe probe_id values to be serialized properly to disk (#1840)
This PR builds off of the recently submitted changes in #1784. Prior to this change, the value of `probe_id` and an internal execution counter is used to derive the filename for serializing probed tensor values (i.e. `<probe_output_dir>/<probe_id>_<execution_count>.npy`). This current design has the following disadvantage: 1. This can be unsafe as no filename sanitation is performed, relying on the compiler (or other tooling) to produce friendly `probe_id` values. Instead of having this implicit assumption on the instrumented StableHLO program, this change uses internally generated serialization filenames by using a strictly increasing counter. This change proposes that the serialization filename now be derived as follows: ``` <probe_output_dir>/probe<i>.npy ``` Where `i` is a uniquely increasing positive `int64_t`.
- Loading branch information
Showing
4 changed files
with
22 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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