Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[onert] Remove HDF5 minmax dumper #13787

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion infra/nnfw/cmake/CfgOptionFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ option(BUILD_WITH_HDF5 "Build test tool with HDF5 library" ON)
option(GENERATE_RUNTIME_NNAPI_TESTS "Generate NNAPI operation gtest" ON)
option(ENVVAR_ONERT_CONFIG "Use environment variable for onert configuration" ON)
option(INSTALL_TEST_SCRIPTS "Install test scripts" ON)
option(BUILD_MINMAX_H5DUMPER "Build minmax h5dumper" OFF)
#
# Default build configuration for contrib
#
Expand Down
13 changes: 0 additions & 13 deletions runtime/onert/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ file(GLOB_RECURSE SOURCES "src/*.cc")
file(GLOB_RECURSE TESTS "*.test.cc")
list(REMOVE_ITEM SOURCES ${TESTS})

if(NOT BUILD_MINMAX_H5DUMPER)
file(GLOB_RECURSE SRC_TO_REMOVE "src/dumper/h5/*.cc")
list(REMOVE_ITEM SOURCES ${SRC_TO_REMOVE})
endif(NOT BUILD_MINMAX_H5DUMPER)

add_library(onert_core SHARED ${SOURCES})
set_target_properties(onert_core PROPERTIES POSITION_INDEPENDENT_CODE ON)

Expand All @@ -32,14 +27,6 @@ nnfw_find_package(Ruy REQUIRED)
target_link_libraries(onert_core PRIVATE ruy)
target_link_libraries(onert_core INTERFACE ruy_instrumentation)

# H5 Minmax Dumper
if(BUILD_MINMAX_H5DUMPER)
nnfw_find_package(HDF5 REQUIRED)
target_compile_definitions(onert_core PRIVATE MINMAX_H5DUMPER=1)
target_include_directories(onert_core PRIVATE ${HDF5_INCLUDE_DIRS})
target_link_libraries(onert_core PRIVATE ${HDF5_CXX_LIBRARIES})
endif(BUILD_MINMAX_H5DUMPER)

# NOTE Below line is added to remove warning for android build
# It will be removed after android build uses gold linker
if (ANDROID)
Expand Down
2 changes: 1 addition & 1 deletion runtime/onert/core/src/compiler/ExecutorFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ exec::IExecutor *ExecutorFactory::createTrainableExecutor(
exec->addObserver(
std::make_unique<exec::TracingObserver>(options->workspace_dir, exec->graph(), tracing_ctx));
}
// TODO Support MINMAX_H5DUMPER
// TODO Support MINMAX_DUMPER

return exec;
}
Expand Down
34 changes: 0 additions & 34 deletions runtime/onert/core/src/dumper/h5/Dumper.cc

This file was deleted.

51 changes: 0 additions & 51 deletions runtime/onert/core/src/dumper/h5/Dumper.h

This file was deleted.

87 changes: 0 additions & 87 deletions runtime/onert/core/src/dumper/h5/MinMaxDumper.cc

This file was deleted.

78 changes: 0 additions & 78 deletions runtime/onert/core/src/dumper/h5/MinMaxDumper.h

This file was deleted.

9 changes: 0 additions & 9 deletions runtime/onert/core/src/exec/MinMaxRecorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
*/

#include "MinMaxRecorder.h"
#if MINMAX_H5DUMPER
#include "../dumper/h5/MinMaxDumper.h"
#else
#include "MinMaxData.h"
#endif
#include "backend/ITensor.h"

#include <cassert>
Expand Down Expand Up @@ -148,13 +144,8 @@ void MinMaxRecorder::handleSubgraphEnd(ir::SubgraphIndex)
{
// It would be better to dump at the end of model execution, not subgraph
// But it requires more changes than subgraph.
#if MINMAX_H5DUMPER
auto h5dumper = dumper::h5::MinMaxDumper(_workspace_dir + "/minmax.h5");
h5dumper.dump(_input_minmax, _op_minmax);
#else
auto raw_dumper = RawMinMaxDumper(_workspace_dir + "/minmax.bin");
raw_dumper.dump(_input_minmax, _op_minmax);
#endif
}

} // namespace exec
Expand Down