-
Notifications
You must be signed in to change notification settings - Fork 350
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
fix: add an arg in matmul #2279
Conversation
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.
Looks good - could you also add two arguments to matrix_multiply
, which both default to trt.MatrixOperation.NONE
, which allow us to control whether the matrix being multiplied gets transposed as well, so we can reduce operations required overall? They would control the variables input_matrix_op
and other_matrix_op
Done! Thanks for the suggestion! |
args_bounds_check(args, 2, trt.MatrixOperation.NONE), | ||
args_bounds_check(args, 3, trt.MatrixOperation.NONE), |
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.
You can remove these lines, since none of the converted Torch ops will have a third or fourth argument, based on their schemas.
The primary reason for adding those arguments to matrix_multiply
below is that later, for aten.linear
, you can pass in other_matrix_op=trt.MatrixOperation.TRANSPOSE
for instance, and then reduce the number of layers (no need for a permute)
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.
It makes sense! I've updated this PR and aten.linear
in #2253.
fix bug add args input_matrix_op and other_matrix_op, support aten.mv.default minor fix
8dfb58e
to
b0d4c94
Compare
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.
Looks good to me, pending CI!
@zewenli98 - could you re-enable these tests for this PR, since it adds a converter for TensorRT/tests/py/dynamo/conversion/test_matmul_aten.py Lines 14 to 15 in e49ef6d
As well as here: TensorRT/tests/py/dynamo/conversion/test_matmul_aten.py Lines 44 to 45 in e49ef6d
You may need to add a new test class which looks for torch.aten.ops.mv.default .
|
Done! lmk if more changes are needed! Thanks! |
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.
Looks good to me!
Description
set_layer_name(layer, target, name)
->set_layer_name(layer, target, name, source_ir)
Fixes #2203
Type of change
Checklist: