MLIR 22.0.0git
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.
ConvertVectorToLLVMPassOptions convertVectorToLLVMOptions () const
 Projects out the options for createConvertVectorToLLVMPass.

Public Attributes

PassOptions::Option< mlir::SparseParallelizationStrategyparallelization
PassOptions::Option< mlir::SparseEmitStrategyemitStrategy
PassOptions::Option< boolenableRuntimeLibrary
PassOptions::Option< booltestBufferizationAnalysisOnly
PassOptions::Option< boolenableBufferInitialization
PassOptions::Option< boolcreateSparseDeallocs
PassOptions::Option< int32_t > vectorLength
PassOptions::Option< boolreassociateFPReductions
PassOptions::Option< boolforce32BitVectorIndices
PassOptions::Option< boolamx
PassOptions::Option< boolarmNeon
PassOptions::Option< boolarmSVE
PassOptions::Option< boolx86Vector
PassOptions::Option< std::string > gpuTriple
 These options are used to enable GPU code generation.
PassOptions::Option< std::string > gpuChip
PassOptions::Option< std::string > gpuFeatures
PassOptions::Option< std::string > gpuFormat
 For NVIDIA GPUs there are 3 compilation format options:
PassOptions::Option< boolenableGPULibgen
 This option is used to enable GPU library generation.

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

◆ convertVectorToLLVMOptions()

◆ sparsificationOptions()

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

Projects out the options for createSparsificationPass.

Definition at line 159 of file Passes.h.

References emitStrategy, enableRuntimeLibrary, and parallelization.

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 107 of file Passes.h.

Referenced by convertVectorToLLVMOptions().

◆ 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 111 of file Passes.h.

Referenced by convertVectorToLLVMOptions().

◆ 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 116 of file Passes.h.

Referenced by convertVectorToLLVMOptions().

◆ 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 84 of file Passes.h.

◆ emitStrategy

PassOptions::Option<mlir::SparseEmitStrategy> mlir::sparse_tensor::SparsifierOptions::emitStrategy
Initial value:
{
*this, "sparse-emit-strategy",
::llvm::cl::desc(
"Emit functional code or interfaces (to debug) for sparse loops"),
llvm::cl::values(
clEnumValN(mlir::SparseEmitStrategy::kFunctional, "functional",
"Emit functional code (with scf.for/while)."),
"sparse-iterator",
"Emit (experimental) loops (with sparse.iterate)."),
clEnumValN(
"Emit non-functional but easy-to-read interfaces to debug."))}

Definition at line 54 of file Passes.h.

Referenced by sparsificationOptions().

◆ 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 78 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 153 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 69 of file Passes.h.

Referenced by sparsificationOptions().

◆ 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 102 of file Passes.h.

Referenced by convertVectorToLLVMOptions().

◆ gpuChip

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

Definition at line 130 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 132 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 149 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 128 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.

Referenced by sparsificationOptions().

◆ 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 98 of file Passes.h.

Referenced by convertVectorToLLVMOptions().

◆ 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 74 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 92 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 121 of file Passes.h.

Referenced by convertVectorToLLVMOptions().


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