Skip to content

Merge main -> google - #5637

Merged
copybara-service[bot] merged 7 commits into
iree-org:googlefrom
ThomasRaoux:main-to-google
Apr 27, 2021
Merged

copybara-service[bot] merged 7 commits into
iree-org:googlefrom
ThomasRaoux:main-to-google

Conversation

@ThomasRaoux

Copy link
Copy Markdown
Contributor

@google-cla google-cla Bot added the cla: yes label Apr 27, 2021
antiagainst and others added 7 commits April 27, 2021 07:57
For linalg on tensors path we use cyclic distribution to invocations
in one workgroup.
This commit moves cooperative matrix support to the Linalg on
tensor path. A few improvements are done along the way to have
a better pipeline structure:

* Cooperative matrix support previously were scattered across
  various passes; now they are scoped into the same pass for
  better isolation.
* Now the handling of cooperative matrix is at a more proper
  layer. Cooperative matrix is at a large vector semantics level.
  We try to lower vector transfer read/write/arithmetic ops when
  we are still at that level with the necessary high-level
  information; not trying to left them "fall through" to the
  final converting to SPIR-V stage.
* Now the lowering is more progressive. This commit leverages
  new constructs like unrealized_conversion_cast recently added
  in core to bridge the gap and makes SPIR-V lowering more modular
  and progressive: cooperative matrix part is first handled, with
  the rest latter converted and those cast ops cancelled out.
  Upstream SPIR-V support is expected to grow more towards this
  direction.

The majority of the code in the new VectorToCooperativeMatrixPass.cpp
file is moved from ConvertToSPIRVPass.cpp, with modifications to
properly use type conversion integrated into dialect conversion
framework.
The following operations can be lowered to flow.tensor. ops.

linalg.tensor_reshape -> flow.tensor.reshape : Once all reshapes can be folded away, the remaining reshapes only exist at the boundaries of dispatch regions. These are better off converted to flow.tensor.reshape so that they could become no-ops when lowered to the hal layer.

subtensor -> flow.tensor.slice. A subtensor operation can be lowered to a flow.tensor.slice operation in some cases. This can become a no-op in many cases.

subtensor_insert -> flow.tensor.update. A subtensor_insert operation can be lowered to a flow.tensor.update operation which will allow for doign in-place updates.

This will eliminate some dispatch regions that do not need to be created.
@copybara-service
copybara-service Bot merged commit 2650205 into iree-org:google Apr 27, 2021
This was referenced Apr 27, 2021
GMNGeoffrey added a commit that referenced this pull request Apr 27, 2021
ThomasRaoux added a commit that referenced this pull request Apr 27, 2021
* 0dbcf67 Merge pull request #5637 from ThomasRaoux:main-to-google
* 7f40d6c Synchronize submodules with LLVM at llvm/llvm-project@f8de9aa
* fe4ce06 Integrate LLVM at llvm/llvm-project@f8de9aa
* 8f74952 Add support for returning empty sequences in the IREE-JAX frontend.
* 9082ada Integrate LLVM at llvm/llvm-project@494e771
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.

4 participants