-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update TF to 2.8 * Always allocate im2col tensor in prepare stage to avoid errors * Various Bazel fixes * Update TF submodule * Update Android build tools version * Apply xnnpack armhf fix * More Bazel MLIR tablegen fixes * Update test case because of randomized output order * Update PassRegistration constructors * Remove DecodeConstantPass functionality * getValue -> getValues * Update PassRegistration constructors (part 2) * Update converter passes to match with TF's passes * Update flatbuffer options to toco options See tensorflow/tensorflow@b2b7933 * Fixes for padding in tablegen and .cc MLIR files * Fix NHWC constant * Fix linking issue with LarqDialect object * Update MLIR passes based on latest version from TF sources * Rename const dense to artih.const dense * Change tf.resource to tf_type.resource * Rename ConstantOp to Arith_ConstantOp in td files * More constant -> arith.constant fixes * Use `std.constant` for none values This doesn't make the unittests pass yet, but it fixes the `arith.constant` verification error: ``` unexpected error: 'arith.constant' op value must be an integer, float, or elements attribute. ``` * Fix optimization unittest * Fix `prepare-tf` test case * Implement custom constant materializer to fix constant folding * Fix compiler warning * Update submodule to `v2.8.0` tag * Pin flatbuffers on CI * Add `lq.quantize(tfl.dequantize(x))` -> `lq.quantize(x)` pattern * Sync `tf_tfl_passes` with upstresam TF * Workaround end2end test failure by using random bias * Remove optimize `lq.quantize(tfl.dequantize(x))` in more cases * TF 2.8: Update converter to sync with upstream tensorflow (#723) * Update converter to sync with upstream tensorflow * Update larq_compute_engine/mlir/tf_to_tfl_flatbuffer.cc Co-authored-by: Tom Bannink <[email protected]> Co-authored-by: Tom Bannink <[email protected]> * Replace make build system with basic CMake * Fix the im2col_id issue properly this time * Pin manylinux2010 image to TF 2.8 * Pin Windows 2019 as build environment * Checkin TF Addons `manylinux2010` toolchain * Increase timeout for Windows release builds from 6 (default) to 10 hours * Benchmark app from CMake: change name and add missing source files * Remove timeout beyond the maximum 6 hours Co-authored-by: Lukas Geiger <[email protected]> Co-authored-by: Lukas Geiger <[email protected]> Co-authored-by: Tom Bannink <[email protected]>
- Loading branch information
1 parent
35c0593
commit 5572b76
Showing
58 changed files
with
2,669 additions
and
761 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.7.2 | ||
4.2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
project(larq_compute_engine C CXX) | ||
|
||
# Options and their default values | ||
option(COMPILE_EXAMPLE "Enable compilation of the minimal example" ON) | ||
option(COMPILE_BENCHMARK "Enable compilation of the benchmarking utility" ON) | ||
|
||
# TensorFlow dependency, see https://www.tensorflow.org/lite/guide/build_cmake | ||
set(TENSORFLOW_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/third_party/tensorflow/") | ||
set(TFLITE_SOURCE_DIR "${TENSORFLOW_SOURCE_DIR}/tensorflow/lite") | ||
add_subdirectory("${TFLITE_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/tensorflow-lite" EXCLUDE_FROM_ALL) | ||
|
||
# Generic compilation options and settings | ||
set(CMAKE_CXX_STANDARD 14) | ||
include_directories(${CMAKE_CURRENT_LIST_DIR}) | ||
|
||
# The LCE core files | ||
set(LCE_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/larq_compute_engine") | ||
set(LCE_CORE_SRCS | ||
${LCE_SOURCE_DIR}/tflite/kernels/bconv2d.cc | ||
${LCE_SOURCE_DIR}/tflite/kernels/bmaxpool.cc | ||
${LCE_SOURCE_DIR}/tflite/kernels/quantization.cc | ||
) | ||
set(LCE_CORE_HDRS # such that they can be discovered by IDEs such as CLion Visual Studio | ||
${LCE_SOURCE_DIR}/core/indirect_bgemm/kernel.h | ||
${LCE_SOURCE_DIR}/core/indirect_bgemm/kernel_4x2_portable.h | ||
${LCE_SOURCE_DIR}/core/indirect_bgemm/kernel_8x4x4_aarch64.h | ||
${LCE_SOURCE_DIR}/core/indirect_bgemm/kernel_8x4x1_aarch64.h | ||
${LCE_SOURCE_DIR}/core/indirect_bgemm/select_kernel.h | ||
${LCE_SOURCE_DIR}/core/indirect_bgemm/kernel_8x4x2_aarch64.h | ||
${LCE_SOURCE_DIR}/core/bmaxpool.h | ||
${LCE_SOURCE_DIR}/core/bitpacking/utils.h | ||
${LCE_SOURCE_DIR}/core/bitpacking/bitpack.h | ||
${LCE_SOURCE_DIR}/core/bitpacking/bitpack_aarch64.h | ||
${LCE_SOURCE_DIR}/core/types.h | ||
${LCE_SOURCE_DIR}/core/bconv2d/optimized_indirect_bgemm.h | ||
${LCE_SOURCE_DIR}/core/bconv2d/reference.h | ||
${LCE_SOURCE_DIR}/core/bconv2d/optimized_bgemm.h | ||
${LCE_SOURCE_DIR}/core/bconv2d/zero_padding_correction.h | ||
${LCE_SOURCE_DIR}/core/bconv2d/params.h | ||
${LCE_SOURCE_DIR}/core/bconv2d/output_transform.h | ||
${LCE_SOURCE_DIR}/core/bgemm/kernels_common.h | ||
${LCE_SOURCE_DIR}/core/bgemm/ruy_trmul_params.h | ||
${LCE_SOURCE_DIR}/core/bgemm/kernels_aarch64.h | ||
${LCE_SOURCE_DIR}/core/bgemm/kernels.h | ||
${LCE_SOURCE_DIR}/core/bgemm/ruy_pack.h | ||
${LCE_SOURCE_DIR}/core/bgemm/kernels_arm32.h | ||
${LCE_SOURCE_DIR}/core/bgemm/bgemm.h | ||
${LCE_SOURCE_DIR}/tflite/kernels/lce_ops_register.h | ||
${LCE_SOURCE_DIR}/tflite/kernels/utils.h | ||
) | ||
|
||
# The example application | ||
if(COMPILE_EXAMPLE) | ||
set(LCE_EXAMPLE_SRCS ${CMAKE_CURRENT_LIST_DIR}/examples/lce_minimal.cc) | ||
add_executable(example ${LCE_CORE_SRCS} ${LCE_CORE_HDRS} ${LCE_EXAMPLE_SRCS}) | ||
target_link_libraries(example tensorflow-lite) | ||
endif() | ||
|
||
# The benchmarking binary | ||
if(COMPILE_BENCHMARK) | ||
set(LCE_BENCHMARK_SRCS | ||
${LCE_SOURCE_DIR}/tflite/benchmark/lce_benchmark_tflite_model.cc | ||
${LCE_SOURCE_DIR}/tflite/benchmark/lce_benchmark_main.cc | ||
) | ||
set(LCE_BENCHMARK_HRDS | ||
${LCE_SOURCE_DIR}/tflite/benchmark/lce_benchmark_tflite_model.h | ||
${TFLITE_SOURCE_DIR}/tools/benchmark/benchmark_model.h | ||
) | ||
set(TFLITE_BENCHMARK_SRCS # from ${TFLITE_SOURCE_DIR}/tools/benchmark/CMakeLists.txt | ||
${TENSORFLOW_SOURCE_DIR}/tensorflow/core/util/stats_calculator.cc | ||
${TFLITE_SOURCE_DIR}/kernels/internal/utils/sparsity_format_converter.cc | ||
${TFLITE_SOURCE_DIR}/profiling/memory_info.cc | ||
${TFLITE_SOURCE_DIR}/profiling/memory_usage_monitor.cc | ||
${TFLITE_SOURCE_DIR}/profiling/profile_summarizer.cc | ||
${TFLITE_SOURCE_DIR}/profiling/profile_summary_formatter.cc | ||
${TFLITE_SOURCE_DIR}/profiling/time.cc | ||
${TFLITE_SOURCE_DIR}/tools/command_line_flags.cc | ||
${TFLITE_SOURCE_DIR}/tools/benchmark/benchmark_model.cc | ||
${TFLITE_SOURCE_DIR}/tools/benchmark/benchmark_performance_options.cc | ||
${TFLITE_SOURCE_DIR}/tools/benchmark/benchmark_tflite_model.cc | ||
${TFLITE_SOURCE_DIR}/tools/benchmark/benchmark_utils.cc | ||
${TFLITE_SOURCE_DIR}/tools/benchmark/profiling_listener.cc | ||
${TFLITE_SOURCE_DIR}/tools/delegates/default_execution_provider.cc | ||
${TFLITE_SOURCE_DIR}/tools/delegates/delegate_provider.cc | ||
${TFLITE_SOURCE_DIR}/tools/delegates/xnnpack_delegate_provider.cc | ||
${TFLITE_SOURCE_DIR}/tools/evaluation/utils.cc | ||
${TFLITE_SOURCE_DIR}/tools/tool_params.cc | ||
) | ||
add_executable(lce_benchmark_model | ||
${TFLITE_BENCHMARK_SRCS} | ||
${LCE_CORE_SRCS} ${LCE_CORE_HDRS} | ||
${LCE_BENCHMARK_SRCS} ${LCE_BENCHMARK_HRDS} | ||
) | ||
target_link_libraries(lce_benchmark_model tensorflow-lite) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.