Skip to content

Merge main -> google - #4413

Merged
iree-copybara-bot merged 74 commits into
iree-org:googlefrom
KoolJBlack:main-to-google
Jan 7, 2021
Merged

iree-copybara-bot merged 74 commits into
iree-org:googlefrom
KoolJBlack:main-to-google

Conversation

@KoolJBlack

Copy link
Copy Markdown
Contributor

benvanik and others added 30 commits December 23, 2020 13:30
Though creating suspended avoids additional context switches testing
showed that they were faster to deal with than waiting entire scheduling
quantums for the threads to first resume after creation.
Turns out, setting the thread name can take a long~~~ time.
This allows us to keep the opaque id while also indicating that we expect
the thread to co-locate (or *not* co-locate, as is the case) with other
threads on the same core.
Adding the IREE CPU task scheduler (iree/task/).
The terminology here was a bit sloppy and caused some confusion.
Differentiate between rev, ref, commit, named commit option, etc.
This updates the MLIR-HLO submodule in a similar manner to the TF
submodule, just with slightly less parsing because the LLVM commit
information is in its own file.
…ree-org#4337)

Also adds the testonly option to the iree_bytecode_modules that are only used for testing, and updates the iree_bytecode_module bazel rule to use kwargs for testonly and visibility
The following option names for iree-run-module got changed since this doc was updated last time: (1) input_file -> module_file and (2) inputs -> function_inputs. This PR updates the iree-run-module example in the doc accordingly.
This is a wrapper around a cmake configure invocation that auto-detects a number of things across different CI platforms.
* Also reworks the setup.py files to be more standards compliant (and ci compatible).
* Makes the tools.core package platform specific but python version agnostic.
stellaraccident and others added 20 commits January 5, 2021 13:52
TEST=ruy doesn't fail with cpuinfo arm64 link errors on m1

Change-Id: I02cb9fba7d25306599217880e7aab8442c7ebe73
This adds quotations by default around strings translated by
Bazel -> CMake. Target names are deliberately (and explicitly) left
made unquoted.

Also removes the redundant OUT parameter usage in iree_cc_binary. This
is already handled in the function definition.

The only thing that functionally changes here are `TARGET_BACKEND` and
`DRIVER` arguments to the check test functions.

Note that this *only* changes files generated by Bazel -> CMake (by
running Bazel -> CMake) and not manually-written files.
It's good to test that these benchmarks run. It's really annoying to run
a billion iterations of them every time you try to run tests. This
literally takes longer than all the other tests combined. Instead, make
these binaries and invoke them for testing with
`--min_benchmark_time=0`.

This introduces CMake and Bazel -> CMake support for `run_binary_test`,
which runs the specified executable target with the specified args.
Punted on support for data dependencies, since these are not required
for this use case and I think we still haven't figured out how to do
that for CMake tests.
* Use backward buffer allocation in HLOToLinalgOnBuffers

Previously, we allocate temp buffers for results that can not find
mapping from tensor to memref in ConvertToLinalgBufferOp class. In a
later pass, we will eliminate temp buffers at tile and fuse stage. This
patch moves the temp buffer allocation logic to
propagateBufferUsedForResultTensor method, so the temp buffer can be
reused correctly. E.g.,

```mlir
module {
  func @matmul_add() {
    %c0 = constant 0 : index
    %cst = constant 0.000000e+00 : f32
    %0 = linalg.init_tensor [32, 64] : tensor<32x64xf32>
    %1 = hal.interface.load.tensor @legacy_io::@arg0, offset = %c0 : tensor<32x48xf32>
    %2 = hal.interface.load.tensor @legacy_io::@Arg1, offset = %c0 : tensor<48x64xf32>
    %3 = hal.interface.load.tensor @legacy_io::@ARG2, offset = %c0 : tensor<32x64xf32>
    %4 = dynamic_tensor_from_elements  {
    ^bb0(%arg0: index, %arg1: index):  // no predecessors
      yield %cst : f32
    } : tensor<32x64xf32>
    %5 = linalg.matmul ins(%1, %2 : tensor<32x48xf32>, tensor<48x64xf32>)
                       outs(%4 : tensor<32x64xf32>) -> tensor<32x64xf32>
    %6 = linalg.generic {indexing_maps = [affine_map<(d0, d1) -> (d0, d1)>,
                                          affine_map<(d0, d1) -> (d0, d1)>,
                                          affine_map<(d0, d1) -> (d0, d1)>],
                         iterator_types = ["parallel", "parallel"]
    } ins(%3, %5 : tensor<32x64xf32>, tensor<32x64xf32>)
      outs(%0 : tensor<32x64xf32>) {
    ^bb0(%arg0: f32, %arg1: f32, %arg2: f32):  // no predecessors
      %7 = addf %arg0, %arg1 : f32
      linalg.yield %7 : f32
    } -> tensor<32x64xf32>
    hal.interface.store.tensor %6, @legacy_io::@ret0, offset = %c0 : tensor<32x64xf32>
    return
  }
  hal.interface @legacy_io attributes {sym_visibility = "private"} {
    hal.interface.binding @arg0, set=0, binding=0, type="StorageBuffer", access="Read"
    hal.interface.binding @Arg1, set=0, binding=1, type="StorageBuffer", access="Read"
    hal.interface.binding @ARG2, set=0, binding=2, type="StorageBuffer", access="Read"
    hal.interface.binding @ret0, set=0, binding=3, type="StorageBuffer", access="Write"
  }
}
```

The buffer used in `dynamic_tensor_from_elements` and `linalg.matmul`
should be the same. However, we didn't propagate the temp buffer that
created by `linalg.matmul` to it's producers.

note: the example is not added in this patch. It will be added when
upstream mhlo.dot -> linalg.matmul to XLA repo. The current tests also
cover the change in the patch.

* Restrict the func op can only have a single block
* d8bc853 Synchronize submodules
* ba01437 Integrate LLVM at llvm/llvm-project@8bee4d4e8f54
* 4e1afba Synchronize submodules
* 871cae9 Integrate LLVM at llvm/llvm-project@51a292d99453
* 00d3a8a Synchronize submodules
* f2d3999 Synchronize submodules with LLVM at llvm/llvm-project@2016f2c8a76d
* acbf32f Merge pull request iree-org#4352 from GMNGeoffrey:main-to-google
* 3e55be4 Synchronize submodules
* 80362d1 Integrate LLVM at llvm/llvm-project@2016f2c8a76d
* 0ef2e83 Synchronize submodules
* d1284d7 Integrate LLVM at llvm/llvm-project@8001dcbd50ce
This revision reorders transformations to allow dispatch region formation to be
obtained from tiling linalg on tensors. This is expressed as an additive option to Linalg tiling to demonstrate a minimal incremental change.
The experiemental flow is modified to allow updated destructive pattern and bufferization.
Conversion to LLVM is spawned into a new pass that will gradually encompass the existing one. This is deemed necessary as some of the existing assumptions and implementation look more complex than they should.

A linalg_tensor_ops directory is added with a matmul example that runs end to end.
Now that the VM generated op definitions are checked in, we can avoid
this weird special casing.

I think there should be more cleanup around `IREE_ENABLE_MLIR` in
general, but deferring that for another change.

Tested:
Built and tested with compiler and mlir disabled
* We were just relying on implicit install/strip targets, which is wasteful. Now each builds just what it needs.
* Added tools-tf, tools-tflite and tools-xla packages.
* Reworked existing packages to use a common macro.
* Fixed bazel config to actually strip executables (versus its default, which just "thins" them).
* Configured new packages in the CI workflow but will enable in a followup.
@google-cla google-cla Bot added the cla: yes label Jan 7, 2021
copybara-service Bot pushed a commit that referenced this pull request Jan 7, 2021
iree-copybara-bot added a commit that referenced this pull request Jan 7, 2021
* bb0f95e Enable all packages on all every OS.
* 7cf454d Add dependencies properly for python install targets.
* 827eccf Third attempt: Rename packages to not collide on 'compiler' term.
* a3145cb Second attempt: fix some target names and change the docker image.
* 763fc1b First attempt: enable all python packages as experimental on linux.
* 9364f0f Add install targets for all python packages and configure in CI.
* 6fe74ac Correctly get binary name in android run_binary_test (#4403)
* b1bc038 Remove special handling for runtime -> compiler dep (#4396)
* 38d3c14 Disable run_binary_test on Android (#4402)
* 35d4b32 Build an e2e path for linalg on tensors. (#4368)
* c0e362c Merge google -> main (#4401)
* 7aecc34 Merge branch 'main' into google-to-main
* 7dc756b Attempt to appease linter on SUBMODULE_VERSIONS for mlir-emitc
* c83f594 Use backward buffer allocation in HLOToLinalgOnBuffers (#4318)
* 4889612 Avoid running slow benchmarks as part of testing (#4364)
* 9b72435 Default to quoting strings in Bazel -> CMake (#4394)
* 2a52c0f Fix m1 builds (#4361)
* 30f67df Update cross-compilation for changed experimental flag names (#4365)
* dc7d633 Merge pull request #4386 from google/benvanik-hal-pre
* 3d577af Move macos out of experimental now that it builds.
* 1c2a4bf Note that iree_task_list_discard leaves the list in a usable state.
* dcd1b53 Adding utils for common string view and allocator operations.
* d2af7f3 Adding iree_atomic_thread_fence (like (std::)atomic_thread_fence).
* c691e23 Bazel -> CMake cleanup (#4362)
* e002f99 Attempt to pin the python executable more robustly for macos.
* eb184f9 Link Foundation and Metal frameworks on macos.
* cc8c1b2 Turn -Wunused-variable back on (#4360)
* 52ebf7b Use existing script in submodule synchronize action (#4358)
* 0f0fffd Get remote name in a more portable way in gh scripting (#4357)
* 4868a49 Add one-shot runtime MacOS sanity check workflow.
* 44ca211 Actually use the platlib install command for linux wheels.
* fd36682 [spirv] Replace SPIRVOpLowering with a local class (#4383)
* cf10473 Fix macos matrix spec.
* 197f33b Enable windows build as non experimental.
* 05190e1 Make pyiree compiler package compatible with manylinux2014.
* 626d45a Add missing dep on HLOToLinalg (#4377)
* b0e8243 Integrate MLIR-EmitC at iml130/mlir-emitc@a438d3b (#4375)
* f0514e4 NFC: Fix some pre-existing yaml lint.
* bb1de96 Plumb package suffix, version, and revision info to release packages.
* 995d0b7 Moved iree-check-module-main.cc to iree/tools (#4312)
* 56e40ac Remove suspected merge conflict in darwin_threading.c.
* 938875f Enable macos and windows builds.
* 921b46d Rename cmake_configure_ci.py -> cmake_ci.py.
* 57435cd Fix typo build_iree -> iree_build.
* fd1d06c Fix typo in install-iree -> iree-install.
* 2ab4dfc Update workflow dispatch token.
* 29f1596 Re-enable tag fetching
* f8f4031 Fix issues in snapshot schedule.
* bd6cf1f Add scheduled workflow to trigger snapshot releases.
* 442b35e Fix typo in runtime matrix check.
* b4981b2 Configure pipeline to build IREE runtime wheels.
* 77a63cd Make the main python packages cmake installable.
* 4e1602a Add cmake_configure_ci.py.
* 723ff37 Remove typo from GCC iree_atomic_load_auto macro.
* 847ac69 Disable workflow on push to cidev
* e666fbf Fixing the casting behavior of atomic compare exchange on windows.
* 25c4cb3 Adding merge_from support for IntrusiveList unique_ptr/ref_ptr.
* 334d3e2 Update getting_started_linux_cmake.md (#4367)
* c9687d4 Update bazel_to_cmake to support testonly for iree_bytecode_module (#4337)
* 0657be2 Fix mlir-hlo path in Submodule update scripting (#4356)
* d146a3d Add scripting to update mlir-hlo to match LLVM commit (#4348)
* 3010d3c Clean up naming in LLVM sync script (#4346)
* af6c2d4 Merge pull request #4227 from google/benvanik-tasks-core
* 01600a5 Adding an entire RTOS-scale task scheduling system.
* b47e6f0 Clarifying note on iree_wait_set_erase.
* a60332c Tweaking thread affinity groups to have an SMT flag. This allows us to keep th..
* c5b440d Adding tracing to thread name setters. Turns out, setting the thread name can ..
* b544ef6 Allowing threads to be created running (not always suspended). Though creating..
* c3af92e Adding IREE_TRACE_ZONE_SET_COLOR macro.
* ed727e2 Plumbing tracy mutex support into iree_slim_mutex_t.
* 122d6b8 Adding benoit's MiniLcg pseudo-random number generator.
* 142bc6a Adding and/or/xor atomic operations.
* 9853806 Adding IREE_ASSERT macros.

COPYBARA_INTEGRATE_REVIEW=#4413 from KoolJBlack:main-to-google 594e06c
PiperOrigin-RevId: 350634605
ScottTodd added a commit that referenced this pull request Jan 7, 2021
* bb0f95e Enable all packages on all every OS.
* 7cf454d Add dependencies properly for python install targets.
* 827eccf Third attempt: Rename packages to not collide on 'compiler' term.
* a3145cb Second attempt: fix some target names and change the docker image.
* 763fc1b First attempt: enable all python packages as experimental on linux.
* 9364f0f Add install targets for all python packages and configure in CI.
* 6fe74ac Correctly get binary name in android run_binary_test (#4403)
* b1bc038 Remove special handling for runtime -> compiler dep (#4396)
* 38d3c14 Disable run_binary_test on Android (#4402)
* 35d4b32 Build an e2e path for linalg on tensors. (#4368)
* c0e362c Merge google -> main (#4401)
* 7aecc34 Merge branch 'main' into google-to-main
* 7dc756b Attempt to appease linter on SUBMODULE_VERSIONS for mlir-emitc
* c83f594 Use backward buffer allocation in HLOToLinalgOnBuffers (#4318)
* 4889612 Avoid running slow benchmarks as part of testing (#4364)
* 9b72435 Default to quoting strings in Bazel -> CMake (#4394)
* 2a52c0f Fix m1 builds (#4361)
* 30f67df Update cross-compilation for changed experimental flag names (#4365)
* dc7d633 Merge pull request #4386 from google/benvanik-hal-pre
* 3d577af Move macos out of experimental now that it builds.
* 1c2a4bf Note that iree_task_list_discard leaves the list in a usable state.
* dcd1b53 Adding utils for common string view and allocator operations.
* d2af7f3 Adding iree_atomic_thread_fence (like (std::)atomic_thread_fence).
* c691e23 Bazel -> CMake cleanup (#4362)
* e002f99 Attempt to pin the python executable more robustly for macos.
* eb184f9 Link Foundation and Metal frameworks on macos.
* cc8c1b2 Turn -Wunused-variable back on (#4360)
* 52ebf7b Use existing script in submodule synchronize action (#4358)
* 0f0fffd Get remote name in a more portable way in gh scripting (#4357)
* 4868a49 Add one-shot runtime MacOS sanity check workflow.
* 44ca211 Actually use the platlib install command for linux wheels.
* fd36682 [spirv] Replace SPIRVOpLowering with a local class (#4383)
* cf10473 Fix macos matrix spec.
* 197f33b Enable windows build as non experimental.
* 05190e1 Make pyiree compiler package compatible with manylinux2014.
* 626d45a Add missing dep on HLOToLinalg (#4377)
* b0e8243 Integrate MLIR-EmitC at iml130/mlir-emitc@a438d3b (#4375)
* f0514e4 NFC: Fix some pre-existing yaml lint.
* bb1de96 Plumb package suffix, version, and revision info to release packages.
* 995d0b7 Moved iree-check-module-main.cc to iree/tools (#4312)
* 56e40ac Remove suspected merge conflict in darwin_threading.c.
* 938875f Enable macos and windows builds.
* 921b46d Rename cmake_configure_ci.py -> cmake_ci.py.
* 57435cd Fix typo build_iree -> iree_build.
* fd1d06c Fix typo in install-iree -> iree-install.
* 2ab4dfc Update workflow dispatch token.
* 29f1596 Re-enable tag fetching
* f8f4031 Fix issues in snapshot schedule.
* bd6cf1f Add scheduled workflow to trigger snapshot releases.
* 442b35e Fix typo in runtime matrix check.
* b4981b2 Configure pipeline to build IREE runtime wheels.
* 77a63cd Make the main python packages cmake installable.
* 4e1602a Add cmake_configure_ci.py.
* 723ff37 Remove typo from GCC iree_atomic_load_auto macro.
* 847ac69 Disable workflow on push to cidev
* e666fbf Fixing the casting behavior of atomic compare exchange on windows.
* 25c4cb3 Adding merge_from support for IntrusiveList unique_ptr/ref_ptr.
* 334d3e2 Update getting_started_linux_cmake.md (#4367)
* c9687d4 Update bazel_to_cmake to support testonly for iree_bytecode_module (#4337)
* 0657be2 Fix mlir-hlo path in Submodule update scripting (#4356)
* d146a3d Add scripting to update mlir-hlo to match LLVM commit (#4348)
* 3010d3c Clean up naming in LLVM sync script (#4346)
* af6c2d4 Merge pull request #4227 from google/benvanik-tasks-core
* 01600a5 Adding an entire RTOS-scale task scheduling system.
* b47e6f0 Clarifying note on iree_wait_set_erase.
* a60332c Tweaking thread affinity groups to have an SMT flag. This allows us to keep th..
* c5b440d Adding tracing to thread name setters. Turns out, setting the thread name can ..
* b544ef6 Allowing threads to be created running (not always suspended). Though creating..
* c3af92e Adding IREE_TRACE_ZONE_SET_COLOR macro.
* ed727e2 Plumbing tracy mutex support into iree_slim_mutex_t.
* 122d6b8 Adding benoit's MiniLcg pseudo-random number generator.
* 142bc6a Adding and/or/xor atomic operations.
* 9853806 Adding IREE_ASSERT macros.

COPYBARA_INTEGRATE_REVIEW=#4413 from KoolJBlack:main-to-google 594e06c
PiperOrigin-RevId: 350634605
@iree-copybara-bot
iree-copybara-bot merged commit 4fc1a35 into iree-org:google Jan 7, 2021
@KoolJBlack KoolJBlack mentioned this pull request Jan 7, 2021
KoolJBlack added a commit that referenced this pull request Jan 7, 2021
* d6fa00d Format ConvertToLLVM2.cpp.
* 4fc1a35 Merge pull request #4413 from KoolJBlack:main-to-google
* 594e06c Merge branch 'google' into main-to-google
* 0c7d651 Synchronize submodules
* 78170d0 Synchronize submodules with LLVM at llvm/llvm-project@d38a0258a5f4
* 7725556 Synchronize submodules
* 4c8cfe7 Integrate LLVM at llvm/llvm-project@7f7b0dc4e15f
* 14fbe4d9 Synchronize submodules
* f606a8e Integrate LLVM at llvm/llvm-project@d38a0258a5f4
* 3ac7e07 Update from StrJoin to !interleave
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.