-
Notifications
You must be signed in to change notification settings - Fork 116
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
Bytecode implementation for StableHLO #60
Conversation
Adding Mehdi as a reviewer. I think my biggest area of concern is the datatypes chosen to represent data. Just about everything is represented as a Additionally, note the test cases run in |
The (s)varint are the right choice right now for anything stored as integers (up to 64 bits). |
Added round-trip testing for all StableHLO ops in `bytecode.mlir`, and documentation in `bytecode.md`.
outputBatchDimension: svarint | ||
outputFeatureDimension: svarint | ||
outputSpatialDimensions: svarint[] | ||
} |
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.
Hmm I don't think that you pushed this update?
@@ -0,0 +1,695 @@ | |||
/* Copyright 2022 The StableHLO Authors. | |||
StablehloBytecode.cpp - StableHLO Bytecode Implementation */ |
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.
Let's use the usual license blurb here?
|
||
/// This enum contains marker codes used to indicate which attribute is | ||
/// currently being decoded, and how it should be decoded. The order of these | ||
/// codes should generally be unchanged, as any changes will inevitably break |
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.
Do you anticipate situations where the order should be changed? (I guess, this is an eventuality that "generally" is preparing the reader for).
docs/bytecode.md
Outdated
the `strings` command can be used to see what attributes were missed: | ||
|
||
_Note: The following trace is from a previous revision where the `scatter` attribute | ||
was not implemented. Currently all types/attrs are implemented and log only shows |
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.
How about we remove this sentence and its accompanying output in the printout below? "The following trace is from a previous revision where the scatter
attribute was not implemented". Even without stablehlo.scatter
, the output is educational enough?
This PR plays a role in #34. There is still a little more work to do before closing this issue, as documented in
bytecode.md
of this PR.bytecode.mlir
:stablehlo-opt
andstablehlo-opt -emit-bytecode file.mlir | stablehlo-opt
produce the same results.stablehlo-bytecode
debug trace to ensure that all attrs/types have bytecoding implemented.bytecode.md
.