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

[ROCM] fix 'Invalid plugin kind specified: DNN' error #5

Closed
wants to merge 1 commit into from
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
24 changes: 13 additions & 11 deletions xla/stream_executor/plugin_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,19 @@ absl::Status PluginRegistry::RegisterFactoryInternal(
bool PluginRegistry::HasFactory(Platform::Id platform_id,
PluginKind plugin_kind) const {
auto iter = factories_.find(platform_id);
if (iter != factories_.end()) {
switch (plugin_kind) {
case PluginKind::kBlas:
return iter->second.blas.has_value();
case PluginKind::kDnn:
return iter->second.dnn.has_value();
case PluginKind::kFft:
return iter->second.fft.has_value();
default:
break;
}
if (iter == factories_.end()) {
return false;
}

switch (plugin_kind) {
case PluginKind::kBlas:
return iter->second.blas.has_value();
case PluginKind::kDnn:
return iter->second.dnn.has_value();
case PluginKind::kFft:
return iter->second.fft.has_value();
default:
break;
}

LOG(ERROR) << "Invalid plugin kind specified: "
Copy link

Choose a reason for hiding this comment

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

So this was being hit when the iterator was returning as ended/stopped, and now we are handling that case specifically at line 78, therefore stopping the erroneous error message.

Is that correct?

Copy link
Author

Choose a reason for hiding this comment

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

yeah, the current code doesn't check whether factories_ is empty and falls back to "invalid plugin error" anyways.

Expand Down
Loading