diff --git a/build_tools/python_deploy/build_linux_packages.sh b/build_tools/python_deploy/build_linux_packages.sh index 2a690034a193..aa86e384c7aa 100755 --- a/build_tools/python_deploy/build_linux_packages.sh +++ b/build_tools/python_deploy/build_linux_packages.sh @@ -193,7 +193,7 @@ function build_in_tree() { -DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR="/main_checkout/torch-mlir/externals/llvm-external-projects/torch-mlir-dialects" \ -DLLVM_TARGETS_TO_BUILD=host \ -DMLIR_ENABLE_BINDINGS_PYTHON=ON \ - -DTORCH_MLIR_ENABLE_LTC=OFF \ + -DTORCH_MLIR_ENABLE_LTC=ON \ -DTORCH_MLIR_USE_INSTALLED_PYTORCH="$torch_from_bin" \ -DTORCH_MLIR_SRC_PYTORCH_REPO=${TORCH_MLIR_SRC_PYTORCH_REPO} \ -DTORCH_MLIR_SRC_PYTORCH_BRANCH=${TORCH_MLIR_SRC_PYTORCH_BRANCH} \ @@ -256,9 +256,8 @@ function test_in_tree() { echo ":::: Run TOSA e2e integration tests" python -m e2e_testing.main --config=tosa -v - # XXX: Uncomment once LTC is enabled again. - # echo ":::: Run Lazy Tensor Core e2e integration tests" - # python -m e2e_testing.main --config=lazy_tensor_core -v + echo ":::: Run Lazy Tensor Core e2e integration tests" + python -m e2e_testing.main --config=lazy_tensor_core -v } function setup_venv() { @@ -307,7 +306,7 @@ function build_out_of_tree() { -DLLVM_DIR="/main_checkout/torch-mlir/llvm-build/lib/cmake/llvm/" \ -DMLIR_DIR="/main_checkout/torch-mlir/llvm-build/lib/cmake/mlir/" \ -DMLIR_ENABLE_BINDINGS_PYTHON=OFF \ - -DTORCH_MLIR_ENABLE_LTC=OFF \ + -DTORCH_MLIR_ENABLE_LTC=ON \ -DTORCH_MLIR_USE_INSTALLED_PYTORCH="$torch_from_bin" \ -DTORCH_MLIR_SRC_PYTORCH_REPO=${TORCH_MLIR_SRC_PYTORCH_REPO} \ -DTORCH_MLIR_SRC_PYTORCH_BRANCH=${TORCH_MLIR_SRC_PYTORCH_BRANCH} \ diff --git a/e2e_testing/main.py b/e2e_testing/main.py index a5ca74f28317..7c5a18b8fd81 100644 --- a/e2e_testing/main.py +++ b/e2e_testing/main.py @@ -15,8 +15,7 @@ # Available test configs. from torch_mlir_e2e_test.configs import ( - # XXX: Uncomment once LTC is enabled again. - # LazyTensorCoreTestConfig, + LazyTensorCoreTestConfig, LinalgOnTensorsBackendTestConfig, MhloBackendTestConfig, NativeTorchTestConfig, diff --git a/python/torch_mlir/csrc/base_lazy_backend/mlir_native_functions.cpp b/python/torch_mlir/csrc/base_lazy_backend/mlir_native_functions.cpp index 207c77961160..e0befad6120a 100644 --- a/python/torch_mlir/csrc/base_lazy_backend/mlir_native_functions.cpp +++ b/python/torch_mlir/csrc/base_lazy_backend/mlir_native_functions.cpp @@ -336,7 +336,7 @@ at::Tensor LazyNativeFunctions::empty_strided( c10::optional device, c10::optional pin_memory) { TORCH_LAZY_FN_COUNTER("lazy::"); at::Tensor t = empty_symint( - c10::fromIntArrayRef(size), + c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory, c10::nullopt); return t.as_strided(size, stride, /*storage_offset=*/0); } @@ -356,7 +356,7 @@ LazyNativeFunctions::fill_(at::Tensor& self, const at::Scalar& value) { at::Tensor LazyNativeFunctions::_unsafe_view( const at::Tensor& self, at::IntArrayRef size) { TORCH_LAZY_FN_COUNTER("lazy::"); - return LazyNativeFunctions::view_copy_symint(self, c10::fromIntArrayRef(size)); + return LazyNativeFunctions::view_copy_symint(self, c10::fromIntArrayRefSlow(size)); } // This is needed by the torch.tensor constructor. diff --git a/python/torch_mlir_e2e_test/configs/__init__.py b/python/torch_mlir_e2e_test/configs/__init__.py index 0c1ae882832f..a7118c0eff98 100644 --- a/python/torch_mlir_e2e_test/configs/__init__.py +++ b/python/torch_mlir_e2e_test/configs/__init__.py @@ -3,9 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # Also available under a BSD-style license. See LICENSE. -# XXX: Uncomment once LTC is enabled again. -# from .lazy_tensor_core import LazyTensorCoreTestConfig - +from .lazy_tensor_core import LazyTensorCoreTestConfig from .linalg_on_tensors_backend import LinalgOnTensorsBackendTestConfig from .native_torch import NativeTorchTestConfig from .torchscript import TorchScriptTestConfig diff --git a/pytorch-requirements.txt b/pytorch-requirements.txt index 06dddeadcbb0..f7dba06cc3b0 100644 --- a/pytorch-requirements.txt +++ b/pytorch-requirements.txt @@ -1,3 +1,3 @@ -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html --pre -torch==1.14.0.dev20221010 +torch==1.14.0.dev20221011 diff --git a/pytorch-version.txt b/pytorch-version.txt index a38ecf5bfc1a..ae73b075d3da 100644 --- a/pytorch-version.txt +++ b/pytorch-version.txt @@ -1 +1 @@ -04f63b02a1336db038f4b09006401546f445e68f +027a1549b9838b5268d3bedc123b05314ec671ca diff --git a/setup.py b/setup.py index e627107e80d5..9ad01adfa2c8 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ PACKAGE_VERSION = os.environ.get("TORCH_MLIR_PYTHON_PACKAGE_VERSION") or "0.0.1" # If true, enable LTC build by default -TORCH_MLIR_ENABLE_LTC_DEFAULT = False +TORCH_MLIR_ENABLE_LTC_DEFAULT = True # Build phase discovery is unreliable. Just tell it what phases to run. class CustomBuild(_build):