Skip to content

Merge main -> google - #3925

Merged
GMNGeoffrey merged 15 commits into
iree-org:googlefrom
GMNGeoffrey:main-to-google
Nov 19, 2020
Merged

GMNGeoffrey merged 15 commits into
iree-org:googlefrom
GMNGeoffrey:main-to-google

Conversation

@GMNGeoffrey

@GMNGeoffrey GMNGeoffrey commented Nov 19, 2020 •

Copy link
Copy Markdown
Member

ThomasRaoux and others added 10 commits November 18, 2020 10:27
Add Half library to be able to use f16 to/from f32 conversion in IREE tools.
* b37d8f0 Merge pull request iree-org#3901 from GMNGeoffrey:main-to-google
* 818077e Synchronize submodules
* 8d0c66e Synchronize submodules with LLVM at llvm/llvm-project@2be569870486
* f06260b Synchronize submodules
* 6809621 Integrate LLVM at llvm/llvm-project@2be569870486
* 05bab61 Synchronize submodules
* 3111eb7 Integrate LLVM at llvm/llvm-project@b2613fb2f0f5
…ble (iree-org#3882)

Add new tile size for fp16 and fallback to none vector version for size not aligned on tile size.
Convert `llvm.intr.exp` into a sequence of ops that computes an approximation to exp(x).
This is using the fact that:
```
exp(x) = exp(x - floor(x \ ln(2) * ln(2)) 2^(floor(x \ ln(2))
            = exp(x - k * ln(2)) * 2^k
```
exp(x - k * ln(2)) range is [0, ln(2)] which is approximated with 4degree polynomial.
The real number 2^k is computed with integer bitwise arithmetic.

MobileBert benchmarks:

Before:
```
------------------------------------------------------------------------------------
Benchmark                                          Time             CPU   Iterations
------------------------------------------------------------------------------------
BM_serving_default/process_time/real_time        907 ms          905 ms            1
```

After:
```
------------------------------------------------------------------------------------
Benchmark                                          Time             CPU   Iterations
------------------------------------------------------------------------------------
BM_serving_default/process_time/real_time        819 ms          815 ms            1
```
Adds tests for the functions in the `tf.math` API, with dynamic and complex variants.

To avoid adding another 1332 tests of `bazel` overhead to the CI while still generating coverage tables, I created two versions of the test suites: one that CI will run that detects any new errors, and one that creates a test for each function and backend. The tests that this change adds to the CI are:

```bazel
//integrations/tensorflow/e2e/math:math_complex_tests_multiple__iree_llvmjit PASSED in 26.9s
//integrations/tensorflow/e2e/math:math_complex_tests_multiple__iree_vmla PASSED in 15.3s
//integrations/tensorflow/e2e/math:math_complex_tests_multiple__iree_vulkan PASSED in 72.1s
//integrations/tensorflow/e2e/math:math_complex_tests_multiple__tf       PASSED in 38.1s
//integrations/tensorflow/e2e/math:math_dynamic_dims_tests_multiple__iree_llvmjit PASSED in 7.9s
//integrations/tensorflow/e2e/math:math_dynamic_dims_tests_multiple__iree_vmla PASSED in 13.9s
//integrations/tensorflow/e2e/math:math_dynamic_dims_tests_multiple__iree_vulkan PASSED in 4.5s
//integrations/tensorflow/e2e/math:math_dynamic_dims_tests_multiple__tf  PASSED in 38.0s
//integrations/tensorflow/e2e/math:math_tests_multiple__iree_llvmjit     PASSED in 41.5s
//integrations/tensorflow/e2e/math:math_tests_multiple__iree_vmla        PASSED in 19.7s
//integrations/tensorflow/e2e/math:math_tests_multiple__iree_vulkan      PASSED in 106.6s
//integrations/tensorflow/e2e/math:math_tests_multiple__tf               PASSED in 38.2s
//integrations/tensorflow/e2e/math:math_tests_multiple__tflite           PASSED in 21.1s
```

The following tests are deleted:

- `bool_test.py`
- `complex_test.py`
- `finite_test.py`
- `logical_ops_test.py`

`math_test.py` and `math_dyn_test.py` are replaced by `quantization_test.py` and `quantization_dyn_test.py`, since a fake quant test was added to them after the PR was made.

Supporting changes:

- Allow `tf.Tensor`s to be passed to traces. (Numpy's unchangeable `float64` default is cumbersome).
- Add `set_minus` to `bazel`.
- Expand support for input generation (e.g. uniform bools).
- Make xla_ops only tests individual ops in the XLA HLO dialect.
- Move slice_add.mlir to structural because we intend to test the fusion
  functionality.
- Add more tests to slice_add.mlir
@google-cla google-cla Bot added the cla: yes label Nov 19, 2020
rsuderman and others added 5 commits November 19, 2020 10:52
This is required internally at the moment. We could consider setting PY3
in the iree_py* rules as well.
While it's good to not have a thousand test targets with one function
each, these tests are also pretty slow at the moment (in particular
with swiftshader they can be quite slow). This shards the tests into
approximately 5 functions per instance, which gives a reasonable
tradeoff between startup overhead and test latency.
copybara-service Bot pushed a commit that referenced this pull request Nov 19, 2020
FUTURE_COPYBARA_INTEGRATE_REVIEW=#3925 from GMNGeoffrey:main-to-google 4d95ac5
PiperOrigin-RevId: 343375138
copybara-service Bot pushed a commit that referenced this pull request Nov 19, 2020
FUTURE_COPYBARA_INTEGRATE_REVIEW=#3925 from GMNGeoffrey:main-to-google 4d95ac5
PiperOrigin-RevId: 343375138
@GMNGeoffrey
GMNGeoffrey merged commit 56c814c into iree-org:google Nov 19, 2020
@GMNGeoffrey
GMNGeoffrey deleted the main-to-google branch November 19, 2020 23:02
GMNGeoffrey added a commit that referenced this pull request Nov 20, 2020
* 87fa757 Add missing license header
* 56c814c Merge pull request #3925 from GMNGeoffrey:main-to-google
* fbaf776 List pffft in repo aliases
* 31ece19 Synchronize submodules
* d62d0a3 Synchronize submodules with LLVM at llvm/llvm-project@620adacf87a3
* a4084cb Synchronize submodules
* 399d87d Integrate LLVM at llvm/llvm-project@620adacf87a3
* 29235b3 Use rewriter in ConvertVariableOps
* edcb46e Replace some IR modifications with rewriter usage.
* 94ed85c Synchronize submodules
* c43936b Integrate LLVM at llvm/llvm-project@1983acce7c4d
* 44ab843 Synchronize submodules
* 1dfb20b Integrate LLVM at llvm/llvm-project@6b1341eb5bb7
* 6e166cd Synchronize submodules
* 000c13a Integrate LLVM at llvm/llvm-project@5824a572adb5
* 23f5787 Synchronize submodules
* 905f831 Integrate LLVM at llvm/llvm-project@8c1e3cbebfe9
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.

7 participants