Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ struct PluginEpMetaDefNameFunctor {
const std::string& prefix)
: generator_(generator), graph_viewer_(graph_viewer), prefix_(prefix) {}

std::string operator()() {
std::string operator()() const {
uint64_t model_hash = 0;
int id = generator_.GenerateId(graph_viewer_, model_hash);
return MakeString(prefix_, "_", model_hash, "_", id);
return MakeString(prefix_, "_", graph_viewer_.Name(), "_", model_hash, "_", id);
Copy link
Contributor

@adrianlizarraga adrianlizarraga Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, could this be fixed by making the ModelMetadefIdGenerator local variable that is currently declared in PluginExecutionProvider::GetCapability() into a member of PluginExecutionProvider? I suspect that this would properly make every call to generator_.GenerateId() return a monotonically increasing number. It would also prevent redundant regenerations of the model_hash as a nice bonus.

I can try to experiment on my side.

Aside: for a future release of ORT, perhaps we can allow EPs to provide a custom metadef name via OrtNodeFusionOptions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I'm worried about two things with this approach:

  • Two different subgraphs (e.g., branches of an If node) may have the same name. This approach would still lead to duplicate metadef names.
  • External tools may be depending on the current format of this metadef name.

}

const ModelMetadefIdGenerator& generator_;
Expand Down
Loading