-
Notifications
You must be signed in to change notification settings - Fork 433
adapt to transfer async #1097
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
base: main
Are you sure you want to change the base?
adapt to transfer async #1097
Conversation
Summary of ChangesHello @ascend-direct-dev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request successfully adapts the AscendDirectTransport to use asynchronous transfers by introducing a queryThread for polling completion status. The overall approach is solid, replacing synchronous calls with asynchronous ones and correctly managing the new thread's lifecycle. I have a couple of suggestions to enhance clarity and consistency in timeout handling and timestamping.
| LOG(INFO) << "Set transfer timeout to:" << transfer_timeout_; | ||
| } | ||
| } | ||
| transfer_timeout_ = transfer_timeout_ * 1000000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This conversion to nanoseconds is correct for the timeout logic. However, the corresponding log message for transfer_timeout_ at line 200 is emitted before this conversion, showing the value in what seems to be milliseconds. This could be misleading for users debugging timeout issues. It would be clearer to log the timeout value after this conversion, and to include the units (e.g., 'ns') in the log message to avoid confusion.
| for (auto &slice : slice_list) { | ||
| slice->ascend_direct.start_time = getCurrentTimeInNano(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, it's better to capture the start time once before the loop and assign the same value to all slices in the batch. The current implementation gives each slice a slightly different start time, while the timeout logic in queryThread only considers the start time of the first slice (slice_list[0]). Using a single timestamp for the whole batch will make the timeout calculation more accurate.
You could change it to something like this:
auto start_time = getCurrentTimeInNano();
for (auto &slice : slice_list) {
slice->ascend_direct.start_time = start_time;
}b53279f to
9c0c8c8
Compare
Description
Type of Change
How Has This Been Tested?
Checklist