MLIR  19.0.0git
Public Member Functions | Public Attributes | List of all members
mlir::sparse_tensor::SparsifierOptions Struct Reference

Options for the "sparsifier" pipeline. More...

#include "mlir/Dialect/SparseTensor/Pipelines/Passes.h"

+ Inheritance diagram for mlir::sparse_tensor::SparsifierOptions:

Public Member Functions

SparsificationOptions sparsificationOptions () const
 Projects out the options for createSparsificationPass. More...
 
ConvertVectorToLLVMPassOptions lowerVectorToLLVMOptions () const
 Projects out the options for createConvertVectorToLLVMPass. More...
 
- Public Member Functions inherited from mlir::detail::PassOptions
 PassOptions ()=default
 
 PassOptions (const PassOptions &)=delete
 Delete the copy constructor to avoid copying the internal options map. More...
 
 PassOptions (PassOptions &&)=delete
 
void copyOptionValuesFrom (const PassOptions &other)
 Copy the option values from 'other' into 'this', where 'other' has the same options as 'this'. More...
 
LogicalResult parseFromString (StringRef options, raw_ostream &errorStream=llvm::errs())
 Parse options out as key=value pairs that can then be handed off to the llvm::cl command line passing infrastructure. More...
 
void print (raw_ostream &os)
 Print the options held by this struct in a form that can be parsed via 'parseFromString'. More...
 
void printHelp (size_t indent, size_t descIndent) const
 Print the help string for the options held by this struct. More...
 
size_t getOptionWidth () const
 Return the maximum width required when printing the help string. More...
 

Public Attributes

PassOptions::Option< mlir::SparseParallelizationStrategyparallelization
 
PassOptions::Option< bool > enableRuntimeLibrary
 
PassOptions::Option< bool > testBufferizationAnalysisOnly
 
PassOptions::Option< bool > enableBufferInitialization
 
PassOptions::Option< bool > createSparseDeallocs
 
PassOptions::Option< int32_t > vectorLength
 
PassOptions::Option< bool > reassociateFPReductions
 
PassOptions::Option< bool > force32BitVectorIndices
 
PassOptions::Option< bool > amx
 
PassOptions::Option< bool > armNeon
 
PassOptions::Option< bool > armSVE
 
PassOptions::Option< bool > x86Vector
 
PassOptions::Option< std::string > gpuTriple
 These options are used to enable GPU code generation. More...
 
PassOptions::Option< std::string > gpuChip
 
PassOptions::Option< std::string > gpuFeatures
 
PassOptions::Option< std::string > gpuFormat
 For NVIDIA GPUs there are 3 compilation format options: More...
 
PassOptions::Option< bool > enableGPULibgen
 This option is used to enable GPU library generation. More...
 

Additional Inherited Members

- Public Types inherited from mlir::detail::PassOptions
template<typename DataType >
using OptionParser = std::conditional_t< std::is_base_of< llvm::cl::generic_parser_base, llvm::cl::parser< DataType > >::value, GenericOptionParser< DataType >, llvm::cl::parser< DataType > >
 The specific parser to use depending on llvm::cl parser used. More...
 
- Static Public Member Functions inherited from mlir::PassPipelineOptions< SparsifierOptions >
static std::unique_ptr< SparsifierOptions > createFromString (StringRef options)
 Factory that parses the provided options and returns a unique_ptr to the struct. More...
 

Detailed Description

Options for the "sparsifier" pipeline.

So far this only contains a subset of the options that can be set for the underlying passes, because it must be manually kept in sync with the tablegen files for those passes.

Definition at line 30 of file Passes.h.

Member Function Documentation

◆ lowerVectorToLLVMOptions()

ConvertVectorToLLVMPassOptions mlir::sparse_tensor::SparsifierOptions::lowerVectorToLLVMOptions ( ) const
inline

Projects out the options for createConvertVectorToLLVMPass.

Definition at line 150 of file Passes.h.

◆ sparsificationOptions()

SparsificationOptions mlir::sparse_tensor::SparsifierOptions::sparsificationOptions ( ) const
inline

Projects out the options for createSparsificationPass.

Definition at line 145 of file Passes.h.

Member Data Documentation

◆ amx

PassOptions::Option<bool> mlir::sparse_tensor::SparsifierOptions::amx
Initial value:
{
*this, "enable-amx",
desc("Enables the use of AMX dialect while lowering the vector dialect"),
init(false)}

Definition at line 93 of file Passes.h.

◆ armNeon

PassOptions::Option<bool> mlir::sparse_tensor::SparsifierOptions::armNeon
Initial value:
{
*this, "enable-arm-neon",
desc("Enables the use of ArmNeon dialect while lowering the vector "
"dialect"),
init(false)}

Definition at line 97 of file Passes.h.

◆ armSVE

PassOptions::Option<bool> mlir::sparse_tensor::SparsifierOptions::armSVE
Initial value:
{
*this, "enable-arm-sve",
desc("Enables the use of ArmSVE dialect while lowering the vector "
"dialect"),
init(false)}

Definition at line 102 of file Passes.h.

◆ createSparseDeallocs

PassOptions::Option<bool> mlir::sparse_tensor::SparsifierOptions::createSparseDeallocs
Initial value:
{
*this, "create-sparse-deallocs",
desc("Specify if the temporary buffers created by the sparse "
"compiler should be deallocated. For compatibility with core "
"bufferization passes. "
"This option is only used when enable-runtime-library=false."),
init(true)}

Definition at line 70 of file Passes.h.

◆ enableBufferInitialization

PassOptions::Option<bool> mlir::sparse_tensor::SparsifierOptions::enableBufferInitialization
Initial value:
{
*this, "enable-buffer-initialization",
desc("Enable zero-initialization of memory buffers"), init(false)}

Definition at line 64 of file Passes.h.

◆ enableGPULibgen

PassOptions::Option<bool> mlir::sparse_tensor::SparsifierOptions::enableGPULibgen
Initial value:
{
*this, "enable-gpu-libgen",
desc("Enables GPU acceleration by means of direct library calls (like "
"cuSPARSE)")}

This option is used to enable GPU library generation.

Definition at line 139 of file Passes.h.

◆ enableRuntimeLibrary

PassOptions::Option<bool> mlir::sparse_tensor::SparsifierOptions::enableRuntimeLibrary
Initial value:
{
*this, "enable-runtime-library",
desc("Enable runtime library for manipulating sparse tensors"),
init(true)}

Definition at line 55 of file Passes.h.

◆ force32BitVectorIndices

PassOptions::Option<bool> mlir::sparse_tensor::SparsifierOptions::force32BitVectorIndices
Initial value:
{
*this, "enable-index-optimizations",
desc("Allows compiler to assume indices fit in 32-bit if that yields "
"faster code"),
init(true)}

Definition at line 88 of file Passes.h.

◆ gpuChip

PassOptions::Option<std::string> mlir::sparse_tensor::SparsifierOptions::gpuChip
Initial value:
{*this, "gpu-chip",
desc("GPU target architecture")}

Definition at line 116 of file Passes.h.

◆ gpuFeatures

PassOptions::Option<std::string> mlir::sparse_tensor::SparsifierOptions::gpuFeatures
Initial value:
{*this, "gpu-features",
desc("GPU target features")}

Definition at line 118 of file Passes.h.

◆ gpuFormat

PassOptions::Option<std::string> mlir::sparse_tensor::SparsifierOptions::gpuFormat
Initial value:
{
*this, "gpu-format", desc("GPU compilation format"), init("fatbin")}

For NVIDIA GPUs there are 3 compilation format options:

  1. isa: the compiler generates PTX and the driver JITs the PTX.
  2. bin: generates a CUBIN object for chip=gpuChip.
  3. fatbin: generates a fat binary with a CUBIN object for gpuChip and also embeds the PTX in the fat binary. Notes: Option 1 adds a significant runtime performance hit, however, tests are more likely to pass with this option. Option 2 is better for execution time as there is no JIT; however, the program will fail if there's an architecture mismatch between gpuChip and the GPU running the program. Option 3 is the best compromise between options 1 and 2 as it can JIT in case of an architecture mismatch between gpuChip and the running architecture. However, it's only possible to JIT to a higher CC than gpuChip.

Definition at line 135 of file Passes.h.

◆ gpuTriple

PassOptions::Option<std::string> mlir::sparse_tensor::SparsifierOptions::gpuTriple
Initial value:
{*this, "gpu-triple",
desc("GPU target triple")}

These options are used to enable GPU code generation.

Definition at line 114 of file Passes.h.

◆ parallelization

PassOptions::Option<mlir::SparseParallelizationStrategy> mlir::sparse_tensor::SparsifierOptions::parallelization
Initial value:
{
*this, "parallelization-strategy",
::llvm::cl::desc("Set the parallelization strategy"),
llvm::cl::values(
"Turn off sparse parallelization."),
"dense-outer-loop",
"Enable dense outer loop sparse parallelization."),
"any-storage-outer-loop",
"Enable sparse parallelization regardless of storage for "
"the outer loop."),
"dense-any-loop",
"Enable dense parallelization for any loop."),
clEnumValN(
"any-storage-any-loop",
"Enable sparse parallelization for any storage and loop."))}

Definition at line 33 of file Passes.h.

◆ reassociateFPReductions

PassOptions::Option<bool> mlir::sparse_tensor::SparsifierOptions::reassociateFPReductions
Initial value:
{
*this, "reassociate-fp-reductions",
desc("Allows llvm to reassociate floating-point reductions for speed"),
init(false)}

Definition at line 84 of file Passes.h.

◆ testBufferizationAnalysisOnly

PassOptions::Option<bool> mlir::sparse_tensor::SparsifierOptions::testBufferizationAnalysisOnly
Initial value:
{
*this, "test-bufferization-analysis-only",
desc("Run only the inplacability analysis"), init(false)}

Definition at line 60 of file Passes.h.

◆ vectorLength

PassOptions::Option<int32_t> mlir::sparse_tensor::SparsifierOptions::vectorLength
Initial value:
{
*this, "vl", desc("Set the vector length (0 disables vectorization)"),
init(0)}

Definition at line 78 of file Passes.h.

◆ x86Vector

PassOptions::Option<bool> mlir::sparse_tensor::SparsifierOptions::x86Vector
Initial value:
{
*this, "enable-x86vector",
desc("Enables the use of X86Vector dialect while lowering the vector "
"dialect"),
init(false)}

Definition at line 107 of file Passes.h.


The documentation for this struct was generated from the following file: