Skip to content

Commit

Permalink
refactor to_sparse_semi_structure
Browse files Browse the repository at this point in the history
  • Loading branch information
petrex committed Oct 3, 2024
1 parent b90a8d3 commit 36f5443
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aten/src/ATen/native/sparse/cuda/SparseSemiStructuredOps.cu
Original file line number Diff line number Diff line change
Expand Up @@ -908,14 +908,14 @@ static void reorder_meta(cutlass::TensorRef<Element, LayoutDest> dest,

std::tuple<Tensor, Tensor>
_to_sparse_semi_structured(const Tensor& dense) {
TORCH_CHECK(dense.dim() == 2,
__func__, " : Expected dense argument to be 2D tensor, got ",
dense.dim(), " dims");
#if defined(_MSC_VER) || (defined(CUDA_VERSION) && CUDA_VERSION < 11080)
AT_ERROR(__func__, " : CUTLASS not supported");
return std::make_tuple(Tensor{}, Tensor{});
#elif defined(USE_ROCM)
// Check dimensions of the dense matrix.
TORCH_CHECK(dense.dim() == 2,
__func__, " : Expected dense argument to be 2D tensor, got ",
dense.dim(), " dims");

// Generate sparse tensor using cuSPARSELt compression
auto sparse = torch._cslt_compress(dense);
Expand Down

0 comments on commit 36f5443

Please sign in to comment.