Skip to content

Conversation

kshitij12345
Copy link
Collaborator

Fixes #54152

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Mar 17, 2021

💊 CI failures summary and remediations

As of commit 1f93c0c (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

@kshitij12345 kshitij12345 force-pushed the testing/scipy-opinfo-test branch from 2ad092a to b85827f Compare March 17, 2021 17:35
@codecov
Copy link

codecov bot commented Mar 19, 2021

Codecov Report

Merging #54186 (f27d9eb) into master (0d81528) will increase coverage by 36.33%.
The diff coverage is 86.66%.

❗ Current head f27d9eb differs from pull request most recent head 1f93c0c. Consider uploading reports for the commit 1f93c0c to get more accurate results

@@             Coverage Diff             @@
##           master   #54186       +/-   ##
===========================================
+ Coverage   40.93%   77.27%   +36.33%     
===========================================
  Files           3     1891     +1888     
  Lines         149   185544   +185395     
===========================================
+ Hits           61   143374   +143313     
- Misses         88    42170    +42082     

@kshitij12345 kshitij12345 marked this pull request as ready for review March 19, 2021 10:57
@kshitij12345 kshitij12345 requested a review from mruberry March 19, 2021 10:57
if TEST_SCIPY:
import scipy

reference_filtered_ops = list(filter(lambda op: op.ref is not _NOTHING, unary_ufuncs))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a comment explaining this filter

return samples


def scipy_reference_wrapper(ref):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Clarify how and when to use this.

"If you're using a SciPy op as a reference, then pass it wrapped in a lambda to this function, which will either return the lambda or, if SciPy is unavailable, _NOTHING. Wrapping the operation in a lambda will prevent the Python interpreter from attempting to discover the operation, which will fail if SciPy is unavailable. See the OpInfo for digamma for an example."

assert_autodiffed=True,
test_complex_grad=False), # Reference: https://github.com/pytorch/pytorch/issues/48552
UnaryUfuncInfo('digamma',
ref=scipy_reference_wrapper(lambda x: scipy.special.digamma(x)),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This lambda is perfect, but if this PR does want to cite it as an example then:

lambda *args, **kwargs: scipy.special.digamma(*args, **kwargs)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Have only updated the lambda for digamma (being the example).
Have kept other lambda's more closer to their original signature

# In some cases, output is NaN (for input close to
# negative integers) especially due to reduced precision
# in float16 and NaN's can't be tested for equality.
SkipInfo('TestCommon', 'test_variant_consistency_jit',
Copy link
Collaborator

Choose a reason for hiding this comment

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

This skip is not needed but a new skip may be

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Have pulled the latest master and just update the ref arguments with wrapped. Kept the other stuff as is in the master.

@mruberry mruberry self-requested a review March 22, 2021 17:12
Copy link
Collaborator

@mruberry mruberry left a comment

Choose a reason for hiding this comment

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

Nice work, @kshitij12345. I made a few suggestions. The biggest thing is that this PR will need a rebase to account for the latest OpInfo changes. Once that happens I'll prioritize its landing since it's a larger PR.

@kshitij12345
Copy link
Collaborator Author

Have mostly addressed the reviews. Hopefully should be good to go. PTAL :)

@facebook-github-bot
Copy link
Contributor

@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@mruberry merged this pull request in c371542.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

erf and erfc tests in test_ops.py sometimes don't exist

4 participants