Skip to content

Commit

Permalink
Merge branch 'main' into google-to-main
Browse files Browse the repository at this point in the history
  • Loading branch information
NatashaKnk authored Apr 5, 2021
2 parents 95cce12 + 6936ee7 commit 2e5257d
Show file tree
Hide file tree
Showing 284 changed files with 6,695 additions and 4,454 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,3 @@
[submodule "third_party/mlir-hlo"]
path = third_party/mlir-hlo
url = https://github.com/tensorflow/mlir-hlo.git
[submodule "third_party/wasm-micro-runtime"]
path = third_party/wasm-micro-runtime
url = https://github.com/bytecodealliance/wasm-micro-runtime.git
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ add_subdirectory(build_tools/third_party/half EXCLUDE_FROM_ALL)
add_subdirectory(build_tools/third_party/pffft EXCLUDE_FROM_ALL)
add_subdirectory(build_tools/third_party/renderdoc_api EXCLUDE_FROM_ALL)
add_subdirectory(build_tools/third_party/vulkan_memory_allocator EXCLUDE_FROM_ALL)
add_subdirectory(build_tools/third_party/wasm-micro-runtime EXCLUDE_FROM_ALL)

add_subdirectory(third_party/cpuinfo EXCLUDE_FROM_ALL)
add_subdirectory(third_party/googletest EXCLUDE_FROM_ALL)
Expand Down
3 changes: 1 addition & 2 deletions SUBMODULE_VERSIONS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ d8c7ee00a687ac369e62e2032514a93a9b413502 third_party/pybind11
685f86471e9d26b3eb7676695a2e2cefb4551ae9 third_party/spirv_cross
f8bf11a0253a32375c32cad92c841237b96696c0 third_party/spirv_headers
a8fbda3000692e62b477383e81a5386f8305d0c6 third_party/tensorflow
8732f0e94e4e41049a43029202bda94d7b4e85da third_party/tracy
e35d02186d00eff26ec6c698331a0767a28a51b0 third_party/tracy
9bd3f561bcee3f01d22912de10bb07ce4e23d378 third_party/vulkan_headers
3528e2aed3e8808f33e1e7d63eeb1560456a605a third_party/vulkan_memory_allocator
54e82ec439552018d0f26c60b0fd6cc9e36b42a8 third_party/wasm-micro-runtime
3 changes: 3 additions & 0 deletions build_tools/bazel/build_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ declare -a test_env_args=(
declare -a default_build_tag_filters=("-nokokoro")
declare -a default_test_tag_filters=("-nokokoro" "-driver=metal")

# The VK_KHR_shader_float16_int8 extension is optional prior to Vulkan 1.2.
# We test on SwiftShader, which does not support this extension.
default_test_tag_filters+=("-vulkan_uses_vk_khr_shader_float16_int8")
# CUDA CI testing disabled until we setup a target for it.
default_test_tag_filters+=("-driver=cuda")

Expand Down
4 changes: 3 additions & 1 deletion build_tools/buildkite/cmake/android/arm64-v8a/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ steps:
- "tar xzf build-artifacts.tgz"
- "find build-android/ -name '*.cmake' -exec sed -i \"s!\\$IREE_DOCKER_WORKDIR/!\\$PWD/!g\" {} \\;"
- "cd build-android/"
- "ctest --output-on-failure"
# vulkan tests using khr_shader_float16_int8 are failing on pixel4.
# Disabling it until we identify the root cause.
- "ctest --output-on-failure --label-exclude \"^vulkan_uses_vk_khr_shader_float16_int8\\$\""
agents:
- "android-soc=snapdragon-855"
- "queue=test-android"
Expand Down
6 changes: 6 additions & 0 deletions build_tools/cmake/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export IREE_VULKAN_DISABLE=${IREE_VULKAN_DISABLE:-0}
export IREE_LLVMAOT_DISABLE=${IREE_LLVMAOT_DISABLE:-0}
# CUDA is off by default.
export IREE_CUDA_DISABLE=${IREE_CUDA_DISABLE:-1}
# The VK_KHR_shader_float16_int8 extension is optional prior to Vulkan 1.2.
# We test on SwiftShader, which does not support this extension.
export IREE_VULKAN_F16_DISABLE=${IREE_VULKAN_F16_DISABLE:-1}

# Tests to exclude by label. In addition to any custom labels (which are carried
# over from Bazel tags), every test should be labeled with the directory it is
Expand Down Expand Up @@ -62,6 +65,9 @@ fi
if [[ "${IREE_CUDA_DISABLE?}" == 1 ]]; then
label_exclude_args+=("^driver=cuda$")
fi
if [[ "${IREE_VULKAN_F16_DISABLE?}" == 1 ]]; then
label_exclude_args+=("^vulkan_uses_vk_khr_shader_float16_int8$")
fi

# Join on "|"
label_exclude_regex="($(IFS="|" ; echo "${label_exclude_args[*]?}"))"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ export CTEST_PARALLEL_LEVEL=${CTEST_PARALLEL_LEVEL:-$(nproc)}
echo "Testing with CTest"
ctest --output-on-failure \
--tests-regex "^integrations/tensorflow/|^bindings/python/" \
--label-exclude "^nokokoro$"
--label-exclude "^nokokoro$|^vulkan_uses_vk_khr_shader_float16_int8$"
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ echo "Initializing submodules"
echo "Building with cmake"
./build_tools/cmake/clean_build.sh

export IREE_VULKAN_F16_DISABLE=0
export IREE_CUDA_DISABLE=0
echo "Testing with ctest"
./build_tools/cmake/test.sh
54 changes: 54 additions & 0 deletions build_tools/mako/config/benchmark_template.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This template is used to define/update Mako benchmarks. The input_value_info
# and metric_info_list should be updated according to the purpose of the
# benchmark. The benchmark_name and description must be updated. The
# benchmark_key should not be added before creating the benchmark. You have to
# fill the server-generated key which is returned by the Mako tool.
#
# For more details, see:
# https://github.com/google/mako/blob/master/docs/GUIDE.md#preparing-your-benchmark

# benchmark_key: "TBD"
benchmark_name: "BENCHMARK_NAME (PHONE) (UNIT)"
project_name: "iree"

# Only owners can write to the benchmark
owner_list: "[email protected]"
owner_list: "[email protected]"

# Define the name and type for x-axis of run charts
input_value_info: {
value_key: "t"
label: "time"
type: NUMERIC
}

# Three metrics, define the names for y-axis values of both run and aggregate
# charts.
metric_info_list: {
value_key: "cpu"
label: "DYLib_AOT"
}
metric_info_list: {
value_key: "vmla"
label: "VMLA"
}
metric_info_list: {
value_key: "vlk"
label: "Vulkan-SPIRV"
}

description: "IREE Benchmark Template"
4 changes: 4 additions & 0 deletions build_tools/mako/config/mobilenet-v2-pixel4.config
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,9 @@ metric_info_list: {
value_key: "vlk"
label: "Vulkan-SPIRV"
}
metric_info_list: {
value_key: "cpu2"
label: "DYLib_AOT_Linalg-On-Tensors"
}

description: "Keras Applications: MobileNet V2"
8 changes: 8 additions & 0 deletions build_tools/mako/config/mobilenet-v2-s20.config
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,13 @@ metric_info_list: {
value_key: "vlk"
label: "Vulkan-SPIRV"
}
metric_info_list: {
value_key: "cpu2"
label: "DYLib_AOT_Linalg-On-Tensors"
}
metric_info_list: {
value_key: "vlk2"
label: "Vulkan-SPIRV_Linalg-On-Tensors"
}

description: "Keras Applications: MobileNet V2"
91 changes: 72 additions & 19 deletions build_tools/mako/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def __init__(self, name, model_artifacts_name, model_path, flagfile_path,
self.phones = phones


def get_pixel4_default_target_list(batch_config=None):
def get_pixel4_default_target_list(skipped_target=None, batch_config=None):
if skipped_target is None:
skipped_target = []
if batch_config is None:
batch_config = []
targets = [
Expand All @@ -111,15 +113,36 @@ def get_pixel4_default_target_list(batch_config=None):
compilation_flags=[
"--iree-spirv-enable-vectorization",
"--iree-vulkan-target-triple=qualcomm-adreno640-unknown-android10"
]),
TargetInfo(name="dylib-llvm-aot",
mako_tag="cpu2",
compilation_flags=[
"--iree-llvm-target-triple=aarch64-none-linux-android29",
"--iree-flow-dispatch-linalg-on-tensors",
"--iree-codegen-llvm-experimental-linalg-on-tensors",
"-iree-flow-inline-constants-max-byte-length=2048"
],
runtime_flags=["--dylib_worker_count=1"]),
TargetInfo(
name="vulkan-spirv",
mako_tag="vlk2",
compilation_flags=[
"--iree-vulkan-target-triple=qualcomm-adreno640-unknown-android10",
"--iree-flow-dispatch-linalg-on-tensors",
"--iree-codegen-spirv-experimental-linalg-on-tensors",
"-iree-flow-inline-constants-max-byte-length=2048"
])
]
targets = [elem for elem in targets if elem.mako_tag not in skipped_target]
for target in targets:
if target.mako_tag in batch_config:
target.add_batch_flag(batch_config[target.mako_tag])
return targets


def get_s20_default_target_list(batch_config=None):
def get_s20_default_target_list(skipped_target=None, batch_config=None):
if skipped_target is None:
skipped_target = []
if batch_config is None:
batch_config = []
targets = [
Expand All @@ -130,13 +153,33 @@ def get_s20_default_target_list(batch_config=None):
"--iree-llvm-target-triple=aarch64-none-linux-android29"
],
runtime_flags=["--dylib_worker_count=1"]),
TargetInfo(name="vulkan-spirv",
mako_tag="vlk",
TargetInfo(
name="vulkan-spirv",
mako_tag="vlk",
compilation_flags=[
"--iree-spirv-enable-vectorization",
"--iree-vulkan-target-triple=valhall-g77-unknown-android10",
]),
TargetInfo(name="dylib-llvm-aot",
mako_tag="cpu2",
compilation_flags=[
"--iree-spirv-enable-vectorization",
"--iree-vulkan-target-triple=valhall-g77-unknown-android10"
])
"--iree-llvm-target-triple=aarch64-none-linux-android29",
"--iree-flow-dispatch-linalg-on-tensors",
"--iree-codegen-llvm-experimental-linalg-on-tensors",
"-iree-flow-inline-constants-max-byte-length=2048"
],
runtime_flags=["--dylib_worker_count=1"]),
TargetInfo(
name="vulkan-spirv",
mako_tag="vlk2",
compilation_flags=[
"--iree-vulkan-target-triple=valhall-g77-unknown-android10",
"--iree-flow-dispatch-linalg-on-tensors",
"--iree-codegen-spirv-experimental-linalg-on-tensors",
"-iree-flow-inline-constants-max-byte-length=2048"
])
]
targets = [elem for elem in targets if elem.mako_tag not in skipped_target]
for target in targets:
if target.mako_tag in batch_config:
target.add_batch_flag(batch_config[target.mako_tag])
Expand All @@ -159,13 +202,16 @@ def get_s20_default_target_list(batch_config=None):
PhoneBenchmarkInfo(name="Pixel4",
benchmark_key="5538704950034432",
targets=get_pixel4_default_target_list(
{'cpu': 8})),
skipped_target=['cpu2', 'vlk2'],
batch_config={'cpu': 8})),
PhoneBenchmarkInfo(name="S20",
benchmark_key="4699630718681088",
targets=get_s20_default_target_list({
'cpu': 8,
'vlk': 16
})),
targets=get_s20_default_target_list(
skipped_target=['cpu2', 'vlk2'],
batch_config={
'cpu': 8,
'vlk': 16
})),
]),
ModelBenchmarkInfo(
name="mobilenet-v2",
Expand All @@ -176,13 +222,20 @@ def get_s20_default_target_list(batch_config=None):
PhoneBenchmarkInfo(name="Pixel4",
benchmark_key="6338759231537152",
targets=get_pixel4_default_target_list(
{'cpu': 16})),
PhoneBenchmarkInfo(name="S20",
benchmark_key="5618403088793600",
targets=get_s20_default_target_list({
'cpu': 16,
'vlk': 64
})),
skipped_target=['vlk2'],
batch_config={
'cpu': 16,
'cpu2': 10
})),
PhoneBenchmarkInfo(
name="S20",
benchmark_key="5618403088793600",
targets=get_s20_default_target_list(batch_config={
'cpu': 16,
'vlk': 64,
'cpu2': 10,
'vlk2': 64
})),
])
]

Expand Down
59 changes: 0 additions & 59 deletions build_tools/third_party/wasm-micro-runtime/CMakeLists.txt

This file was deleted.

1 change: 1 addition & 0 deletions docs/get_started/getting_started_tensorflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ For example to run TensorFlow-based tests, you can build `iree-import-tf`
TODO(4979): Rename iree-tf-import to iree-import-tf

```shell
python3 configure_bazel.py
cd integrations/tensorflow
bazel build \
//iree_tf_compiler:iree-tf-import \
Expand Down
Loading

0 comments on commit 2e5257d

Please sign in to comment.