Skip to content
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

Add impl_abstract to segment_sum_csr #2132

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions fbgemm_gpu/fbgemm_gpu/sparse_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,12 @@ def permute_sparse_features_abstract(
# expected `Sequence[Union[int, types.SymInt]]` but got `Union[int, torch.SymInt]`
permuted_weights = weights.new_empty(output_size)
return (permuted_lengths, permuted_indices, permuted_weights)


@torch.library.impl_abstract("fbgemm::segment_sum_csr")
def segment_sum_csr_abstract(
batch_size: int, csr_seg: Tensor, values: Tensor
) -> Tensor:
output_size = csr_seg.numel() - 1
output = values.new_empty(output_size)
return output
4 changes: 2 additions & 2 deletions fbgemm_gpu/test/failures_dict.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,11 @@
"fbgemm::segment_sum_csr": {
"SparseOpsTest.test_aot_dispatch_dynamic__test_segment_sum_csr": {
"comment": "",
"status": "xfail"
"status": "xsuccess"
},
"SparseOpsTest.test_faketensor__test_segment_sum_csr": {
"comment": "",
"status": "xfail"
"status": "xsuccess"
}
},
"fbgemm::stacked_jagged_1d_to_dense": {
Expand Down