Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update IREE/LLVM dependencies. #631

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions experimental/iterators/benchmarks/inner_product/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import pandas as pd

from iree.compiler.runtime.np_to_memref import get_ranked_memref_descriptor
from mlir.sandbox.utils import realign
from mlir_iterators.dialects import iterators as it
from mlir_iterators.dialects import tabular as tab
from mlir_iterators.dialects import arith, func, memref, scf
Expand All @@ -31,7 +30,6 @@
)
from mlir_iterators.passmanager import PassManager
from mlir_iterators.runtime.pandas_to_iterators import to_tabular_view_descriptor
import mlir_iterators.all_passes_registration

_MLIR_RUNNER_UTILS_LIB_ENV = "MLIR_RUNNER_UTILS_LIB"
_MLIR_RUNNER_UTILS_LIB_DEFAULT = "libmlir_runner_utils.so"
Expand Down Expand Up @@ -82,6 +80,23 @@ def emit_benchmarking_function(name: str, bench: func.FuncOp) -> func.FuncOp:
return wrapper


# Copied from mlir.sandbox.utils. That package uses the vanilla `mlir` package
# instead of `mlir_iterators` as the rest of this file, so they are
# incompatible.
def realign(allocated_unaligned: np.ndarray, byte_alignment: int = 64):
shape = allocated_unaligned.shape
dt = allocated_unaligned.dtype
effective_size_in_bytes = np.prod(shape) * np.dtype(dt).itemsize
total_size_in_bytes = effective_size_in_bytes + byte_alignment
buf = np.empty(total_size_in_bytes, dtype=np.byte)
off = (-buf.ctypes.data % byte_alignment)
allocated_aligned = buf[off:off +
effective_size_in_bytes].view(dt).reshape(shape)
np.copyto(allocated_aligned, allocated_unaligned)
assert allocated_aligned.ctypes.data % byte_alignment == 0
return allocated_aligned


def setup_data(num_elements, dtype):
"""Sets up the input data: two `numpy.arrays` with `num_elements` each of
type `dtype`."""
Expand Down
1 change: 0 additions & 1 deletion experimental/iterators/include/iterators-c/Dialects.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#define ITERATORS_C_DIALECTS_H

#include "mlir-c/IR.h"
#include "mlir-c/Registration.h"
#include "mlir-c/Support.h"

#ifdef __cplusplus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Func/Transforms/FuncConversions.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/IR/BlockAndValueMapping.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
Expand Down
2 changes: 1 addition & 1 deletion experimental/iterators/lib/Conversion/PassDetail.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Pass/Pass.h"

namespace mlir {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Func/Transforms/FuncConversions.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/SCF/Transforms.h"
#include "mlir/Dialect/SCF/Transforms/Transforms.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
#include "mlir/Transforms/DialectConversion.h"

Expand Down
2 changes: 1 addition & 1 deletion experimental/iterators/lib/Utils/MLIRSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "iterators/Utils/MLIRSupport.h"

#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/SCF/SCF.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"

using namespace mlir;
Expand Down
6 changes: 2 additions & 4 deletions experimental/iterators/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ add_mlir_python_common_capi_library(IteratorsPythonCAPI
RELATIVE_INSTALL_ROOT "../../../.."
DECLARED_SOURCES
IteratorsPythonSources
MLIRPythonExtension.AllPassesRegistration
MLIRPythonExtension.RegisterEverything
MLIRPythonSources.Core
MLIRPythonSources.Dialects
MLIRPythonSources.ExecutionEngine
MLIRPythonSources.Passes
)

# ###############################################################################
Expand All @@ -79,11 +78,10 @@ add_mlir_python_modules(IteratorsPythonModules
INSTALL_PREFIX "python_packages/mlir_iterators"
DECLARED_SOURCES
IteratorsPythonSources
MLIRPythonExtension.AllPassesRegistration
MLIRPythonExtension.RegisterEverything
MLIRPythonSources.Core
MLIRPythonSources.Dialects
MLIRPythonSources.ExecutionEngine
MLIRPythonSources.Passes
COMMON_CAPI_LINK_LIBS
IteratorsPythonCAPI
)
1 change: 0 additions & 1 deletion experimental/iterators/python/IteratorsDialects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include "iterators-c/Dialects.h"
#include "mlir-c/IR.h"
#include "mlir-c/Registration.h"
#include "mlir/Bindings/Python/PybindAdaptors.h"

namespace py = pybind11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from mlir_iterators.passmanager import PassManager
from mlir_iterators.execution_engine import ExecutionEngine
from mlir_iterators.ir import Context, Module, IntegerType
import mlir_iterators.all_passes_registration


def run(f):
Expand Down
8 changes: 4 additions & 4 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ add_mlir_python_common_capi_library(SandboxSandboxCAPI
RELATIVE_INSTALL_ROOT "../../../.."
DECLARED_SOURCES
MLIRPythonSources
MLIRPythonExtension.AllPassesRegistration
MLIRPythonExtension.RegisterEverything
SandboxSources
)

Expand All @@ -69,7 +69,7 @@ add_mlir_python_modules(SandboxSandboxPythonModules
INSTALL_PREFIX "python_packages/iree_llvm_sandbox/mlir"
DECLARED_SOURCES
MLIRPythonSources
MLIRPythonExtension.AllPassesRegistration
MLIRPythonExtension.RegisterEverything
SandboxSources
COMMON_CAPI_LINK_LIBS
SandboxSandboxCAPI
Expand Down Expand Up @@ -103,7 +103,7 @@ add_mlir_python_common_capi_library(IREECAPI
RELATIVE_INSTALL_ROOT "../../../../.."
DECLARED_SOURCES
MLIRPythonSources
MLIRPythonExtension.AllPassesRegistration
MLIRPythonExtension.RegisterEverything
${_addl_sources}
)

Expand All @@ -118,7 +118,7 @@ add_mlir_python_modules(IREEPythonModules
INSTALL_PREFIX "python_packages/iree_llvm_sandboxiree/compiler"
DECLARED_SOURCES
MLIRPythonSources
MLIRPythonExtension.AllPassesRegistration
MLIRPythonExtension.RegisterEverything
${_addl_sources}
COMMON_CAPI_LINK_LIBS
IREECAPI
Expand Down
2 changes: 0 additions & 2 deletions python/mlir/sandbox/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from mlir.sandbox.variables import *
from mlir.sandbox.transform import Transform

# import mlir.all_passes_registration

import typing as tp


Expand Down
2 changes: 1 addition & 1 deletion third_party/iree
Submodule iree updated from 28bcb5 to 1a96f4