Skip to content

Conversation

@suo
Copy link
Member

@suo suo commented Jul 8, 2022

Use the nightly-published test stats to perform sharding, instead of
calculating it in every build job.

[ghstack-poisoned]
@suo suo requested a review from a team as a code owner July 8, 2022 17:05
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jul 8, 2022

🔗 Helpful links

❌ 1 New Failures

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

Expand to see more
  • 1/1 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages

See GitHub Actions build pull / linux-focal-py3.7-gcc7 / test (backwards_compat, 1, 1, linux.2xlarge) (1/1)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2022-07-09T07:37:10.6204318Z The PR is introduc...m to confirm whether this change is wanted or not.
2022-07-09T07:37:10.6186977Z processing existing schema:  duration_ns(__torch__.torch.classes.profiling.InstructionStats _0) -> int _0
2022-07-09T07:37:10.6188753Z processing existing schema:  source(__torch__.torch.classes.profiling.SourceStats _0) -> __torch__.torch.classes.profiling.SourceRef _0
2022-07-09T07:37:10.6191175Z processing existing schema:  line_map(__torch__.torch.classes.profiling.SourceStats _0) -> Dict(int, __torch__.torch.classes.profiling.InstructionStats) _0
2022-07-09T07:37:10.6192506Z processing existing schema:  __init__(__torch__.torch.classes.profiling._ScriptProfile _0) -> NoneType _0
2022-07-09T07:37:10.6197018Z processing existing schema:  enable(__torch__.torch.classes.profiling._ScriptProfile _0) -> NoneType _0
2022-07-09T07:37:10.6197289Z processing existing schema:  disable(__torch__.torch.classes.profiling._ScriptProfile _0) -> NoneType _0
2022-07-09T07:37:10.6200090Z processing existing schema:  _dump_stats(__torch__.torch.classes.profiling._ScriptProfile _0) -> __torch__.torch.classes.profiling.SourceStats[] _0
2022-07-09T07:37:10.6200378Z processing existing schema:  __init__(__torch__.torch.classes.c10d.ProcessGroup _0, int _1, int _2) -> NoneType _0
2022-07-09T07:37:10.6201442Z processing existing schema:  __init__(__torch__.torch.classes.c10d.Work _0) -> NoneType _0
2022-07-09T07:37:10.6203879Z processing existing schema:  __init__(__torch__.torch.classes.dist_rpc.WorkerInfo _0, str _1, int _2) -> NoneType _0
2022-07-09T07:37:10.6204318Z The PR is introducing backward incompatible changes to the operator library. Please contact PyTorch team to confirm whether this change is wanted or not. 
2022-07-09T07:37:10.6204365Z 
2022-07-09T07:37:10.6204441Z Broken ops: [
2022-07-09T07:37:10.6204727Z 	__getstate__(__torch__.torch.classes.sparse.LinearPackedParamsBase _0) -> ((Tensor, Tensor?, int[]) _0)
2022-07-09T07:37:10.6205025Z 	__setstate__(__torch__.torch.classes.sparse.LinearPackedParamsBase _0, (Tensor, Tensor?, int[]) _1) -> NoneType _0
2022-07-09T07:37:10.6205087Z ]
2022-07-09T07:37:10.7424445Z ##[error]Process completed with exit code 1.
2022-07-09T07:37:10.7455086Z Prepare all required actions
2022-07-09T07:37:10.7455245Z Getting action download info
2022-07-09T07:37:10.8825065Z ##[group]Run ./.github/actions/get-workflow-job-id
2022-07-09T07:37:10.8825140Z with:

This comment was automatically generated by Dr. CI (expand for details).

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

Click here to manually regenerate this comment.

Use the nightly-published test stats to perform sharding, instead of
calculating it in every build job.

[ghstack-poisoned]
suo added a commit that referenced this pull request Jul 8, 2022
Use the nightly-published test stats to perform sharding, instead of
calculating it in every build job.

ghstack-source-id: 30694e6
Pull Request resolved: #81116
Use the nightly-published test stats to perform sharding, instead of
calculating it in every build job.

[ghstack-poisoned]
suo added a commit that referenced this pull request Jul 8, 2022
Use the nightly-published test stats to perform sharding, instead of
calculating it in every build job.

ghstack-source-id: 66742d5
Pull Request resolved: #81116
Use the nightly-published test stats to perform sharding, instead of
calculating it in every build job.

[ghstack-poisoned]
Use the nightly-published test stats to perform sharding, instead of
calculating it in every build job.

[ghstack-poisoned]
Use the nightly-published test stats to perform sharding, instead of
calculating it in every build job.

[ghstack-poisoned]
Use the nightly-published test stats to perform sharding, instead of
calculating it in every build job.

[ghstack-poisoned]
Use the nightly-published test stats to perform sharding, instead of
calculating it in every build job.

[ghstack-poisoned]
Copy link
Contributor

@janeyx99 janeyx99 left a comment

Choose a reason for hiding this comment

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

Code looks good, but could you verify that the same tests were run as before in the stats before landing?

Brief glance at the logs also looks good.

@suo suo added the ciflow/trunk Trigger trunk jobs on your pull request label Jul 11, 2022
@suo
Copy link
Member Author

suo commented Jul 12, 2022

image

num tests run looks fine

@malfet
Copy link
Contributor

malfet commented Jul 12, 2022

It should have been better documented, but the reason why test sharding is preserved at the build time, is to avoid a situation when test suite will only partially be run (or some tests would be run twice) as result of network flakiness

After you've removed this logic, its possible that some shards would build the schedule based on latest nightly stats, while others will use default ones (if S3 is unavailable for some reason)

To avoid that, either submit a follow-up fix, or restore the logic

facebook-github-bot pushed a commit that referenced this pull request Jul 12, 2022
Summary:
Use the nightly-published test stats to perform sharding, instead of
calculating it in every build job.

Pull Request resolved: #81116
Approved by: https://github.com/janeyx99

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/9f58d5d7ce7d2779f08b8fa8cbbb52ba1bf153af

Reviewed By: DanilBaibak

Differential Revision: D37782040

Pulled By: suo

fbshipit-source-id: b50e2efe8f26fbc05361d815625921571d2ae5d3
@suo
Copy link
Member Author

suo commented Jul 12, 2022 via email

@facebook-github-bot facebook-github-bot deleted the gh/suo/585/head branch July 15, 2022 14:18
pytorchmergebot pushed a commit that referenced this pull request Jul 28, 2022
After #81116, we started pulling test times straight from the source instead of first downloading them in the build job and then having the test job take the build jobs version.  This can cause an issues where different shards pull different versions of the file, leading to incorrect sharding (ex two shards running the same tests file on accident).  This generally happens if the test jobs happen while the test times file is being updated (unlikely, but not impossible) or if someone reruns a test job the next day.

In this PR, I return to the old method of downloading the test times file during the build job and having the test jobs pull from the build jobs uploaded artifacts.  If there is no test times file in the build job's artifacts, we fall back to the default sharding plan.

Notes:
* script moved to a new file to avoid needing to import torch, which would require torch to be built, which can cause issues with asan
* I got errors with asan (`ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.`), so I put the script at the beginning of the build

### Test Plan
Verified that the number of tests ran in the pull and trunk workflows are similar to workflows run on master.  Checked logs to see if artifacts were being used for sharding.  Spot checked a few test configs to check that their lists of selected tests didn't overlap.
Pull Request resolved: #81915
Approved by: https://github.com/huydhn
pytorchmergebot pushed a commit that referenced this pull request Jul 28, 2022
After #81116, we started pulling test times straight from the source instead of first downloading them in the build job and then having the test job take the build jobs version.  This can cause an issues where different shards pull different versions of the file, leading to incorrect sharding (ex two shards running the same tests file on accident).  This generally happens if the test jobs happen while the test times file is being updated (unlikely, but not impossible) or if someone reruns a test job the next day.

In this PR, I return to the old method of downloading the test times file during the build job and having the test jobs pull from the build jobs uploaded artifacts.  If there is no test times file in the build job's artifacts, we fall back to the default sharding plan.

Notes:
* script moved to a new file to avoid needing to import torch, which would require torch to be built, which can cause issues with asan
* I got errors with asan (`ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.`), so I put the script at the beginning of the build

### Test Plan
Verified that the number of tests ran in the pull and trunk workflows are similar to workflows run on master.  Checked logs to see if artifacts were being used for sharding.  Spot checked a few test configs to check that their lists of selected tests didn't overlap.
Pull Request resolved: #81915
Approved by: https://github.com/huydhn
facebook-github-bot pushed a commit that referenced this pull request Jul 29, 2022
…81915)

Summary:
After #81116, we started pulling test times straight from the source instead of first downloading them in the build job and then having the test job take the build jobs version.  This can cause an issues where different shards pull different versions of the file, leading to incorrect sharding (ex two shards running the same tests file on accident).  This generally happens if the test jobs happen while the test times file is being updated (unlikely, but not impossible) or if someone reruns a test job the next day.

In this PR, I return to the old method of downloading the test times file during the build job and having the test jobs pull from the build jobs uploaded artifacts.  If there is no test times file in the build job's artifacts, we fall back to the default sharding plan.

Notes:
* script moved to a new file to avoid needing to import torch, which would require torch to be built, which can cause issues with asan
* I got errors with asan (`ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.`), so I put the script at the beginning of the build

### Test Plan
Verified that the number of tests ran in the pull and trunk workflows are similar to workflows run on master.  Checked logs to see if artifacts were being used for sharding.  Spot checked a few test configs to check that their lists of selected tests didn't overlap.

Pull Request resolved: #81915
Approved by: https://github.com/huydhn

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/86f038dd56dab9ecec5893b60efc74e46ca19e36

Reviewed By: osalpekar

Differential Revision: D38252585

Pulled By: clee2000

fbshipit-source-id: 912b5fa0977647a79785e24613355ff0879bcacf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request cla signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants