Skip to content

Fix for various issues in the graph module #1635

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eleanorTurintech
Copy link

@eleanorTurintech eleanorTurintech commented Mar 10, 2025

The pr aims to fix some issues in the graph/ module. The details are as follows:

  • graph/search.cc: removed an unreachable branch.
  • graph/topo.cc: fixed an indexing issue when restarting the search.
  • graph/tuning.cc: fixed the memory leakage issues when returning early.
  • graph/xml.cc: fixed a bug when the xml value is wrapped in single quotes.

@@ -328,8 +328,7 @@ ncclResult_t ncclTopoReplayGetGpu(struct ncclTopoSystem* system, struct ncclTopo
*g = i;
return ncclSuccess;
}
if (*g == -1) return ncclInternalError;
return ncclSuccess;
return ncclInternalError;
Copy link
Author

@eleanorTurintech eleanorTurintech Mar 10, 2025

Choose a reason for hiding this comment

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

In the for-loop above, if a GPU with the specified rank is found, the function sets *g to the index of the GPU and return ncclSuccess. If the for-loop completes without returning, *g would remain as the initial value of -1, therefore the if-statement for checking *g value is redundant. It also means the final return statement will be unreachable.

The fix removes the redundant if-statement and return ncclInternalError directly.

do {
NCCLCHECK(xmlGetChar(file, &c));
value[o++] = c;
} while (c != '"');
} while (c != quote);
Copy link
Author

Choose a reason for hiding this comment

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

The fix allows the quote to be either " or ', and correctly matches the ending quote.

@eleanorTurintech eleanorTurintech changed the title fixed some bugs in the graph module Fix for various issues in the graph module Mar 10, 2025
@marksantesson
Copy link

Thanks, @eleanorTurintech ! I've upstreamed your change into what should be our next new release, v2.27.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants