Conversation
1ntEgr8
reviewed
Jun 18, 2021
| apt-get install -y --no-install-recommends \ | ||
| git python3-dev python3-pip python3-setuptools python3-wheel build-essential time wget \ | ||
| cmake clang lld ninja-build | ||
| cmake clang lld ninja-build libomp-dev |
Contributor
There was a problem hiding this comment.
Since the rest of our llvm tooling is v11, to be consistent, we can install v11 of the Open MP runtime.
Suggested change
| cmake clang lld ninja-build libomp-dev | |
| cmake clang lld ninja-build libomp-11-dev |
1ntEgr8
approved these changes
Jun 18, 2021
PyTorch's distributed library imports `omp.h` a bunch so we need that header around for clang-tidy. `libomp-dev` provides it, so this adds that to the `apt install` of the Docker image. Once we merge this and land pytorch/pytorch#60225, we can update the image tag in `lint.yml` and re-enable clang-tidy on master since all the errors we saw should be addressed. Tested by running the clang command in the Docker image, seeing a failure, installing `libomp-dev`, running again and seeing no failure. ```bash docker run -it test /bin/bash clang-tidy -p build -config '{"InheritParentConfig": true, "Checks": " bugprone-*, -bugprone-forward-declaration-namespace, -bugprone-macro-parentheses, -bugprone-lambda-function-name, -bugprone-reserved-identifier, cppcoreguidelines-*, -cppcoreguidelines-avoid-magic-numbers, -cppcoreguidelines-interfaces-global-init, -cppcoreguidelines-macro-usage, -cppcoreguidelines-owning-memory, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -cppcoreguidelines-pro-bounds-constant-array-index, -cppcoreguidelines-pro-bounds-pointer-arithmetic, -cppcoreguidelines-pro-type-cstyle-cast, -cppcoreguidelines-pro-type-reinterpret-cast, -cppcoreguidelines-pro-type-static-cast-downcast, -cppcoreguidelines-pro-type-union-access, -cppcoreguidelines-pro-type-vararg, -cppcoreguidelines-special-member-functions, -facebook-hte-RelativeInclude, hicpp-exception-baseclass, hicpp-avoid-goto, modernize-*, -modernize-concat-nested-namespaces, -modernize-return-braced-init-list, -modernize-use-auto, -modernize-use-default-member-init, -modernize-use-using, -modernize-use-trailing-return-type, performance-*, -performance-noexcept-move-constructor, -performance-unnecessary-value-param, ", "HeaderFilterRegex": "torch/csrc/.*", "AnalyzeTemporaryDtors": false, "CheckOptions": null}' -line-filter '[{"name": "torch/csrc/distributed/rpc/testing/faulty_process_group_agent.cpp", "lines": [["1", "1"]]}, {"name": "torch/csrc/distributed/rpc/testing/faulty_process_group_agent.h", "lines": [["39", "39"]]}, {"name": "torch/csrc/distributed/rpc/testing/init.cpp", "lines": [["1", "1"]]}]' torch/csrc/distributed/rpc/testing/faulty_process_group_agent.cpp torch/csrc/distributed/rpc/testing/init.cpp apt install -y libomp-dev clang-tidy -p build -config '{"InheritParentConfig": true, "Checks": " bugprone-*, -bugprone-forward-declaration-namespace, -bugprone-macro-parentheses, -bugprone-lambda-function-name, -bugprone-reserved-identifier, cppcoreguidelines-*, -cppcoreguidelines-avoid-magic-numbers, -cppcoreguidelines-interfaces-global-init, -cppcoreguidelines-macro-usage, -cppcoreguidelines-owning-memory, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -cppcoreguidelines-pro-bounds-constant-array-index, -cppcoreguidelines-pro-bounds-pointer-arithmetic, -cppcoreguidelines-pro-type-cstyle-cast, -cppcoreguidelines-pro-type-reinterpret-cast, -cppcoreguidelines-pro-type-static-cast-downcast, -cppcoreguidelines-pro-type-union-access, -cppcoreguidelines-pro-type-vararg, -cppcoreguidelines-special-member-functions, -facebook-hte-RelativeInclude, hicpp-exception-baseclass, hicpp-avoid-goto, modernize-*, -modernize-concat-nested-namespaces, -modernize-return-braced-init-list, -modernize-use-auto, -modernize-use-default-member-init, -modernize-use-using, -modernize-use-trailing-return-type, performance-*, -performance-noexcept-move-constructor, -performance-unnecessary-value-param, ", "HeaderFilterRegex": "torch/csrc/.*", "AnalyzeTemporaryDtors": false, "CheckOptions": null}' -line-filter '[{"name": "torch/csrc/distributed/rpc/testing/faulty_process_group_agent.cpp", "lines": [["1", "1"]]}, {"name": "torch/csrc/distributed/rpc/testing/faulty_process_group_agent.h", "lines": [["39", "39"]]}, {"name": "torch/csrc/distributed/rpc/testing/init.cpp", "lines": [["1", "1"]]}]' torch/csrc/distributed/rpc/testing/faulty_process_group_agent.cpp torch/csrc/distributed/rpc/testing/init.cpp ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PyTorch's distributed library imports
omp.ha bunch so we need that header around for clang-tidy.libomp-devprovides it, so this adds that to theapt installof the Docker image. Once we merge this and land pytorch/pytorch#60225, we can update the image tag inlint.ymland re-enable clang-tidy on master since all the errors we saw should be addressed.Tested by running the clang command in the Docker image, seeing a failure, installing
libomp-dev, running again and seeing no failure.docker run -it test /bin/bash clang-tidy -p build -config '{"InheritParentConfig": true, "Checks": " bugprone-*, -bugprone-forward-declaration-namespace, -bugprone-macro-parentheses, -bugprone-lambda-function-name, -bugprone-reserved-identifier, cppcoreguidelines-*, -cppcoreguidelines-avoid-magic-numbers, -cppcoreguidelines-interfaces-global-init, -cppcoreguidelines-macro-usage, -cppcoreguidelines-owning-memory, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -cppcoreguidelines-pro-bounds-constant-array-index, -cppcoreguidelines-pro-bounds-pointer-arithmetic, -cppcoreguidelines-pro-type-cstyle-cast, -cppcoreguidelines-pro-type-reinterpret-cast, -cppcoreguidelines-pro-type-static-cast-downcast, -cppcoreguidelines-pro-type-union-access, -cppcoreguidelines-pro-type-vararg, -cppcoreguidelines-special-member-functions, -facebook-hte-RelativeInclude, hicpp-exception-baseclass, hicpp-avoid-goto, modernize-*, -modernize-concat-nested-namespaces, -modernize-return-braced-init-list, -modernize-use-auto, -modernize-use-default-member-init, -modernize-use-using, -modernize-use-trailing-return-type, performance-*, -performance-noexcept-move-constructor, -performance-unnecessary-value-param, ", "HeaderFilterRegex": "torch/csrc/.*", "AnalyzeTemporaryDtors": false, "CheckOptions": null}' -line-filter '[{"name": "torch/csrc/distributed/rpc/testing/faulty_process_group_agent.cpp", "lines": [["1", "1"]]}, {"name": "torch/csrc/distributed/rpc/testing/faulty_process_group_agent.h", "lines": [["39", "39"]]}, {"name": "torch/csrc/distributed/rpc/testing/init.cpp", "lines": [["1", "1"]]}]' torch/csrc/distributed/rpc/testing/faulty_process_group_agent.cpp torch/csrc/distributed/rpc/testing/init.cpp apt install -y libomp-dev clang-tidy -p build -config '{"InheritParentConfig": true, "Checks": " bugprone-*, -bugprone-forward-declaration-namespace, -bugprone-macro-parentheses, -bugprone-lambda-function-name, -bugprone-reserved-identifier, cppcoreguidelines-*, -cppcoreguidelines-avoid-magic-numbers, -cppcoreguidelines-interfaces-global-init, -cppcoreguidelines-macro-usage, -cppcoreguidelines-owning-memory, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -cppcoreguidelines-pro-bounds-constant-array-index, -cppcoreguidelines-pro-bounds-pointer-arithmetic, -cppcoreguidelines-pro-type-cstyle-cast, -cppcoreguidelines-pro-type-reinterpret-cast, -cppcoreguidelines-pro-type-static-cast-downcast, -cppcoreguidelines-pro-type-union-access, -cppcoreguidelines-pro-type-vararg, -cppcoreguidelines-special-member-functions, -facebook-hte-RelativeInclude, hicpp-exception-baseclass, hicpp-avoid-goto, modernize-*, -modernize-concat-nested-namespaces, -modernize-return-braced-init-list, -modernize-use-auto, -modernize-use-default-member-init, -modernize-use-using, -modernize-use-trailing-return-type, performance-*, -performance-noexcept-move-constructor, -performance-unnecessary-value-param, ", "HeaderFilterRegex": "torch/csrc/.*", "AnalyzeTemporaryDtors": false, "CheckOptions": null}' -line-filter '[{"name": "torch/csrc/distributed/rpc/testing/faulty_process_group_agent.cpp", "lines": [["1", "1"]]}, {"name": "torch/csrc/distributed/rpc/testing/faulty_process_group_agent.h", "lines": [["39", "39"]]}, {"name": "torch/csrc/distributed/rpc/testing/init.cpp", "lines": [["1", "1"]]}]' torch/csrc/distributed/rpc/testing/faulty_process_group_agent.cpp torch/csrc/distributed/rpc/testing/init.cpp