-
Notifications
You must be signed in to change notification settings - Fork 1.1k
benchdnn: graph: support non-contiguous tensor validation for matmul and strides rewriting #3448
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
Conversation
b47507b
to
1c9e405
Compare
tests/benchdnn/doc/driver_graph.md
Outdated
stride of a graph input tensor that includes `ID` in a graph with `SHAPE` and | ||
`TAG` values. `SHAPE` and `TAG` are separated by a `*`. Multiple | ||
inputs may be specified using the `+` delimiter. | ||
- `--in-shapes=ID:SHAPE[*STRIDE/TAG+ID:SHAPE*STRIDE/TAG+...]` -- Override a |
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.
- `--in-shapes=ID:SHAPE[*STRIDE/TAG+ID:SHAPE*STRIDE/TAG+...]` -- Override a | |
- `--in-shapes=ID:SHAPE[*STRIDES][+ID:SHAPE*STRIDES+...]` -- Override a |
STRIDE/TAG
might be considered as a syntax. Suggest to use STRIDES
uniformly and carefully explain in the doc that STRIDES
can be represented as a tag abcd
which implies one, two, three, and used as a convenience shortcut to the alternative, full specification method via tensor with a similar look to shapes which implies one, two, three.
Additionally, a note that an asterisk *
is mandatory to allow modification of full specified strides without shape modification.
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.
Thanks for the suggestion. The document is updated.
@@ -902,8 +902,10 @@ void flex_rewrite_t::infer_output_shape( | |||
|
|||
for (auto < : aop.in_lts_) { | |||
lt.shape_ = gi[lt.id_]; | |||
lt.stride_ | |||
= memory_tag2strides(gi[lt.id_], dgraph.lt_2_mtag_[lt.id_]); | |||
if (dgraph.lt_2_mtag_[lt.id_] != "not_available") { |
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.
What happens when it is "not_available"?
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.
The logic is completed now:
- for graph input ports, no action is needed as the shape and strides have been filled during the input ports handling
- for the intermediate results, they will use dense format or tags inherited from the inputs, so we should not meet
not_available
tags,
d3aaa45
to
5c021dc
Compare
make test |
5c021dc
to
71e9ec0
Compare
71e9ec0
to
6264e1d
Compare
make test |
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.
Some edits suggested, please incorporate as you see fit! Thanks
6264e1d
to
08c1dfb
Compare
Thanks a lot! Your suggestions have been incorporated. Please take another look. |
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.
The .md file looks good, thanks!
General
Resolve MFDNN-10785, to support non-contiguous memory validation for packed QKV.
--in-shapes
knob--in-shapes=0:abcd
to--in-shapes=0:*abcd