Changed all code and comments that used the phrase "sparse compiler" to instead use "sparsifier" (#71875)

The changes in this p.r. mostly center around the tests that use the
flag sparse_compiler (also: sparse-compiler).
This commit is contained in:
Tim Harvey
2023-11-15 20:12:35 +00:00
committed by GitHub
parent 0901f918da
commit dce7a7cf69
112 changed files with 595 additions and 590 deletions

View File

@@ -16,7 +16,7 @@ from mlir.dialects.linalg.opdsl import lang as dsl
_SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
sys.path.append(_SCRIPT_PATH)
from tools import sparse_compiler
from tools import sparsifier
@dsl.linalg_structured_op
@@ -159,7 +159,7 @@ def main():
level, ordering, ordering, pwidth, iwidth
)
opt = f"parallelization-strategy=none"
compiler = sparse_compiler.SparseCompiler(
compiler = sparsifier.Sparsifier(
options=opt, opt_level=0, shared_libs=[support_lib]
)
build_compile_and_run_SDDMMM(attr, compiler)

View File

@@ -16,7 +16,7 @@ from mlir.dialects.linalg.opdsl import lang as dsl
_SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
sys.path.append(_SCRIPT_PATH)
from tools import sparse_compiler
from tools import sparsifier
@dsl.linalg_structured_op
@@ -137,7 +137,7 @@ def main():
ir.AffineMap.get_permutation([1, 0]),
]
bitwidths = [0]
compiler = sparse_compiler.SparseCompiler(
compiler = sparsifier.Sparsifier(
options=opt, opt_level=0, shared_libs=[support_lib]
)
for level in levels:

View File

@@ -13,7 +13,7 @@ from mlir.dialects import sparse_tensor as st
_SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
sys.path.append(_SCRIPT_PATH)
from tools import sparse_compiler
from tools import sparsifier
def boilerplate(attr: st.EncodingAttr):
@@ -135,7 +135,7 @@ def main():
(ir.AffineMap.get_permutation([1, 0]), 1),
]
bitwidths = [8, 64]
compiler = sparse_compiler.SparseCompiler(
compiler = sparsifier.Sparsifier(
options="", opt_level=2, shared_libs=[support_lib]
)
for level in levels:

View File

@@ -21,7 +21,7 @@ from mlir.dialects import sparse_tensor as st
_SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
sys.path.append(_SCRIPT_PATH)
from tools import sparse_compiler
from tools import sparsifier
# ===----------------------------------------------------------------------=== #
@@ -193,7 +193,7 @@ def main():
print("\nTEST: test_stress")
with ir.Context() as ctx, ir.Location.unknown():
sparsification_options = f"parallelization-strategy=none "
compiler = sparse_compiler.SparseCompiler(
compiler = sparsifier.Sparsifier(
options=sparsification_options, opt_level=0, shared_libs=[support_lib]
)
f64 = ir.F64Type.get()

View File

@@ -2,7 +2,7 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# This file contains the SparseCompiler class.
# This file contains the Sparsifier class.
from mlir import execution_engine
from mlir import ir
@@ -10,11 +10,11 @@ from mlir import passmanager
from typing import Sequence
class SparseCompiler:
"""Sparse compiler class for compiling and building MLIR modules."""
class Sparsifier:
"""sparsifier class for compiling and building MLIR modules."""
def __init__(self, options: str, opt_level: int, shared_libs: Sequence[str]):
pipeline = f"builtin.module(sparse-compiler{{{options} reassociate-fp-reductions=1 enable-index-optimizations=1}})"
pipeline = f"builtin.module(sparsifier{{{options} reassociate-fp-reductions=1 enable-index-optimizations=1}})"
self.pipeline = pipeline
self.opt_level = opt_level
self.shared_libs = shared_libs