[Mlir-commits] [mlir] [mlir][sparse] extend sparse output test (PR #69986)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Oct 23 17:01:18 PDT 2023
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r e45356910f826194003e9bd62a2406971b2fe3f3..ffdb701205064209640b47b5f55525f3da16160c mlir/test/Integration/Dialect/SparseTensor/python/test_SDDMM.py mlir/test/Integration/Dialect/SparseTensor/python/test_SpMM.py mlir/test/Integration/Dialect/SparseTensor/python/test_output.py mlir/test/Integration/Dialect/SparseTensor/python/test_stress.py
``````````
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- test_output.py 2023-10-23 23:55:34.000000 +0000
+++ test_output.py 2023-10-24 00:01:11.973205 +0000
@@ -92,23 +92,36 @@
options="", opt_level=2, shared_libs=[support_lib]
)
for level in levels:
for ordering in orderings:
for bwidth in bitwidths:
- attr = st.EncodingAttr.get(level, ordering, ordering, bwidth, bwidth)
+ attr = st.EncodingAttr.get(
+ level, ordering, ordering, bwidth, bwidth
+ )
build_compile_and_run_output(attr, compiler, expected())
count = count + 1
# Now do the same for BSR.
- level = [st.DimLevelType.dense, st.DimLevelType.compressed, st.DimLevelType.dense, st.DimLevelType.dense]
+ level = [
+ st.DimLevelType.dense,
+ st.DimLevelType.compressed,
+ st.DimLevelType.dense,
+ st.DimLevelType.dense,
+ ]
d0 = ir.AffineDimExpr.get(0)
d1 = ir.AffineDimExpr.get(1)
c2 = ir.AffineConstantExpr.get(2)
- dim2lvl = ir.AffineMap.get(2, 0, [ir.AffineExpr.get_floor_div(d0, c2),
- ir.AffineExpr.get_floor_div(d1, c2),
- ir.AffineExpr.get_mod(d0, c2),
- ir.AffineExpr.get_mod(d1, c2)])
+ dim2lvl = ir.AffineMap.get(
+ 2,
+ 0,
+ [
+ ir.AffineExpr.get_floor_div(d0, c2),
+ ir.AffineExpr.get_floor_div(d1, c2),
+ ir.AffineExpr.get_mod(d0, c2),
+ ir.AffineExpr.get_mod(d1, c2),
+ ],
+ )
l0 = ir.AffineDimExpr.get(0)
l1 = ir.AffineDimExpr.get(1)
l2 = ir.AffineDimExpr.get(2)
l3 = ir.AffineDimExpr.get(3)
lvl2dim = ir.AffineMap.get(4, 0, [2 * l0 + l2, 2 * l1 + l3])
``````````
</details>
https://github.com/llvm/llvm-project/pull/69986
More information about the Mlir-commits
mailing list