Skip to content
Open
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
10 changes: 9 additions & 1 deletion backends/xnnpack/runtime/XNNCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1916,9 +1916,17 @@ ET_NODISCARD Error XNNCompiler::compileModel(
xnn_status_to_string(status));

// create xnnpack subgraph
uint32_t num_externs = flatbuffer_graph->num_externs();
ET_CHECK_OR_RETURN_ERROR(
num_externs <= 4096,
InvalidProgram,
"XNNPACK flatbuffer blob has num_externs (%u) which exceeds maximum (4096)."
" This likely indicates a corrupted or invalid serialized graph",
Comment on lines +1920 to +1924
num_externs);
Comment on lines +1923 to +1925

xnn_subgraph_t subgraph_ptr = nullptr;
status = xnn_create_subgraph(
/*external_value_ids=*/flatbuffer_graph->num_externs(),
/*external_value_ids=*/num_externs,
/*flags=*/0,
&subgraph_ptr);
ET_CHECK_OR_RETURN_ERROR(
Expand Down
Loading