-
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.
Serialize MLIR type when instrumenting reference interpreter values (#…
…1828) Recently, we introduced a way to extract intermediate tensor state from the StableHLO reference interpreter (#1784) for instrumentation/debugging purposes. As part of this instrumentation process, the interpreter will create an `index.csv` metadata file which contains all serialized tensor paths and uniquely identifying `probe_id` values in the form of: ``` probe_id,/some/absolute/path/to/numpy_0.npy ... ``` In the event that an `interpreter.probe` instruction is executed more than once (i.e. due to being within a loop), there could be `N` entries with the same `probe_id` value. This current schema however does not serialize the `mlir::TensorType` of the data. The inclusion of this type information can make it easier for post processing tools/scripts to better interpret the metadata file, without needing to load the accompanying `npy` file into memory to extract size/type information. With these changes, the serialized metadata file format now becomes: ``` probe_id,tensor<T>,/some/absolute/path/to/numpy_0.npy ... ``` Where `tensor<T>` is the type string produced by `mlir::debugString` (i.e. `tensor<1x2xf32>`, etc). Additionally, the `expect_serialized_eq` check dialect operation can now perform a stricter check, by also locking down the serialized type vs the expected type.
- Loading branch information
Showing
4 changed files
with
54 additions
and
25 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