.pre-commit-config.yaml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. repos:
  2. - repo: meta
  3. hooks:
  4. - id: check-hooks-apply
  5. - id: check-useless-excludes
  6. - repo: https://github.com/pre-commit/pre-commit-hooks
  7. rev: v4.0.1
  8. hooks:
  9. - id: check-case-conflict
  10. - id: check-json
  11. - id: check-symlinks
  12. - id: check-yaml
  13. - id: destroyed-symlinks
  14. - id: end-of-file-fixer
  15. exclude: docs/CNAME
  16. - id: fix-byte-order-marker
  17. - id: fix-encoding-pragma
  18. args: [--remove]
  19. - id: mixed-line-ending
  20. args: [--fix=lf]
  21. - id: requirements-txt-fixer
  22. - id: trailing-whitespace
  23. - repo: https://github.com/google/yapf
  24. rev: v0.32.0
  25. hooks:
  26. - id: yapf
  27. - repo: https://gitlab.com/daverona/pre-commit/cpp
  28. rev: 0.8.0
  29. hooks:
  30. - id: clang-format # formatter of C/C++ code based on a style guide: LLVM, Google, Chromium, Mozilla, and WebKit available
  31. args: []
  32. - repo: local
  33. hooks:
  34. - id: check-torchdist
  35. name: check-torchdist
  36. entry: ./scripts/check-torchdist.py
  37. language: python
  38. exclude: ^(deepspeed/comm/|docs/|benchmarks/|scripts/check-torchdist.py|deepspeed/moe/sharded_moe.py|deepspeed/runtime/comm/coalesced_collectives.py|deepspeed/elasticity/elastic_agent.py|deepspeed/launcher/launch.py|tests/unit/comm/test_dist.py)
  39. # Specific deepspeed/ files are excluded for now until we wrap ProcessGroup in deepspeed.comm
  40. - repo: local
  41. hooks:
  42. - id: check-license
  43. name: check-license
  44. entry: ./scripts/check-license.py
  45. language: python
  46. files: \.(py|c|cpp|cu|cc|h|hpp|cuh|hip|tr)$
  47. - repo: https://github.com/codespell-project/codespell
  48. rev: v2.1.0
  49. hooks:
  50. - id: codespell
  51. args: [
  52. # Do not check files that are automatically generated
  53. '--skip=docs/Gemfile.lock,tests/unit/gpt2-merges.txt,tests/unit/gpt2-vocab.json',
  54. '--ignore-regex=\\n', # Do not count the 'n' in an escaped newline as part of a word
  55. '--ignore-words-list=youn,unsupport', # Word used in error messages that need rewording
  56. --check-filenames,
  57. --check-hidden
  58. ]
  59. - repo: https://github.com/pycqa/flake8
  60. rev: 4.0.1
  61. hooks:
  62. - id: flake8
  63. args: ['--config=.flake8']
  64. - repo: local
  65. hooks:
  66. - id: check-torchcuda
  67. name: check-torchcuda
  68. entry: ./scripts/check-torchcuda.py
  69. language: python
  70. exclude: ^(.github/workflows/|scripts/check-torchcuda.py|docs/_tutorials/accelerator-abstraction-interface.md|accelerator/cuda_accelerator.py|deepspeed/inference/engine.py|deepspeed/model_implementations/transformers/clip_encoder.py|deepspeed/model_implementations/diffusers/vae.py|deepspeed/model_implementations/diffusers/unet.py|op_builder/spatial_inference.py|op_builder/transformer_inference.py|op_builder/builder.py|setup.py|tests/unit/ops/sparse_attention/test_sparse_attention.py)
  71. # Specific deepspeed/ files are excluded for now until we wrap ProcessGroup in deepspeed.comm