-
Notifications
You must be signed in to change notification settings - Fork 63
Add Op(aten::_scaled_dot_product_efficient_attention) | feat(torchlib) #1197
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
Changes from all commits
5acfa31
d8eb6b5
b4c0817
05c5b0f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2018,15 +2018,33 @@ def _where_input_wrangler( | |
), | ||
TorchLibOpInfo( | ||
"ops.aten._scaled_dot_product_flash_attention", | ||
nn_ops.aten_scaled_dot_product_flash_attention, | ||
nn_ops.aten__scaled_dot_product_flash_attention, | ||
trace_only=True, | ||
tolerance={torch.float32: (3e-4, 1.5e-5)}, | ||
# Output[0] is OK, but other outputs just have the same shape with zero values | ||
nondeterministic=True, | ||
compare_shape_only_for_output=(1, 2, 3, 4, 5, 6, 7, 8), | ||
).skip( | ||
enabled_if=version_utils.torch_older_than("2.1"), | ||
reason="The operator is not supported in older version.", | ||
), | ||
TorchLibOpInfo( | ||
"ops.aten._scaled_dot_product_efficient_attention", | ||
nn_ops.aten__scaled_dot_product_efficient_attention, | ||
trace_only=True, | ||
tolerance={torch.float32: (3e-4, 1.5e-5)}, | ||
# Output[0] is OK, but other outputs just have the same shape with zero values | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the other compare option instead There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. compare_shape_only_for_output There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
nondeterministic=True, | ||
compare_shape_only_for_output=(1, 2, 3), | ||
) | ||
.skip( | ||
enabled_if=version_utils.torch_older_than("2.1"), | ||
reason="The operator is not supported in older version.", | ||
) | ||
.skip( | ||
enabled_if=not torch.cuda.is_available(), | ||
reason="_scaled_dot_product_efficient_attention only supports CUDA", | ||
), | ||
TorchLibOpInfo( | ||
"nn.functional.scaled_dot_product_attention_bool_mask", | ||
nn_ops.aten_scaled_dot_product_attention_bool_mask, | ||
|
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 may also control device here
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.
I enabled the whole CUDA tests if it's needed by the test.