Add basic cunumeric.patch module#225
Merged
bryevdv merged 1 commit intonv-legate:branch-22.03from Mar 22, 2022
bryevdv:bryanv/patch
Merged
Add basic cunumeric.patch module#225bryevdv merged 1 commit intonv-legate:branch-22.03from bryevdv:bryanv/patch
bryevdv merged 1 commit intonv-legate:branch-22.03from
bryevdv:bryanv/patch
Conversation
Contributor
|
LGTM. Feel free to merge this. (I believe the failures have nothing to do with this PR.) |
magnatelee
approved these changes
Mar 22, 2022
ipdemes
pushed a commit
to ipdemes/cunumeric
that referenced
this pull request
Jun 7, 2022
updates: - [github.com/pre-commit/mirrors-clang-format: v14.0.1 → v14.0.3](pre-commit/mirrors-clang-format@v14.0.1...v14.0.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
manopapad
pushed a commit
that referenced
this pull request
Nov 17, 2024
* fix compilation errors with cuda_help.h * cuda_help.h: wrap check_* in namespace cunumeric * fix cuda_help: add cunumeric:: in the macro --------- Co-authored-by: Wonchan Lee <wonchanl@nvidia.com>
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.
This PR adds a very basic
cunumeric.patchmodule that can be imported early in a script to "automatically" replace NumPy with cuNumeric. With the following example script:The desired coverage results are generated:
Notes
This is not yet quite "zero-change", but is a necessary start, and can be utilized immediately, with one line of code added. Assuming a
-moption is implemented in legion in the future, the it should become possible to updatecunumericpatch with a "main" that affords this usage via the command line:without making any source changes at all.
True "zero-change" would require changes to
legatebut there would be questions to answer about having to makelegateknow aboutcunumeric.The patching is very simple-minded, and may have edge-cases or shortcomings. E.g. I had hoped to be able to warn loudly in case numpy was already imported, but cunumeric itself imports numpy, so that is not feasible. We cannot rely on the presence or absence of
numpyinsys.modulesto condition a warning. I would recommend not widely promoting this module, and keeping it intended as a tool for experienced dev-rel for this reason.