Skip to content

Commit 88a5f60

Browse files
authored
Arm backend: Fix VGF neural statistics test PAL init and dangling test target (#22136)
Two fixes for the VGF neural statistics tests added in #22074. 1. `VgfNeuralStatisticsTest.RuntimeConfigFallsBackToMode1` aborted. The invalid-mode fallback path in `get_vgf_neural_statistics_runtime_config()` calls `ET_LOG`, which aborts with `ExecuTorch PAL must be initialized before call to et_pal_current_ticks()` when the runtime has not been initialized. Initialize the PAL in the test env fixture, the same way `backends/arm/test/vela_external_blocks_test.cpp` does. 2. `//executorch/devtools/inspector/tests:vgf_neural_statistics_test` failed to build. The `python_unittest` target points at `vgf_neural_statistics_test.py`, which was never added to the tree, so the target fails to build with `File not found: devtools/inspector/tests/vgf_neural_statistics_test.py`. Remove the dangling target. cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani
1 parent 6a36ebe commit 88a5f60

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

backends/arm/test/vgf_neural_statistics_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <vector>
1313

1414
#include <executorch/backends/arm/runtime/VGFNeuralStatistics.h>
15+
#include <executorch/runtime/platform/runtime.h>
1516

1617
namespace vgf = executorch::backends::vgf;
1718

@@ -32,6 +33,9 @@ void set_env(const char* name, const char* value) {
3233
class ScopedNeuralStatisticsEnv {
3334
public:
3435
ScopedNeuralStatisticsEnv() {
36+
// Reading the runtime config can ET_LOG, which aborts unless the PAL is up.
37+
executorch::runtime::runtime_init();
38+
3539
const char* enable = std::getenv(vgf::kVgfNeuralStatisticsEnableEnv);
3640
const char* mode = std::getenv(vgf::kVgfNeuralStatisticsModeEnv);
3741
if (enable != nullptr) {

devtools/inspector/tests/targets.bzl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ def define_common_targets(is_fbcode = False):
2727
],
2828
)
2929

30-
python_unittest(
31-
name = "vgf_neural_statistics_test",
32-
srcs = ["vgf_neural_statistics_test.py"],
33-
deps = [
34-
"//executorch/devtools/inspector:vgf_neural_statistics",
35-
],
36-
)
37-
3830
python_unittest(
3931
name = "event_blocks_test",
4032
srcs = ["event_blocks_test.py"],

0 commit comments

Comments
 (0)