Skip to content

[optests] Changed failures_dict format to json; automatic update of failures_dict#109110

Closed
zou3519 wants to merge 1 commit intopytorch:mainfrom
zou3519:export-D49167181
Closed

[optests] Changed failures_dict format to json; automatic update of failures_dict#109110
zou3519 wants to merge 1 commit intopytorch:mainfrom
zou3519:export-D49167181

Conversation

@zou3519
Copy link
Copy Markdown
Contributor

@zou3519 zou3519 commented Sep 12, 2023

We changed the failures_dict format from .py to json and added a way to
automatically update the failures dict (the user can set
PYTORCH_OPCHECK_ACCEPT=1 to do so), assuming the tests don't crash in the
process.

Some details:

  • We introduced a FailuresDict class that handles save/load and from which one
    can query a test status ("xfail", "skip", etc).
  • PYTORCH_OPCHECK_ACCEPT=1 does not override everything. In particular: it
    doesn't try to update the failures dict for a test marked as "skip", but it
    will update it for tests marked as "xfail" or "success".
  • PYTORCH_OPCHECK_ACCEPT=1 also does not override the "comment" field, unless
    it is flipping an "xfail" into "success".
  • I'll update the gdoc linked in the comments with how to actually use
    PYTORCH_OPCHECK_ACCEPT=1 internally (it's not trivial).

Note that this isn't multithreading-safe, the current recommendation is to run
the tests sequentially if the user wants to use PYTORCH_OPCHECK_ACCEPT=1.

Differential Revision: D49167181

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Sep 12, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/109110

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (2 Unrelated Failures)

As of commit 231ae83 with merge base a46df6e (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

UNSTABLE - The following job failed but was likely due to flakiness present on trunk and has been marked as unstable:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D49167181

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D49167181

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D49167181

@zou3519 zou3519 added the topic: not user facing topic category label Sep 12, 2023
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D49167181

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D49167181

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D49167181

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D49167181

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.

would be nice to do the trailing newline correctly

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.

yup

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.

what's this helper function 🤔

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.

Something about internal fbcode having different codepaths to the resource :/

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.

type annotations would be nice

Copy link
Copy Markdown
Contributor Author

@zou3519 zou3519 Sep 13, 2023

Choose a reason for hiding this comment

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

sgtm (will probably save for a follow-up, I need to type the entire file, not just these changes)

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.

interesting...

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 guess this feels less bad when you realize this is "expect success", as opposed to "yolo it succeeded"

Copy link
Copy Markdown
Contributor Author

@zou3519 zou3519 Sep 13, 2023

Choose a reason for hiding this comment

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

My mental model is that we're talking about the status of the test:

  • "skip" means we should skip the test
  • "xfail" means we expect the test to fail
  • "success" means we expect the test to succeed.

I could rename this "xsuccess" if we want for consistency (do you have other thoughts?) Though I'll probably land this first to avoid merge conflicts (changing "success" to something else isn't difficult, because this doesn't actually show up in the failure dict unless the user manually puts it in)

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.

lol

@ezyang
Copy link
Copy Markdown
Contributor

ezyang commented Sep 13, 2023

properly reviewed now 👍

@zou3519
Copy link
Copy Markdown
Contributor Author

zou3519 commented Sep 13, 2023

Thanks Ed. I need to rebase this anyways because the internal tests are complaining, so, will incorporate your comments

…ailures_dict (pytorch#109110)

Summary:

We changed the failures_dict format from .py to json and added a way to
automatically update the failures dict (the user can set
PYTORCH_OPCHECK_ACCEPT=1 to do so), assuming the tests don't crash in the
process.

Some details:
- We introduced a FailuresDict class that handles save/load and from which one
  can query a test status ("xfail", "skip", etc).
- PYTORCH_OPCHECK_ACCEPT=1 does not override everything. In particular: it
  doesn't try to update the failures dict for a test marked as "skip", but it
  will update it for tests marked as "xfail" or "success".
- PYTORCH_OPCHECK_ACCEPT=1 also does not override the "comment" field, unless
  it is flipping an "xfail" into "success".
- I'll update the gdoc linked in the comments with how to actually use
  `PYTORCH_OPCHECK_ACCEPT=1` internally (it's not trivial).

Note that this isn't multithreading-safe, the current recommendation is to run
the tests sequentially if the user wants to use PYTORCH_OPCHECK_ACCEPT=1.

bypass-github-export-checks

Test Plan: Existing tests

Reviewed By: ezyang

Differential Revision: D49167181
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D49167181

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@pytorchbot merge -f 'Landed internally'

(Initiating merge automatically since Phabricator Diff has merged, using force because this PR might not pass merge_rules.json but landed internally)

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

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.

4 participants