Skip to content

Investigate slow build_tf_integrations #10237

Closed

Activity

  1. added
    infrastructure
    on Aug 29, 2022
  2. self-assigned this
    on Aug 29, 2022
  3. moved this to In Progress in IREEon Aug 29, 2022
  4. GMNGeoffrey commented on Aug 30, 2022

    @GMNGeoffrey
    MemberAuthor

    Much fiddling with the GitHub api and jq later, I've identified that there was a dramatic slowdown with an update to TF/LLVM/MHLO in #10180

  5. GMNGeoffrey commented on Aug 30, 2022

    @GMNGeoffrey
    MemberAuthor

    Here's the full set of results. This is the latency in seconds of each build_tf_integrations job that completed successfully: https://gist.github.com/GMNGeoffrey/5df808b5fabcc38a15d3b5e31cb5985a

    Format is run_number commit_hash latency. So unsurprisingly we see a big bump after each LLVM integrate, but it usually recovers on the next commit. That's consistent with invalidating a big chunk of the cache and having to rebuild, but then having high cache hit rates for subsequent runs (which is what I see from spot-checking the logs). This time, it never recovered :-(

  6. GMNGeoffrey commented on Aug 30, 2022

    @GMNGeoffrey
    MemberAuthor
  7. GMNGeoffrey commented on Aug 30, 2022

    @GMNGeoffrey
    MemberAuthor

    It's something deeper than just making things more likely to change commit to commit though. 63d4693 took forever to run this. There's no reasonable reason for that to invalidate any caching of TF deps.

  8. GMNGeoffrey commented on Aug 30, 2022

    @GMNGeoffrey
    MemberAuthor

    Ah I see these warnings in the logs:

    WARNING: /home/runner/.cache/bazel/_bazel_runner/08e7c041e5c88d3a6ab680b92ad23ca3/external/org_tensorflow/tensorflow/core/common_runtime/BUILD:891:11: in hdrs attribute of cc_library rule @org_tensorflow//tensorflow/core/common_runtime:graph_constructor: Artifact 'external/org_tensorflow/tensorflow/core/common_runtime/shape_refiner.h' is duplicated (through '@org_tensorflow//tensorflow/core/common_runtime:core_cpu_lib_headers' and '@org_tensorflow//tensorflow/core/common_runtime:shape_refiner.h')

    Now that seems like the sort of thing that would cause problems. Of course it isn't easy to spot because of all the warning spew. I think that means that the above MHLO commit is not the culprit

  9. GMNGeoffrey commented on Aug 30, 2022

    @GMNGeoffrey
    MemberAuthor

    No, that's in the not-slow logs too :-(

  10. GMNGeoffrey commented on Aug 30, 2022

    @GMNGeoffrey
    MemberAuthor

    Diffed the warnings between a slow and fast run and they're all the same. I return to being confused

  11. GMNGeoffrey commented on Aug 30, 2022

    @GMNGeoffrey
    MemberAuthor

    I reverted IREE back to the state before that commit and confirmed that the TF build takes a reasonable amount of time (6 minutes) and is all cache hits: https://github.com/iree-org/iree/runs/8102048102

    INFO: 15717 processes: 11804 remote cache hit, 3912 internal, 1 processwrapper-sandbox.
    INFO: Build completed successfully, 15717 total actions
    

    I think that basically rules out a change in infra having caused the problem and indeed pins the blame on our submodule update.

    I'm trying to figure out if I can repro this locally. At HEAD(ish)

    $ bazel build iree_tf_compiler:all
    [...]
    INFO: Elapsed time: 762.116s, Critical Path: 490.54s                                                                                                          
    INFO: 10302 processes: 2 disk cache hit, 3294 internal, 7006 linux-sandbox.                                                                                   
    INFO: Build completed successfully, 10302 total actions  
    
    $ bazel clean && bazel shutdown
    
    $ bazel build iree_tf_compiler:all
    [...]
    INFO: Elapsed time: 35.230s, Critical Path: 18.02s
    INFO: 10302 processes: 7008 disk cache hit, 3294 internal
    INFO: Build completed successfully, 10302 total actions
    
    $ bazel clean --expunge
    
    $ bazel build iree_tf_compiler:all
    [...]
    INFO: Elapsed time: 880.873s, Critical Path: 516.72s
    INFO: 10302 processes: 14 disk cache hit, 3294 internal, 6994 linux-sandbox.
    INFO: Build completed successfully, 10302 total actions

    That seems unexpected. I thought --expunge shouldn't touch the disk cache. But if the issue is things being uncacheable, I would expect the disk cache hits after the normal clean and shutdown to go away as well.

  12. Repository owner moved this from In Progress to Done in IREEon Aug 30, 2022
  13. GMNGeoffrey commented on Aug 31, 2022

    @GMNGeoffrey
    MemberAuthor

    Confirmed #10248 fixed this. The first run post submit was slow, as expected, but a re-run finished in 5 minutes: https://github.com/iree-org/iree/runs/8104429878. See that PR for a lengthy explanation of what happened, but the gist is that it was an infra issue and debugging caches is hard

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

Metadata

Metadata

Assignees

Labels

infrastructure

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions