Skip to content

Expand coverage reporting to ndarray methods - #219

Merged
bryevdv merged 2 commits into
nv-legate:branch-22.03from
bryevdv:bryanv/ndarray_coverage
Mar 22, 2022
Merged

Expand coverage reporting to ndarray methods#219
bryevdv merged 2 commits into
nv-legate:branch-22.03from
bryevdv:bryanv/ndarray_coverage

Conversation

@bryevdv

@bryevdv bryevdv commented Mar 17, 2022

Copy link
Copy Markdown
Contributor

This PR cleans up and generalizes the existing code for reporting implemented vs unimplemented Numpy API. The updated reporting code is extended to also cover cunumeric.ndarray.

Example output

For the invocation

 LEGATE_TEST=1 legate tests/dot.py --gpus 2 -cunumeric:test -cunumeric:report:coverage  -cunumeric:report:dump-csv /tmp/dot.csv

The coverage summary is

cuNumeric API coverage: 26/26 (100.0%)

with CSV:

numpy.array,tests/dot.py:27,True
numpy.ndarray.__init__,tests/dot.py:27,True
numpy.array,tests/dot.py:28,True
numpy.ndarray.__init__,tests/dot.py:28,True
numpy.ndarray.dot,tests/dot.py:31,True
numpy.ndarray.__init__,tests/dot.py:31,True
numpy.allclose,tests/dot.py:33,True
numpy.ndarray.__init__,tests/dot.py:33,True
numpy.ndarray._maybe_convert,tests/dot.py:33,True
numpy.ndarray._maybe_convert,tests/dot.py:33,True
numpy.ndarray.__init__,tests/dot.py:33,True
numpy.ndarray.__bool__,tests/dot.py:33,True
numpy.ndarray.__array__,tests/dot.py:33,True
numpy.array,tests/dot.py:27,True
numpy.ndarray.__init__,tests/dot.py:27,True
numpy.array,tests/dot.py:28,True
numpy.ndarray.__init__,tests/dot.py:28,True
numpy.ndarray.dot,tests/dot.py:31,True
numpy.ndarray.__init__,tests/dot.py:31,True
numpy.allclose,tests/dot.py:33,True
numpy.ndarray.__init__,tests/dot.py:33,True
numpy.ndarray._maybe_convert,tests/dot.py:33,True
numpy.ndarray._maybe_convert,tests/dot.py:33,True
numpy.ndarray.__init__,tests/dot.py:33,True
numpy.ndarray.__bool__,tests/dot.py:33,True
numpy.ndarray.__array__,tests/dot.py:33,True

@bryevdv
bryevdv requested a review from magnatelee March 17, 2022 22:05
Comment thread cunumeric/coverage.py
"__array_struct__",
"__array_ufunc__",
"__array_wrap__",
}

@bryevdv bryevdv Mar 17, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Without excluding these, there are errors doing conversions for things like calling np.array_equal. I noticed these methods are not present on cunumeric.ndarray before this PR, so I omitted them, and that happened to fix the issues I was seeing. But not sure if this list is comprehensive.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I saw a similar behavior noted in the comment of the initial attempt to add __array_interface__ to cunumeric.ndarray. Unless there's an evidence that this lis is incomplete, I'm fine with keeping this edit.

@bryevdv bryevdv mentioned this pull request Mar 20, 2022
Comment thread cunumeric/coverage.py
"__array_struct__",
"__array_ufunc__",
"__array_wrap__",
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I saw a similar behavior noted in the comment of the initial attempt to add __array_interface__ to cunumeric.ndarray. Unless there's an evidence that this lis is incomplete, I'm fine with keeping this edit.

@magnatelee

Copy link
Copy Markdown
Contributor

LGTM. @bryevdv feel free to merge this.

@bryevdv
bryevdv merged commit f75ff01 into nv-legate:branch-22.03 Mar 22, 2022
@bryevdv
bryevdv deleted the bryanv/ndarray_coverage branch March 22, 2022 19:37
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