Skip to content

Merge main -> google - #5551

Merged
copybara-service[bot] merged 15 commits into
iree-org:googlefrom
GMNGeoffrey:main-to-google
Apr 22, 2021
Merged

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

Conversation

@GMNGeoffrey

@GMNGeoffrey GMNGeoffrey commented Apr 21, 2021 •

Copy link
Copy Markdown
Member

benvanik and others added 11 commits April 19, 2021 11:02
This will allow us to implement synchronous execution behavior for local
execution.
This is a command buffer that can be used for _ALLOW_INLINE_EXECUTION mode
command buffers when no threading is desired.

Future improvements could make the actual dispatch pluggable such that
it could be used with the task system, another thread pool, etc. For now
all dispatches execute synchronously on the recording thread.
Adding inline command buffers to the HAL API and a basic implementation.
iree-org#5509)

This is mostly just the plumbing to enable iree-org#4680 by defining a new
`dylib-sync` runtime driver (pending iree-org#4298 to cleanup drivers).

This driver does not support recording/replaying command buffers and has
some gotchas with semaphores (no deadline waits, probably bugs, etc).
Enabled with `-iree-llvm-link-embedded` and
`-iree-llvm-target-triple={any}-pc-linux-elf`.

~1000x faster than the system loader on Windows (60-100ms -> 50us)
and 64b + ELF memory usage.

Imports are not supported so it fails on any executable that ends up
using -lm (floorf, etc).
These still need to be generated someday but for now this at least allows
us to share them with emitc, the HAL, and VMVX.
Only RFFT type is supported, which means the inputs are all real
numbers. Since we do not handle complex numbers in IREE and mhlo.fft
returns a complex number, we have to use mhlo.complex op to pack real
part and imaginary part together. And rely on canonicalization patterns
to fold it away. They will be folded away because we ran
`PopulateComplexLoweringPatterns` in HLOToHLOPreprocessing pass, if
there are complex number computation, mhlo.real/imag will be created.

The implementation is not FFT algorithm. It follows DFT definition to
support naive solution. See definition
https://en.wikipedia.org/wiki/Discrete_Fourier_transform

Fixes iree-org#5299
Cleaning up iree/base/api.h is high on the list - it should be using
iree/base/attributes.h instead of defining its own.
Moving the HAL module shims into `iree/vm/`.
This adds basic support for all list operations except for the ones dealing with refs.

Things missing include lists as function arguments/results and basic block arguments.

Co-authored-by: Marius Brehler <[email protected]>
@google-cla google-cla Bot added the cla: yes label Apr 21, 2021
benvanik and others added 4 commits April 21, 2021 12:29
Otherwise we get an error about narrowing from 64 to 32 bit on 32-bit
architectures. This wasn't caught because we don't have any tests of
32-bit architectures in OSS (but we do internally at Google).

```
iree/hal/local/elf/elf_module.c:157:11: error: format specifies type
'size_t' (aka 'unsigned int') but the argument has type
'iree_elf64_off_t' (aka 'unsigned long long') [-Werror,-Wformat]
          phdr->p_offset, phdr->p_offset + phdr->p_filesz,
```

So longer term fixes are to add a 32-bit build bot and create format
specifiers for IREE's types (so we don't just have to widen
everywhere), but this unblocks integration for now.
@copybara-service
copybara-service Bot merged commit 44d1063 into iree-org:google Apr 22, 2021
GMNGeoffrey added a commit that referenced this pull request Apr 22, 2021
* 97a7c8e Synchronize submodules with LLVM at llvm/llvm-project@2f69975683f5
* 3c09f24 Integrate LLVM at llvm/llvm-project@2f69975683f5
* 44d1063 Merge pull request #5551 from GMNGeoffrey:main-to-google
* 1243070 Integrate LLVM at llvm/llvm-project@1a3f88658a02
* 361e47b Integrate LLVM at llvm/llvm-project@4bb60c285cb3
* eaeb09d Integrate LLVM at llvm/llvm-project@9430efa18b02
* dc0af0c Synchronize submodules with LLVM at llvm/llvm-project@e0adf7e06a9e
* 678b1e1 Integrate LLVM at llvm/llvm-project@e0adf7e06a9e
* 98cf087 Integrate LLVM at llvm/llvm-project@01ace074fcb6
* 307cef0 Integrate LLVM at llvm/llvm-project@aa80ea8a617b
* 297f730 Integrate LLVM at llvm/llvm-project@fb69b92c7b33
* 5f1f4fe Integrate LLVM at llvm/llvm-project@f549176ad976
* bda62f0 Merge main -> google
* 0adee0f Merge pull request #5520 from GMNGeoffrey:main-to-google
* e302cb3 Synchronize submodules with LLVM at llvm/llvm-project@80e166f81abd
* 6c94570 Integrate LLVM at llvm/llvm-project@80e166f81abd
* ce364ae Integrate LLVM at llvm/llvm-project@517c3aee4de5
* 32792f7 Merge pull request #5500 from rsuderman:main-to-google
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.

3 participants