Pyxrt: modernize to make hw_context first-class#9671
Merged
chvamshi-xilinx merged 4 commits intoXilinx:masterfrom Mar 23, 2026
Merged
Pyxrt: modernize to make hw_context first-class#9671chvamshi-xilinx merged 4 commits intoXilinx:masterfrom
chvamshi-xilinx merged 4 commits intoXilinx:masterfrom
Conversation
Signed-off-by: thomthehound <thomthehound@gmail.com>
|
@thomthehound is not a repository collaborator. To proceed:
|
chvamshi-xilinx
approved these changes
Mar 16, 2026
Collaborator
|
@thomthehound , Please resolve the conflicts. |
Contributor
Author
Done. Thank you for your time. |
Signed-off-by: thomthehound <thomthehound@gmail.com>
chvamshi-xilinx
approved these changes
Mar 23, 2026
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:
pyxrthas lagged far behind the ongoing modernization of the codebase. This patch updates it to preferhw_contextand fleshes-out implementation of that path. A compatibility shim for downstream callers still usingdevice.load_xclbin(...)is introduced with a run-time deprecation warning.Bug / issue and how it was discovered:
Compile-time deprecation warnings for
load_xclbinwere introduced by #9651 and a breakage in Windows was discovered while testing #9623. The warnings were suppressed without corrective action in #9669. Those are all distal issues.The issue at hand is that the underlying API-gap has not been addressed and
pyxrtis still on a dying code path. (Incidentally, issue #9557 is also functionally addressed by this fix).How the problem was solved, alternative solutions (if any) and why they were rejected:
The primary
pyxrtpath was moved tohw_context:hw_contextconstructors for xclbin objects and xclbin pathshw_context::access_mode,cfg_param_type,add_config(), and related accessorsbo(hw_context, ...)bindingspyxrt.pyiand binding docstrings to match the modern codebaseFor compatibility,
device.load_xclbin(...)is retained via C-binding shim. The shim is intentionally cordoned off so it can be removed later. It retains existing functionality.Rejected alternatives:
continue suppressing the deprecation warnings without change
Rejected because this hides the problem, makes it more difficult to fix in the future, and leaves the Python bindings obsolete.
remove
device.load_xclbin(...)from Python entirelyRejected due to possibility of unforeseen consequences.
Risks (if any) associated with the changes in the commit:
Python.
What has been tested and how, additional testing if necessary:
Tested locally on Windows with a custom test harness (available upon request) and an
mlir-aie-generated xclbin.pyxrt, even without the warning suppression from Build fix on windows after https://github.com/Xilinx/XRT/pull/9651 merge #9669.hw_contextcan be constructed from both xclbin objects and xclbin pathshw_contexthw_contextworks with a kernel-derived memory groupOn the signed Windows runtime used for testing, the deprecated
load_xclbincompatibility shim can be exercised but terminates with the expected failure atload_axlf. That is a 'success' in this case, but cannot be counted as fully "end-to-end".Updates to the following tests should be scheduled (and can be committed upon request):
Documentation impact (if any)
Docstrings and comments in
pyxrt.pyiwere cleaned up, docstrings concerninghw_contextwere added, and deprecation ofload_xclbin(...)was made clear in the code.Pyxrtitself still lacks documentation (#9581).