Conditionally abort in xrt::run dtor and xrt::run::set_arg#9649
Merged
stsoe merged 1 commit intoXilinx:masterfrom Mar 6, 2026
Merged
Conditionally abort in xrt::run dtor and xrt::run::set_arg#9649stsoe merged 1 commit intoXilinx:masterfrom
stsoe merged 1 commit intoXilinx:masterfrom
Conversation
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Collaborator
|
should we also disable run.set_arg() ? |
Collaborator
Author
Can't easily do, since we have Alveo mailbox support where set_arg is used on active run objects. |
wendyliang25
approved these changes
Mar 6, 2026
Issue warning in xrt::run::~run() if an xrt::run object is active. Abort in dtor if and only if there are no active exceptions. Also, throw in set_arg in elf flow. The change helps prevent applications from failing to call xrt::run::wait() before destructing a run object. Considered dynamically checking if the run is complete before message and call to abort. But this could result in a situation where application sometimes succeeds and sometimes fails depending on timing. While the current XRT execution model requires applications to call run.wait() for every run.start(), execution pipeline probably shouldn't enforce this if runs have been synchronized with fences. A final wait() is still required before destructing a run object. The final wait() ensures deterministic behavior. xrt::run::set_arg throws exception in ELF flow (when module is present). It cannot throw in general as there are flows (mailbox) that allow calling set_arg on a active run object. Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com>
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
larry9523
approved these changes
Mar 6, 2026
maxzhen
approved these changes
Mar 6, 2026
Collaborator
|
tested with the LLM flow which missing wait for some runs : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem solved by the commit
Issue warning in xrt::run::~run() if an xrt::run object is active. Abort in dtor if and only if there are no active exceptions. Also, throw in set_arg in elf flow if a run object is active.
Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
The change helps prevent applications from failing to call xrt::run::wait() before destructing a run object.
How problem was solved, alternative solutions (if any) and why they were rejected
Considered dynamically checking if the run is complete before message and call to abort. But this could result in a situation where application sometimes succeeds and sometimes fails depending on timing.
While the current XRT execution model requires applications to call run.wait() for every run.start(), execution pipeline probably shouldn't enforce this if runs have been synchronized with fences. A final wait() is still required before destructing a run object. The final wait() ensures deterministic behavior.