This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Use the runtime DimLevelType instead of a separate tablegen enum
ClosedPublic

Authored by wrengr on Oct 14 2022, 4:43 PM.

Details

Summary

This differential replaces all uses of SparseTensorEncodingAttr::DimLevelType with DimLevelType. The next differential will break out a separate library for the DimLevelType enum, so that the Dialect code doesn't need to depend on the rest of the runtime

Depends On D135995

Diff Detail

Event Timeline

wrengr created this revision.Oct 14 2022, 4:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2022, 4:43 PM
wrengr requested review of this revision.Oct 14 2022, 4:43 PM
wrengr updated this revision to Diff 467980.Oct 14 2022, 5:39 PM

git-clang-format

aartbik accepted this revision.Oct 17 2022, 6:00 PM

This is a pretty sweet cleanup of unnecessary codedup, Wren. Thanks!

This revision is now accepted and ready to land.Oct 17 2022, 6:00 PM

Hi @wrengr ,

Posting it here in case you didn't see the notification on the commit itself:

I have a bunch of compiler errors because of that change.
Could you fix or revert, please?

E.g.,

In file included from mlir/include/mlir/InitAllDialects.h:58,                  
                 from mlir/unittests/ExecutionEngine/Invoke.cpp:23:            
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h: In function ‘constexpr bool mlir::sparse_tensor::isDenseDim(mlir::RankedTensorType, uint64_t)’:                                                                      
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h:53:36: error: call to non-‘constexpr’ function ‘mlir::sparse_tensor::DimLevelType mlir::sparse_tensor::getDimLevelType(mlir::RankedTensorType, uint64_t)’             
   53 |   return isDenseDLT(getDimLevelType(type, d));                                                                                          
      |                     ~~~~~~~~~~~~~~~^~~~~~~~~                                                                                            
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h:44:21: note: ‘mlir::sparse_tensor::DimLevelType mlir::sparse_tensor::getDimLevelType(mlir::RankedTensorType, uint64_t)’ declared here                                 
   44 | inline DimLevelType getDimLevelType(RankedTensorType type, uint64_t d) {                                                                
      |                     ^~~~~~~~~~~~~~~

Hi @qcolombet,

sorry for the breakage. That should be fixed by D136123 (which also landed today). For some reason our buildbot didn't catch those warnings on this differential but did so on D136123. Can you roll things forward to where D136123 landed, or do you still need a fix?