7 Star 78 Fork 54

Gitee 极速下载/pytorch

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/pytorch/pytorch
克隆/下载
.lintrunner.toml 66.46 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938
[[linter]]
code = 'FLAKE8'
include_patterns = ['**/*.py']
exclude_patterns = [
'.git/**',
'build_test_custom_build/**',
'build/**',
'caffe2/**',
'docs/caffe2/**',
'docs/cpp/src/**',
'docs/src/**',
'fb/**',
'**/fb/**',
'functorch/docs/**',
'functorch/examples/**',
'functorch/notebooks/**',
'torch/_inductor/fx_passes/serialized_patterns/**',
'scripts/**',
'test/generated_type_hints_smoketest.py',
# Tests from the NumPy test suite
'test/torch_np/numpy_test/**/*.py',
'third_party/**',
'torch/include/**',
'torch/lib/**',
'venv/**',
'**/*.pyi',
'tools/test/test_selective_build.py',
]
command = [
'python3',
'tools/linter/adapters/flake8_linter.py',
'--',
'@{{PATHSFILE}}'
]
init_command = [
'python3',
'tools/linter/adapters/pip_init.py',
'--dry-run={{DRYRUN}}',
'flake8==6.1.0',
'flake8-bugbear==23.3.23',
'flake8-comprehensions==3.12.0',
'flake8-executable==2.1.3',
'flake8-logging-format==0.9.0',
'flake8-pyi==23.3.1',
'flake8-simplify==0.19.3',
'mccabe==0.7.0',
'pycodestyle==2.11.1',
'pyflakes==3.1.0',
'torchfix==0.4.0 ; python_version >= "3.9"',
]
[[linter]]
code = 'CLANGFORMAT'
include_patterns = [
'aten/src/ATen/*.h',
'aten/src/ATen/mps/**/*.mm',
'aten/src/ATen/xpu/**/*.h',
'aten/src/ATen/xpu/**/*.cpp',
'aten/src/ATen/native/mps/**/*.mm',
'aten/src/ATen/native/vulkan/**/*.h',
'aten/src/ATen/native/vulkan/**/*.cpp',
'aten/src/ATen/native/cuda/MultiTensorApply.cuh',
'aten/src/ATen/native/**/Foreach*.*',
'aten/src/ATen/native/cuda/fused*.*',
'aten/src/ATen/native/cuda/Fused*.cu',
'aten/src/ATen/native/cudnn/*.h',
'aten/src/ATen/native/cudnn/*.cpp',
'c10/**/*.h',
'c10/**/*.cpp',
'distributed/c10d/*SymmetricMemory.*',
'torch/csrc/**/*.h',
'torch/csrc/**/*.hpp',
'torch/csrc/**/*.cpp',
'test/cpp/**/*.h',
'test/cpp/**/*.cpp',
]
exclude_patterns = [
'aten/src/ATen/native/vulkan/api/vk_mem_alloc.h',
'c10/util/strong_type.h',
'**/fb/**',
'torch/csrc/inductor/aoti_torch/generated/**',
'torch/csrc/jit/serialization/mobile_bytecode_generated.h',
'torch/csrc/utils/pythoncapi_compat.h',
'aten/src/ATen/dlpack.h',
]
init_command = [
'python3',
'tools/linter/adapters/s3_init.py',
'--config-json=tools/linter/adapters/s3_init_config.json',
'--linter=clang-format',
'--dry-run={{DRYRUN}}',
'--output-dir=.lintbin',
'--output-name=clang-format',
]
command = [
'python3',
'tools/linter/adapters/clangformat_linter.py',
'--binary=.lintbin/clang-format',
'--',
'@{{PATHSFILE}}'
]
is_formatter = true
[[linter]]
code = 'MYPY'
include_patterns = [
'torch/**/*.py',
'torch/**/*.pyi',
'caffe2/**/*.py',
'caffe2/**/*.pyi',
'test/test_bundled_images.py',
'test/test_bundled_inputs.py',
'test/test_complex.py',
'test/test_datapipe.py',
'test/test_futures.py',
# 'test/test_numpy_interop.py',
'test/test_torch.py',
'test/test_type_hints.py',
'test/test_type_info.py',
'test/test_utils.py',
]
exclude_patterns = [
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/mypy_linter.py',
'--config=mypy.ini',
'--',
'@{{PATHSFILE}}'
]
init_command = [
'python3',
'tools/linter/adapters/pip_init.py',
'--dry-run={{DRYRUN}}',
'numpy==1.24.3 ; python_version == "3.8"',
'numpy==1.26.0 ; python_version >= "3.9"',
'expecttest==0.1.6',
'mypy==1.10.0',
'sympy==1.11.1',
'types-requests==2.27.25',
'types-PyYAML==6.0.7',
'types-tabulate==0.8.8',
'types-protobuf==3.19.18',
'types-pkg-resources==0.1.3',
'types-Jinja2==2.11.9',
'types-colorama==0.4.6',
'filelock==3.13.1',
'junitparser==2.1.1',
'rich==10.9.0',
'pyyaml==6.0.1',
'optree==0.11.0',
]
[[linter]]
code = 'MYPYSTRICT'
include_patterns = [
'.github/**/*.py',
'benchmarks/instruction_counts/**/*.py',
'tools/**/*.py',
'torchgen/**/*.py',
'torch/utils/_pytree.py',
'torch/utils/_cxx_pytree.py',
'torch/utils/benchmark/utils/common.py',
'torch/utils/benchmark/utils/timer.py',
'torch/utils/benchmark/utils/valgrind_wrapper/**/*.py',
]
exclude_patterns = [
# (linbinyu) copied from internal repo
'**/fb/**',
'tools/code_analyzer/gen_operators_yaml.py',
'tools/dynamo/verify_dynamo.py',
'tools/gen_vulkan_spv.py',
'tools/test/gen_operators_yaml_test.py',
'tools/test/gen_oplist_test.py',
'tools/test/test_selective_build.py',
]
command = [
'python3',
'tools/linter/adapters/mypy_linter.py',
'--config=mypy-strict.ini',
'--code=MYPYSTRICT',
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'CLANGTIDY'
include_patterns = [
# Enable coverage of headers in aten/src/ATen
# and excluding most sub-directories for now.
'aten/src/ATen/*.h',
'aten/src/ATen/*.cpp',
'aten/src/ATen/core/*.h',
'aten/src/ATen/core/*.cpp',
'aten/src/ATen/detail/*',
'aten/src/ATen/functorch/*.h',
'aten/src/ATen/functorch/*.cpp',
'c10/**/*.cpp',
'c10/**/*.h',
'torch/csrc/*.h',
'torch/csrc/*.cpp',
'torch/csrc/**/*.h',
'torch/csrc/**/*.cpp',
]
exclude_patterns = [
# The negative filters below are to exclude files that include onnx_pb.h or
# caffe2_pb.h, otherwise we'd have to build protos as part of this CI job.
# CUDA files are also excluded.
'**/fb/**',
'**/*pb.h',
'aten/**/cuda/*pp',
'c10/xpu/**/*.h',
'c10/xpu/**/*.cpp',
'c10/cuda/CUDAAlgorithm.h',
'c10/util/complex_math.h',
'c10/util/complex_utils.h',
'c10/util/flat_hash_map.h',
'c10/util/logging*.h',
'c10/util/hash.h',
'c10/util/strong_type.h',
'c10/util/SmallVector.h',
'c10/util/win32-headers.h',
'c10/util/*inl.h',
'c10/test/**/*.h',
'third_party/**/*',
'torch/csrc/api/**',
'torch/csrc/autograd/generated/**',
'torch/csrc/distributed/**/*',
'torch/csrc/dynamo/eval_frame.h',
'torch/csrc/inductor/**/*',
'torch/csrc/jit/**/*',
'torch/csrc/lazy/**/*',
]
init_command = [
'python3',
'tools/linter/adapters/s3_init.py',
'--config-json=tools/linter/adapters/s3_init_config.json',
'--linter=clang-tidy',
'--dry-run={{DRYRUN}}',
'--output-dir=.lintbin',
'--output-name=clang-tidy',
]
command = [
'python3',
'tools/linter/adapters/clangtidy_linter.py',
'--binary=.lintbin/clang-tidy',
'--build_dir=./build',
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'TYPEIGNORE'
include_patterns = ['**/*.py', '**/*.pyi']
exclude_patterns = [
'fb/**',
'**/fb/**',
'test/test_jit.py',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=# type:\s*ignore([^\[]|$)',
'--linter-name=TYPEIGNORE',
'--error-name=unqualified type: ignore',
"""--error-description=\
This line has an unqualified `type: ignore`; \
please convert it to `type: ignore[xxxx]`\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'TYPENOSKIP'
include_patterns = ['mypy.ini']
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=follow_imports\s*=\s*skip',
'--linter-name=TYPENOSKIP',
'--error-name=use of follow_imports = skip',
"""--error-description=\
follow_imports = skip is forbidden from mypy.ini configuration as it \
is extremely easy to accidentally turn off type checking unintentionally. If \
you need to suppress type errors, use a top level # mypy: ignore-errors. \
Do not rely on automatic Any substitution; instead, manually # type: ignore \
at use sites or define a pyi type stub with more relaxed types. \
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'NOQA'
include_patterns = ['**/*.py', '**/*.pyi']
exclude_patterns = [
'caffe2/**',
'fb/**',
'**/fb/**'
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=# noqa([^:]|$)',
'--linter-name=NOQA',
'--error-name=unqualified noqa',
"""--error-description=\
This line has an unqualified `noqa`; \
please convert it to `noqa: XXXX`\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'NATIVEFUNCTIONS'
include_patterns=['aten/src/ATen/native/native_functions.yaml']
command = [
'python3',
'tools/linter/adapters/nativefunctions_linter.py',
'--native-functions-yml=aten/src/ATen/native/native_functions.yaml',
]
init_command = [
'python3',
'tools/linter/adapters/pip_init.py',
'--dry-run={{DRYRUN}}',
'ruamel.yaml==0.17.4',
]
is_formatter = true
[[linter]]
code = 'NEWLINE'
include_patterns=['**']
exclude_patterns=[
'**/contrib/**',
'third_party/**',
'**/*.bat',
'**/*.expect',
'**/*.ipynb',
'**/*.ps1',
'**/*.ptl',
'fb/**',
'**/fb/**',
'tools/clang_format_hash/**',
'test/cpp/jit/upgrader_models/*.ptl',
'test/cpp/jit/upgrader_models/*.ptl.ff',
'**/*.png',
'**/*.gz',
]
command = [
'python3',
'tools/linter/adapters/newlines_linter.py',
'--',
'@{{PATHSFILE}}',
]
is_formatter = true
[[linter]]
code = 'CONSTEXPR'
include_patterns=['aten/src/ATen/native/cuda/*.cu']
command = [
'python3',
'tools/linter/adapters/constexpr_linter.py',
'--',
'@{{PATHSFILE}}',
]
is_formatter = true
[[linter]]
code = 'SPACES'
include_patterns = ['**']
exclude_patterns = [
'**/contrib/**',
'**/*.diff',
'**/*.patch',
'third_party/**',
'aten/src/ATen/native/vulkan/api/vk_mem_alloc.h',
'fb/**',
'**/fb/**',
'test/cpp/jit/upgrader_models/*.ptl',
'test/cpp/jit/upgrader_models/*.ptl.ff',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=[[:blank:]]$',
'--linter-name=SPACES',
'--error-name=trailing spaces',
'--replace-pattern=s/[[:blank:]]+$//',
"""--error-description=\
This line has trailing spaces; please remove them.\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'TABS'
include_patterns = ['**']
exclude_patterns = [
'**/*.svg',
'**/*Makefile',
'**/contrib/**',
'third_party/**',
'**/.gitattributes',
'**/.gitmodules',
'fb/**',
'**/fb/**',
'aten/src/ATen/native/vulkan/api/vk_mem_alloc.h',
'test/cpp/jit/upgrader_models/*.ptl',
'test/cpp/jit/upgrader_models/*.ptl.ff',
'.lintrunner.toml',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
# @lint-ignore TXT2
'--pattern= ',
'--linter-name=TABS',
'--error-name=saw some tabs',
'--replace-pattern=s/\t/ /',
"""--error-description=\
This line has tabs; please replace them with spaces.\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'INCLUDE'
include_patterns = [
'c10/**',
'aten/**',
'torch/csrc/**',
]
exclude_patterns = [
'aten/src/ATen/native/quantized/cpu/qnnpack/**',
'aten/src/ATen/native/vulkan/api/vk_mem_alloc.h',
'aten/src/ATen/native/vulkan/glsl/**',
'**/fb/**',
'torch/csrc/jit/serialization/mobile_bytecode_generated.h',
'torch/csrc/utils/pythoncapi_compat.h',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=#include "',
'--linter-name=INCLUDE',
'--error-name=quoted include',
'--replace-pattern=s/#include "(.*)"$/#include <\1>/',
"""--error-description=\
This #include uses quotes; please convert it to #include <xxxx>\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'PYBIND11_INCLUDE'
include_patterns = [
'**/*.cpp',
'**/*.h',
]
exclude_patterns = [
'torch/csrc/utils/pybind.h',
'torch/utils/benchmark/utils/valgrind_wrapper/compat_bindings.cpp',
'caffe2/**/*',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=#include <pybind11\/',
'--allowlist-pattern=#include <torch\/csrc\/utils\/pybind.h>',
'--linter-name=PYBIND11_INCLUDE',
'--match-first-only',
'--error-name=direct include of pybind11',
# https://stackoverflow.com/a/33416489/23845
# NB: this won't work if the pybind11 include is on the first line;
# but that's fine because it will just mean the lint will still fail
# after applying the change and you will have to fix it manually
'--replace-pattern=1,/(#include <pybind11\/)/ s/(#include <pybind11\/)/#include <torch\/csrc\/utils\/pybind.h>\n\1/',
"""--error-description=\
This #include directly includes pybind11 without also including \
#include <torch/csrc/utils/pybind.h>; this means some important \
specializations may not be included.\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'ERROR_PRONE_ISINSTANCE'
include_patterns = [
'torch/_refs/**/*.py',
'torch/_prims/**/*.py',
'torch/_prims_common/**/*.py',
'torch/_decomp/**/*.py',
'torch/_meta_registrations.py',
]
exclude_patterns = [
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=isinstance\([^)]+(int|float)\)',
'--linter-name=ERROR_PRONE_ISINSTANCE',
'--error-name=error prone isinstance',
"""--error-description=\
This line has an isinstance call that directly refers to \
int or float. This is error-prone because you may also \
have wanted to allow SymInt or SymFloat in your test. \
To suppress this lint, use an appropriate type alias defined \
in torch._prims_common; use IntLike/FloatLike when you would accept \
both regular and symbolic numbers, Dim for ints representing \
dimensions, or IntWithoutSymInt/FloatWithoutSymFloat if you really \
meant to exclude symbolic numbers.
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'PYBIND11_SPECIALIZATION'
include_patterns = [
'**/*.cpp',
'**/*.h',
]
exclude_patterns = [
# The place for all orphan specializations
'torch/csrc/utils/pybind.h',
# These specializations are non-orphan
'torch/csrc/distributed/c10d/init.cpp',
'torch/csrc/jit/python/pybind.h',
'fb/**',
'**/fb/**',
# These are safe to exclude as they do not have Python
'c10/**/*',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=PYBIND11_DECLARE_HOLDER_TYPE',
'--linter-name=PYBIND11_SPECIALIZATION',
'--error-name=pybind11 specialization in non-standard location',
"""--error-description=\
This pybind11 specialization (PYBIND11_DECLARE_HOLDER_TYPE) should \
be placed in torch/csrc/utils/pybind.h so that it is guaranteed to be \
included at any site that may potentially make use of it via py::cast. \
If your specialization is in the same header file as the definition \
of the holder type, you can ignore this lint by adding your header to \
the exclude_patterns for this lint in .lintrunner.toml. For more \
information see https://github.com/pybind/pybind11/issues/4099 \
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'PYPIDEP'
include_patterns = ['.github/**']
exclude_patterns = [
'**/*.rst',
'**/*.py',
'**/*.md',
'**/*.diff',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
"""--pattern=\
(pip|pip3|python -m pip|python3 -m pip|python3 -mpip|python -mpip) \
install ([a-zA-Z0-9][A-Za-z0-9\\._\\-]+)([^/=<>~!]+)[A-Za-z0-9\\._\\-\\*\\+\\!]*$\
""",
'--linter-name=PYPIDEP',
'--error-name=unpinned PyPI install',
"""--error-description=\
This line has unpinned PyPi installs; \
please pin them to a specific version: e.g. 'thepackage==1.2'\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'EXEC'
include_patterns = ['**']
exclude_patterns = [
'third_party/**',
'torch/bin/**',
'**/*.so',
'**/*.py',
'**/*.sh',
'**/*.bash',
'**/git-pre-commit',
'**/git-clang-format',
'**/gradlew',
'fb/**',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/exec_linter.py',
'--',
'@{{PATHSFILE}}',
]
[[linter]]
code = 'CUBINCLUDE'
include_patterns = ['aten/**']
exclude_patterns = [
'aten/src/ATen/cuda/cub*.cuh',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=#include <cub/',
'--linter-name=CUBINCLUDE',
'--error-name=direct cub include',
"""--error-description=\
This line has a direct cub include; please include \
ATen/cuda/cub.cuh instead and wrap your cub calls in \
at::native namespace if necessary.
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'RAWCUDA'
include_patterns = [
'aten/**',
'c10/**',
]
exclude_patterns = [
'aten/src/ATen/test/**',
'c10/cuda/CUDAFunctions.h',
'c10/cuda/CUDACachingAllocator.cpp',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=cudaStreamSynchronize',
'--linter-name=RAWCUDA',
'--error-name=raw CUDA API usage',
"""--error-description=\
This line calls raw CUDA APIs directly; please use at::cuda wrappers instead.
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'RAWCUDADEVICE'
include_patterns = [
'aten/**',
'c10/**',
'torch/csrc/**',
]
exclude_patterns = [
'aten/src/ATen/cuda/CUDAContext.cpp',
'aten/src/ATen/cuda/CUDAGeneratorImpl.cpp',
'aten/src/ATen/test/**',
'c10/core/impl/InlineDeviceGuard.h',
'c10/cuda/CUDAFunctions.cpp',
'c10/cuda/CUDAGuard.h',
'c10/cuda/impl/CUDATest.cpp',
'torch/csrc/cuda/nccl.cpp',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=cudaSetDevice(',
'--pattern=cudaGetDevice(',
'--linter-name=RAWCUDADEVICE',
'--error-name=raw CUDA API usage',
"""--error-description=\
This line calls raw CUDA APIs directly; please use c10::cuda wrappers instead.
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'ROOT_LOGGING'
include_patterns = [
'**/*.py',
]
# These are not library code, but scripts in their own right, and so
# therefore are permitted to use logging
exclude_patterns = [
'tools/**',
'test/**',
'benchmarks/**',
'torch/distributed/run.py',
'functorch/benchmarks/**',
# Grandfathered in
'caffe2/**',
'fb/**',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=logging\.(debug|info|warn|warning|error|critical|log|exception)\(',
'--replace-pattern=s/logging\.(debug|info|warn|warning|error|critical|log|exception)\(/log.\1(/',
'--linter-name=ROOT_LOGGING',
'--error-name=use of root logger',
"""--error-description=\
Do not use root logger (logging.info, etc) directly; instead \
define 'log = logging.getLogger(__name__)' and call, e.g., log.info().
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'DEPLOY_DETECTION'
include_patterns = [
'**/*.py',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=sys\.executable == .torch_deploy.',
'--replace-pattern=s/sys\.executable == .torch_deploy./torch._running_with_deploy\(\)/',
'--linter-name=DEPLOY_DETECTION',
'--error-name=properly detect deploy runner',
"""--error-description=\
Do not use sys.executable to detect if running within deploy/multipy, use torch._running_with_deploy().
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'CMAKE'
include_patterns = [
"**/*.cmake",
"**/*.cmake.in",
"**/CMakeLists.txt",
]
exclude_patterns = [
'cmake/Modules/**',
'cmake/Modules_CUDA_fix/**',
'cmake/Caffe2Config.cmake.in',
'aten/src/ATen/ATenConfig.cmake.in',
'cmake/TorchConfig.cmake.in',
'cmake/TorchConfigVersion.cmake.in',
'cmake/cmake_uninstall.cmake.i',
'fb/**',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/cmake_linter.py',
'--config=.cmakelintrc',
'--',
'@{{PATHSFILE}}',
]
init_command = [
'python3',
'tools/linter/adapters/pip_init.py',
'--dry-run={{DRYRUN}}',
'cmakelint==1.4.1',
]
[[linter]]
code = 'SHELLCHECK'
include_patterns = [
'.ci/pytorch/**/*.sh'
]
exclude_patterns = [
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/shellcheck_linter.py',
'--',
'@{{PATHSFILE}}',
]
init_command = [
'python3',
'tools/linter/adapters/pip_init.py',
'--dry-run={{DRYRUN}}',
'shellcheck-py==0.7.2.1',
]
[[linter]]
code = 'ACTIONLINT'
include_patterns = [
'.github/workflows/*.yml',
'.github/workflows/*.yaml',
# actionlint does not support composite actions yet
# '.github/actions/**/*.yml',
# '.github/actions/**/*.yaml',
]
exclude_patterns = [
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/actionlint_linter.py',
'--binary=.lintbin/actionlint',
'--',
'@{{PATHSFILE}}',
]
init_command = [
'python3',
'tools/linter/adapters/s3_init.py',
'--config-json=tools/linter/adapters/s3_init_config.json',
'--linter=actionlint',
'--dry-run={{DRYRUN}}',
'--output-dir=.lintbin',
'--output-name=actionlint',
]
[[linter]]
code = 'TESTOWNERS'
include_patterns = [
'test/**/test_*.py',
'test/**/*_test.py',
]
exclude_patterns = [
'test/run_test.py',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/testowners_linter.py',
'--',
'@{{PATHSFILE}}',
]
[[linter]]
code = 'TEST_HAS_MAIN'
include_patterns = [
'test/**/test_*.py',
]
exclude_patterns = [
'test/run_test.py',
'**/fb/**',
'test/quantization/**', # should be run through test/test_quantization.py
'test/jit/**', # should be run through test/test_jit.py
'test/ao/sparsity/**', # should be run through test/test_ao_sparsity.py
'test/fx/**', # should be run through test/test_fx.py
'test/bottleneck_test/**', # excluded by test/run_test.py
'test/package/**', # excluded by test/run_test.py
'test/distributed/argparse_util_test.py',
'test/distributed/bin/test_script.py',
'test/distributed/elastic/agent/server/test/local_elastic_agent_test.py',
'test/distributed/elastic/multiprocessing/bin/test_script.py',
'test/distributed/elastic/multiprocessing/bin/zombie_test.py',
'test/distributed/elastic/multiprocessing/errors/api_test.py',
'test/distributed/elastic/multiprocessing/errors/error_handler_test.py',
'test/distributed/elastic/multiprocessing/redirects_test.py',
'test/distributed/elastic/multiprocessing/tail_log_test.py',
'test/distributed/elastic/rendezvous/api_test.py',
'test/distributed/elastic/rendezvous/c10d_rendezvous_backend_test.py',
'test/distributed/elastic/rendezvous/dynamic_rendezvous_test.py',
'test/distributed/elastic/rendezvous/etcd_rendezvous_backend_test.py',
'test/distributed/elastic/rendezvous/etcd_rendezvous_test.py',
'test/distributed/elastic/rendezvous/etcd_server_test.py',
'test/distributed/elastic/rendezvous/rendezvous_backend_test.py',
'test/distributed/elastic/rendezvous/static_rendezvous_test.py',
'test/distributed/elastic/rendezvous/utils_test.py',
'test/distributed/elastic/timer/api_test.py',
'test/distributed/elastic/utils/data/cycling_iterator_test.py',
'test/distributed/launcher/api_test.py',
'test/distributed/launcher/bin/test_script.py',
'test/distributed/launcher/bin/test_script_init_method.py',
'test/distributed/launcher/bin/test_script_is_torchelastic_launched.py',
'test/distributed/launcher/bin/test_script_local_rank.py',
'test/distributed/launcher/launch_test.py',
'test/distributed/launcher/run_test.py',
'test/distributed/optim/test_apply_optimizer_in_backward.py',
'test/distributed/optim/test_named_optimizer.py',
'test/distributed/test_c10d_spawn.py',
'test/distributed/test_collective_utils.py',
'test/distributions/test_distributions.py',
'test/inductor/test_aot_inductor_utils.py',
'test/lazy/test_bindings.py',
'test/lazy/test_extract_compiled_graph.py',
'test/lazy/test_meta_kernel.py',
'test/nn/test_init.py',
'test/onnx/model_defs/op_test.py',
'test/onnx/test_models_quantized_onnxruntime.py',
'test/onnx/test_onnxscript_no_runtime.py',
'test/onnx_caffe2/test_caffe2_common.py',
'test/optim/test_lrscheduler.py',
'test/optim/test_optim.py',
'test/optim/test_swa_utils.py',
'test/run_test.py',
'test/test_bundled_images.py',
'test/test_cuda_expandable_segments.py',
'test/test_hub.py',
]
command = [
'python3',
'tools/linter/adapters/test_has_main_linter.py',
'--',
'@{{PATHSFILE}}',
]
[[linter]]
code = 'CALL_ONCE'
include_patterns = [
'c10/**',
'aten/**',
'torch/csrc/**',
]
exclude_patterns = [
'c10/util/CallOnce.h',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=std::call_once',
'--linter-name=CALL_ONCE',
'--error-name=invalid call_once',
'--replace-pattern=s/std::call_once/c10::call_once/',
"""--error-description=\
Use of std::call_once is forbidden and should be replaced with c10::call_once\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'ONCE_FLAG'
include_patterns = [
'c10/**',
'aten/**',
'torch/csrc/**',
]
exclude_patterns = [
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=std::once_flag',
'--linter-name=ONCE_FLAG',
'--error-name=invalid once_flag',
'--replace-pattern=s/std::once_flag/c10::once_flag/',
"""--error-description=\
Use of std::once_flag is forbidden and should be replaced with c10::once_flag\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'WORKFLOWSYNC'
include_patterns = [
'.github/workflows/pull.yml',
'.github/workflows/trunk.yml',
'.github/workflows/periodic.yml',
'.github/workflows/mac-mps.yml',
'.github/workflows/slow.yml',
]
command = [
'python3',
'tools/linter/adapters/workflow_consistency_linter.py',
'--',
'@{{PATHSFILE}}'
]
init_command = [
'python3',
'tools/linter/adapters/pip_init.py',
'--dry-run={{DRYRUN}}',
'PyYAML==6.0.1',
]
# Black + usort
[[linter]]
code = 'UFMT'
include_patterns = [
'**/*.py',
'**/*.pyi',
]
command = [
'python3',
'tools/linter/adapters/ufmt_linter.py',
'--',
'@{{PATHSFILE}}'
]
exclude_patterns = [
'tools/gen_vulkan_spv.py',
# We don't care too much about files in this directory, don't enforce
# formatting on them
'caffe2/**/*.py',
'caffe2/**/*.pyi',
'fb/**',
'**/fb/**',
'third_party/**/*.py',
'third_party/**/*.pyi',
'torch/_inductor/fx_passes/serialized_patterns/**',
# These files are all grandfathered in, feel free to remove from this list
# as necessary
'test/_nvfuser/__init__.py',
'test/_nvfuser/test_dynamo.py',
'test/_nvfuser/test_python_frontend.py',
'test/_nvfuser/test_torchscript.py',
'test/delete.py',
'test/expect/__init__.py',
'test/quantization/__init__.py',
'test/quantization/core/__init__.py',
'test/quantization/core/experimental/apot_fx_graph_mode_ptq.py',
'test/quantization/core/experimental/apot_fx_graph_mode_qat.py',
'test/quantization/core/experimental/quantization_util.py',
'test/quantization/core/experimental/test_bits.py',
'test/quantization/core/experimental/test_fake_quantize.py',
'test/quantization/core/experimental/test_linear.py',
'test/quantization/core/experimental/test_nonuniform_observer.py',
'test/quantization/core/experimental/test_quantized_tensor.py',
'test/quantization/core/experimental/test_quantizer.py',
'test/quantization/core/test_backend_config.py',
'test/quantization/core/test_docs.py',
'test/quantization/core/test_quantized_functional.py',
'test/quantization/core/test_quantized_module.py',
'test/quantization/core/test_quantized_op.py',
'test/quantization/core/test_quantized_tensor.py',
'test/quantization/core/test_top_level_apis.py',
'test/quantization/core/test_utils.py',
'test/quantization/core/test_workflow_module.py',
'test/quantization/core/test_workflow_ops.py',
'test/quantization/eager/__init__.py',
'test/quantization/eager/test_bias_correction_eager.py',
'test/quantization/eager/test_equalize_eager.py',
'test/quantization/eager/test_fuse_eager.py',
'test/quantization/eager/test_model_numerics.py',
'test/quantization/eager/test_numeric_suite_eager.py',
'test/quantization/eager/test_quantize_eager_ptq.py',
'test/quantization/eager/test_quantize_eager_qat.py',
'test/quantization/fx/__init__.py',
'test/quantization/fx/test_equalize_fx.py',
'test/quantization/fx/test_model_report_fx.py',
'test/quantization/fx/test_numeric_suite_fx.py',
'test/quantization/fx/test_quantize_fx.py',
'test/quantization/fx/test_subgraph_rewriter.py',
'test/test_fake_tensor.py',
'test/test_flop_counter.py',
'test/test_function_schema.py',
'test/test_functional_autograd_benchmark.py',
'test/test_functional_optim.py',
'test/test_functionalization_of_rng_ops.py',
'test/test_datapipe.py',
'test/test_futures.py',
'test/test_fx.py',
'test/test_fx_experimental.py',
'test/test_fx_passes.py',
'test/test_fx_reinplace_pass.py',
'test/test_import_stats.py',
'test/test_itt.py',
'test/test_jit.py',
'test/test_jit_autocast.py',
'test/test_jit_cuda_fuser.py',
'test/test_jit_disabled.py',
'test/test_jit_fuser.py',
'test/test_jit_fuser_legacy.py',
'test/test_jit_legacy.py',
'test/test_jit_llga_fuser.py',
'test/test_jit_profiling.py',
'test/test_jit_simple.py',
'test/test_jit_string.py',
'test/test_jiterator.py',
'test/test_kernel_launch_checks.py',
'test/test_linalg.py',
'test/test_masked.py',
'test/test_maskedtensor.py',
'test/test_matmul_cuda.py',
'test/test_meta.py',
'test/test_metal.py',
'test/test_mkl_verbose.py',
'test/test_mkldnn.py',
'test/test_mkldnn_fusion.py',
'test/test_mkldnn_verbose.py',
'test/test_mobile_optimizer.py',
'test/test_model_dump.py',
'test/test_modules.py',
'test/test_monitor.py',
'test/test_mps.py',
'test/test_multiprocessing_spawn.py',
'test/test_namedtensor.py',
'test/test_namedtuple_return_api.py',
'test/test_native_functions.py',
'test/test_native_mha.py',
'test/test_nn.py',
'test/test_out_dtype_op.py',
'test/test_overrides.py',
'test/test_prims.py',
'test/test_proxy_tensor.py',
'test/test_pruning_op.py',
'test/test_public_bindings.py',
'test/test_quantization.py',
'test/test_reductions.py',
'test/test_scatter_gather_ops.py',
'test/test_schema_check.py',
'test/test_segment_reductions.py',
'test/test_serialization.py',
'test/test_set_default_mobile_cpu_allocator.py',
'test/test_sparse.py',
'test/test_sparse_csr.py',
'test/test_sparse_semi_structured.py',
'test/test_spectral_ops.py',
'test/test_stateless.py',
'test/test_static_runtime.py',
'test/test_subclass.py',
'test/test_sympy_utils.py',
'test/test_tensor_creation_ops.py',
'test/test_tensorboard.py',
'test/test_tensorexpr.py',
'test/test_tensorexpr_pybind.py',
'test/test_testing.py',
'test/test_torch.py',
'test/test_transformers.py',
'test/test_type_promotion.py',
'test/test_unary_ufuncs.py',
'test/test_vulkan.py',
'test/test_xnnpack_integration.py',
'test/torch_np/numpy_test/**/*.py',
'torch/_awaits/__init__.py',
'torch/_custom_op/__init__.py',
'torch/_custom_op/autograd.py',
'torch/_custom_op/functional.py',
'torch/_custom_op/impl.py',
'torch/_export/__init__.py',
'torch/_export/constraints.py',
'torch/_export/db/__init__.py',
'torch/_export/db/case.py',
'torch/_export/db/examples/__init__.py',
'torch/_export/db/examples/assume_constant_result.py',
'torch/_export/db/examples/autograd_function.py',
'torch/_export/db/examples/class_method.py',
'torch/_export/db/examples/cond_branch_class_method.py',
'torch/_export/db/examples/cond_branch_nested_function.py',
'torch/_export/db/examples/cond_branch_nonlocal_variables.py',
'torch/_export/db/examples/cond_closed_over_variable.py',
'torch/_export/db/examples/cond_operands.py',
'torch/_export/db/examples/cond_predicate.py',
'torch/_export/db/examples/decorator.py',
'torch/_export/db/examples/dictionary.py',
'torch/_export/db/examples/dynamic_shape_assert.py',
'torch/_export/db/examples/dynamic_shape_constructor.py',
'torch/_export/db/examples/dynamic_shape_if_guard.py',
'torch/_export/db/examples/dynamic_shape_map.py',
'torch/_export/db/examples/dynamic_shape_round.py',
'torch/_export/db/examples/dynamic_shape_slicing.py',
'torch/_export/db/examples/dynamic_shape_view.py',
'torch/_export/db/examples/fn_with_kwargs.py',
'torch/_export/db/examples/list_contains.py',
'torch/_export/db/examples/list_unpack.py',
'torch/_export/db/examples/nested_function.py',
'torch/_export/db/examples/null_context_manager.py',
'torch/_export/db/examples/pytree_flatten.py',
'torch/_export/db/examples/scalar_output.py',
'torch/_export/db/examples/specialized_attribute.py',
'torch/_export/db/examples/static_for_loop.py',
'torch/_export/db/examples/static_if.py',
'torch/_export/db/examples/tensor_setattr.py',
'torch/_export/db/examples/type_reflection_method.py',
'torch/_export/db/gen_example.py',
'torch/_export/db/logging.py',
'torch/_export/error.py',
'torch/_export/exported_program.py',
'torch/_export/pass_base.py',
'torch/_export/pass_infra/__init__.py',
'torch/_export/pass_infra/node_metadata.py',
'torch/_export/pass_infra/proxy_value.py',
'torch/_export/passes/__init__.py',
'torch/_export/passes/add_runtime_assertions_for_constraints_pass.py',
'torch/_export/passes/const_prop_pass.py',
'torch/_export/passes/functionalize_side_effectful_ops_pass.py',
'torch/_export/passes/replace_sym_size_ops_pass.py',
'torch/_export/passes/replace_view_ops_with_view_copy_ops_pass.py',
'torch/_export/serde/__init__.py',
'torch/_export/serde/schema.py',
'torch/_export/serde/serialize.py',
'torch/_export/serde/upgrade.py',
'torch/_export/trace.py',
'torch/_export/verifier.py',
'torch/_vendor/**',
'torch/ao/__init__.py',
'torch/ao/nn/__init__.py',
'torch/ao/nn/intrinsic/__init__.py',
'torch/ao/nn/intrinsic/modules/__init__.py',
'torch/ao/nn/intrinsic/modules/fused.py',
'torch/ao/nn/intrinsic/qat/__init__.py',
'torch/ao/nn/intrinsic/qat/modules/__init__.py',
'torch/ao/nn/intrinsic/qat/modules/conv_fused.py',
'torch/ao/nn/intrinsic/qat/modules/linear_fused.py',
'torch/ao/nn/intrinsic/qat/modules/linear_relu.py',
'torch/ao/nn/intrinsic/quantized/__init__.py',
'torch/ao/nn/intrinsic/quantized/dynamic/__init__.py',
'torch/ao/nn/intrinsic/quantized/dynamic/modules/__init__.py',
'torch/ao/nn/intrinsic/quantized/dynamic/modules/linear_relu.py',
'torch/ao/nn/intrinsic/quantized/modules/__init__.py',
'torch/ao/nn/intrinsic/quantized/modules/bn_relu.py',
'torch/ao/nn/intrinsic/quantized/modules/conv_add.py',
'torch/ao/nn/intrinsic/quantized/modules/conv_relu.py',
'torch/ao/nn/intrinsic/quantized/modules/linear_relu.py',
'torch/ao/nn/qat/__init__.py',
'torch/ao/nn/qat/dynamic/__init__.py',
'torch/ao/nn/qat/dynamic/modules/__init__.py',
'torch/ao/nn/qat/dynamic/modules/linear.py',
'torch/ao/nn/qat/modules/__init__.py',
'torch/ao/nn/qat/modules/conv.py',
'torch/ao/nn/qat/modules/embedding_ops.py',
'torch/ao/nn/qat/modules/linear.py',
'torch/ao/nn/quantizable/__init__.py',
'torch/ao/nn/quantizable/modules/__init__.py',
'torch/ao/nn/quantizable/modules/activation.py',
'torch/ao/nn/quantizable/modules/rnn.py',
'torch/ao/nn/quantized/__init__.py',
'torch/ao/nn/quantized/dynamic/__init__.py',
'torch/ao/nn/quantized/dynamic/modules/__init__.py',
'torch/ao/nn/quantized/dynamic/modules/conv.py',
'torch/ao/nn/quantized/dynamic/modules/linear.py',
'torch/ao/nn/quantized/dynamic/modules/rnn.py',
'torch/ao/nn/quantized/functional.py',
'torch/ao/nn/quantized/modules/__init__.py',
'torch/ao/nn/quantized/modules/activation.py',
'torch/ao/nn/quantized/modules/batchnorm.py',
'torch/ao/nn/quantized/modules/conv.py',
'torch/ao/nn/quantized/modules/dropout.py',
'torch/ao/nn/quantized/modules/embedding_ops.py',
'torch/ao/nn/quantized/modules/functional_modules.py',
'torch/ao/nn/quantized/modules/linear.py',
'torch/ao/nn/quantized/modules/normalization.py',
'torch/ao/nn/quantized/modules/rnn.py',
'torch/ao/nn/quantized/modules/utils.py',
'torch/ao/nn/quantized/reference/__init__.py',
'torch/ao/nn/quantized/reference/modules/__init__.py',
'torch/ao/nn/quantized/reference/modules/conv.py',
'torch/ao/nn/quantized/reference/modules/linear.py',
'torch/ao/nn/quantized/reference/modules/rnn.py',
'torch/ao/nn/quantized/reference/modules/sparse.py',
'torch/ao/nn/quantized/reference/modules/utils.py',
'torch/ao/nn/sparse/__init__.py',
'torch/ao/nn/sparse/quantized/__init__.py',
'torch/ao/nn/sparse/quantized/dynamic/__init__.py',
'torch/ao/nn/sparse/quantized/dynamic/linear.py',
'torch/ao/nn/sparse/quantized/linear.py',
'torch/ao/nn/sparse/quantized/utils.py',
'torch/ao/ns/__init__.py',
'torch/ao/ns/_numeric_suite.py',
'torch/ao/ns/_numeric_suite_fx.py',
'torch/ao/ns/fx/__init__.py',
'torch/ao/ns/fx/graph_matcher.py',
'torch/ao/ns/fx/graph_passes.py',
'torch/ao/ns/fx/mappings.py',
'torch/ao/ns/fx/n_shadows_utils.py',
'torch/ao/ns/fx/ns_types.py',
'torch/ao/ns/fx/pattern_utils.py',
'torch/ao/ns/fx/qconfig_multi_mapping.py',
'torch/ao/ns/fx/utils.py',
'torch/ao/ns/fx/weight_utils.py',
'torch/ao/pruning/__init__.py',
'torch/ao/pruning/_experimental/__init__.py',
'torch/ao/pruning/_experimental/activation_sparsifier/__init__.py',
'torch/ao/pruning/_experimental/activation_sparsifier/activation_sparsifier.py',
'torch/ao/pruning/_experimental/data_scheduler/__init__.py',
'torch/ao/pruning/_experimental/data_scheduler/base_data_scheduler.py',
'torch/ao/pruning/_experimental/data_sparsifier/__init__.py',
'torch/ao/pruning/_experimental/data_sparsifier/base_data_sparsifier.py',
'torch/ao/pruning/_experimental/data_sparsifier/benchmarks/dlrm_utils.py',
'torch/ao/pruning/_experimental/data_sparsifier/benchmarks/evaluate_disk_savings.py',
'torch/ao/pruning/_experimental/data_sparsifier/benchmarks/evaluate_forward_time.py',
'torch/ao/pruning/_experimental/data_sparsifier/benchmarks/evaluate_model_metrics.py',
'torch/ao/pruning/_experimental/data_sparsifier/data_norm_sparsifier.py',
'torch/ao/pruning/_experimental/data_sparsifier/lightning/__init__.py',
'torch/ao/pruning/_experimental/data_sparsifier/lightning/callbacks/__init__.py',
'torch/ao/pruning/_experimental/data_sparsifier/lightning/callbacks/_data_sparstity_utils.py',
'torch/ao/pruning/_experimental/data_sparsifier/lightning/callbacks/data_sparsity.py',
'torch/ao/pruning/_experimental/data_sparsifier/lightning/tests/test_callbacks.py',
'torch/ao/pruning/_experimental/data_sparsifier/quantization_utils.py',
'torch/ao/pruning/_experimental/pruner/__init__.py',
'torch/ao/pruning/_experimental/pruner/base_structured_sparsifier.py',
'torch/ao/pruning/_experimental/pruner/lstm_saliency_pruner.py',
'torch/ao/pruning/_experimental/pruner/match_utils.py',
'torch/ao/pruning/_experimental/pruner/parametrization.py',
'torch/ao/pruning/_experimental/pruner/prune_functions.py',
'torch/ao/pruning/_experimental/pruner/saliency_pruner.py',
'torch/ao/pruning/_mappings.py',
'torch/ao/pruning/scheduler/__init__.py',
'torch/ao/pruning/scheduler/base_scheduler.py',
'torch/ao/pruning/scheduler/cubic_scheduler.py',
'torch/ao/pruning/scheduler/lambda_scheduler.py',
'torch/ao/pruning/sparsifier/__init__.py',
'torch/ao/pruning/sparsifier/base_sparsifier.py',
'torch/ao/pruning/sparsifier/nearly_diagonal_sparsifier.py',
'torch/ao/pruning/sparsifier/utils.py',
'torch/ao/pruning/sparsifier/weight_norm_sparsifier.py',
'torch/ao/quantization/__init__.py',
'torch/ao/quantization/_correct_bias.py',
'torch/ao/quantization/_equalize.py',
'torch/ao/quantization/_learnable_fake_quantize.py',
'torch/ao/quantization/backend_config/__init__.py',
'torch/ao/quantization/backend_config/_common_operator_config_utils.py',
'torch/ao/quantization/backend_config/_qnnpack_pt2e.py',
'torch/ao/quantization/backend_config/_x86_inductor_pt2e.py',
'torch/ao/quantization/backend_config/backend_config.py',
'torch/ao/quantization/backend_config/executorch.py',
'torch/ao/quantization/backend_config/fbgemm.py',
'torch/ao/quantization/backend_config/native.py',
'torch/ao/quantization/backend_config/observation_type.py',
'torch/ao/quantization/backend_config/onednn.py',
'torch/ao/quantization/backend_config/qnnpack.py',
'torch/ao/quantization/backend_config/tensorrt.py',
'torch/ao/quantization/backend_config/utils.py',
'torch/ao/quantization/backend_config/x86.py',
'torch/ao/quantization/experimental/APoT_tensor.py',
'torch/ao/quantization/experimental/apot_utils.py',
'torch/ao/quantization/experimental/fake_quantize.py',
'torch/ao/quantization/experimental/fake_quantize_function.py',
'torch/ao/quantization/experimental/linear.py',
'torch/ao/quantization/experimental/observer.py',
'torch/ao/quantization/experimental/qconfig.py',
'torch/ao/quantization/experimental/quantizer.py',
'torch/ao/quantization/fake_quantize.py',
'torch/ao/quantization/fuse_modules.py',
'torch/ao/quantization/fuser_method_mappings.py',
'torch/ao/quantization/fx/__init__.py',
'torch/ao/quantization/fx/_decomposed.py',
'torch/ao/quantization/fx/_equalize.py',
'torch/ao/quantization/fx/_lower_to_native_backend.py',
'torch/ao/quantization/fx/_model_report/__init__.py',
'torch/ao/quantization/fx/_model_report/detector.py',
'torch/ao/quantization/fx/_model_report/model_report.py',
'torch/ao/quantization/fx/_model_report/model_report_observer.py',
'torch/ao/quantization/fx/_model_report/model_report_visualizer.py',
'torch/ao/quantization/fx/convert.py',
'torch/ao/quantization/fx/custom_config.py',
'torch/ao/quantization/fx/fuse.py',
'torch/ao/quantization/fx/fuse_handler.py',
'torch/ao/quantization/fx/graph_module.py',
'torch/ao/quantization/fx/lower_to_fbgemm.py',
'torch/ao/quantization/fx/lower_to_qnnpack.py',
'torch/ao/quantization/fx/lstm_utils.py',
'torch/ao/quantization/fx/match_utils.py',
'torch/ao/quantization/fx/pattern_utils.py',
'torch/ao/quantization/fx/prepare.py',
'torch/ao/quantization/fx/qconfig_mapping_utils.py',
'torch/ao/quantization/fx/quantize_handler.py',
'torch/ao/quantization/fx/tracer.py',
'torch/ao/quantization/fx/utils.py',
'torch/ao/quantization/observer.py',
'torch/ao/quantization/pt2e/__init__.py',
'torch/ao/quantization/pt2e/_propagate_annotation.py',
'torch/ao/quantization/pt2e/graph_utils.py',
'torch/ao/quantization/pt2e/prepare.py',
'torch/ao/quantization/pt2e/qat_utils.py',
'torch/ao/quantization/pt2e/quantizer/__init__.py',
'torch/ao/quantization/pt2e/quantizer/composable_quantizer.py',
'torch/ao/quantization/pt2e/quantizer/embedding_quantizer.py',
'torch/ao/quantization/pt2e/quantizer/qnnpack_quantizer.py',
'torch/ao/quantization/pt2e/quantizer/quantizer.py',
'torch/ao/quantization/pt2e/quantizer/utils.py',
'torch/ao/quantization/pt2e/quantizer/x86_inductor_quantizer.py',
'torch/ao/quantization/pt2e/representation/__init__.py',
'torch/ao/quantization/pt2e/representation/rewrite.py',
'torch/ao/quantization/pt2e/utils.py',
'torch/ao/quantization/qconfig.py',
'torch/ao/quantization/qconfig_mapping.py',
'torch/ao/quantization/quant_type.py',
'torch/ao/quantization/quantization_mappings.py',
'torch/ao/quantization/quantize.py',
'torch/ao/quantization/quantize_fx.py',
'torch/ao/quantization/quantize_jit.py',
'torch/ao/quantization/quantize_pt2e.py',
'torch/ao/quantization/stubs.py',
'torch/ao/quantization/utils.py',
'torch/compiler/__init__.py',
'torch/contrib/__init__.py',
'torch/contrib/_tensorboard_vis.py',
"torch/cuda/_gpu_trace.py",
'torch/cuda/_memory_viz.py', # mypy: Value of type "object" is not indexable
'torch/fft/__init__.py',
'torch/func/__init__.py',
'torch/futures/__init__.py',
'torch/fx/__init__.py',
'torch/fx/_compatibility.py',
'torch/fx/_symbolic_trace.py',
'torch/fx/annotate.py',
'torch/fx/config.py',
'torch/fx/experimental/__init__.py',
'torch/fx/experimental/accelerator_partitioner.py',
'torch/fx/experimental/const_fold.py',
'torch/fx/experimental/debug.py',
'torch/fx/experimental/graph_gradual_typechecker.py',
'torch/fx/experimental/merge_matmul.py',
'torch/fx/experimental/meta_tracer.py',
'torch/fx/experimental/migrate_gradual_types/__init__.py',
'torch/fx/experimental/migrate_gradual_types/constraint.py',
'torch/fx/experimental/migrate_gradual_types/constraint_generator.py',
'torch/fx/experimental/migrate_gradual_types/constraint_transformation.py',
'torch/fx/experimental/migrate_gradual_types/operation.py',
'torch/fx/experimental/migrate_gradual_types/transform_to_z3.py',
'torch/fx/experimental/migrate_gradual_types/util.py',
'torch/fx/experimental/migrate_gradual_types/z3_types.py',
'torch/fx/experimental/normalize.py',
'torch/fx/experimental/optimization.py',
'torch/fx/experimental/partitioner_utils.py',
'torch/fx/experimental/proxy_tensor.py',
'torch/fx/experimental/refinement_types.py',
'torch/fx/experimental/rewriter.py',
'torch/fx/experimental/schema_type_annotation.py',
'torch/fx/experimental/symbolic_shapes.py',
'torch/fx/experimental/unification/__init__.py',
'torch/fx/experimental/unification/core.py',
'torch/fx/experimental/unification/dispatch.py',
'torch/fx/experimental/unification/match.py',
'torch/fx/experimental/unification/more.py',
'torch/fx/experimental/unification/multipledispatch/__init__.py',
'torch/fx/experimental/unification/multipledispatch/conflict.py',
'torch/fx/experimental/unification/multipledispatch/core.py',
'torch/fx/experimental/unification/multipledispatch/dispatcher.py',
'torch/fx/experimental/unification/multipledispatch/utils.py',
'torch/fx/experimental/unification/multipledispatch/variadic.py',
'torch/fx/experimental/unification/unification_tools.py',
'torch/fx/experimental/unification/utils.py',
'torch/fx/experimental/unification/variable.py',
'torch/fx/experimental/unify_refinements.py',
'torch/fx/experimental/validator.py',
'torch/fx/graph.py',
'torch/fx/graph_module.py',
'torch/fx/interpreter.py',
'torch/fx/node.py',
'torch/fx/operator_schemas.py',
'torch/fx/passes/__init__.py',
'torch/fx/passes/annotate_getitem_nodes.py',
'torch/fx/passes/backends/__init__.py',
'torch/fx/passes/backends/cudagraphs.py',
'torch/fx/passes/dialect/__init__.py',
'torch/fx/passes/dialect/common/__init__.py',
'torch/fx/passes/dialect/common/cse_pass.py',
'torch/fx/passes/fake_tensor_prop.py',
'torch/fx/passes/graph_drawer.py',
'torch/fx/passes/graph_manipulation.py',
'torch/fx/passes/infra/__init__.py',
'torch/fx/passes/infra/partitioner.py',
'torch/fx/passes/infra/pass_base.py',
'torch/fx/passes/infra/pass_manager.py',
'torch/fx/passes/net_min_base.py',
'torch/fx/passes/operator_support.py',
'torch/fx/passes/param_fetch.py',
'torch/fx/passes/pass_manager.py',
'torch/fx/passes/reinplace.py',
'torch/fx/passes/shape_prop.py',
'torch/fx/passes/split_module.py',
'torch/fx/passes/split_utils.py',
'torch/fx/passes/splitter_base.py',
'torch/fx/passes/tests/__init__.py',
'torch/fx/passes/tests/test_pass_manager.py',
'torch/fx/passes/tools_common.py',
'torch/fx/passes/utils/__init__.py',
'torch/fx/passes/utils/common.py',
'torch/fx/passes/utils/fuser_utils.py',
'torch/fx/passes/utils/matcher_utils.py',
'torch/fx/passes/utils/source_matcher_utils.py',
'torch/fx/proxy.py',
'torch/fx/subgraph_rewriter.py',
'torch/fx/tensor_type.py',
'torch/fx/traceback.py',
'torch/linalg/__init__.py',
'torch/monitor/__init__.py',
'torch/nested/__init__.py',
'torch/nn/intrinsic/__init__.py',
'torch/nn/intrinsic/modules/__init__.py',
'torch/nn/intrinsic/modules/fused.py',
'torch/nn/intrinsic/qat/__init__.py',
'torch/nn/intrinsic/qat/modules/__init__.py',
'torch/nn/intrinsic/qat/modules/conv_fused.py',
'torch/nn/intrinsic/qat/modules/linear_fused.py',
'torch/nn/intrinsic/qat/modules/linear_relu.py',
'torch/nn/intrinsic/quantized/__init__.py',
'torch/nn/intrinsic/quantized/dynamic/__init__.py',
'torch/nn/intrinsic/quantized/dynamic/modules/__init__.py',
'torch/nn/intrinsic/quantized/dynamic/modules/linear_relu.py',
'torch/nn/intrinsic/quantized/modules/__init__.py',
'torch/nn/intrinsic/quantized/modules/bn_relu.py',
'torch/nn/intrinsic/quantized/modules/conv_relu.py',
'torch/nn/intrinsic/quantized/modules/linear_relu.py',
'torch/nn/qat/__init__.py',
'torch/nn/qat/dynamic/__init__.py',
'torch/nn/qat/dynamic/modules/__init__.py',
'torch/nn/qat/dynamic/modules/linear.py',
'torch/nn/qat/modules/__init__.py',
'torch/nn/qat/modules/conv.py',
'torch/nn/qat/modules/embedding_ops.py',
'torch/nn/qat/modules/linear.py',
'torch/nn/quantizable/__init__.py',
'torch/nn/quantizable/modules/__init__.py',
'torch/nn/quantizable/modules/activation.py',
'torch/nn/quantizable/modules/rnn.py',
'torch/nn/quantized/__init__.py',
'torch/nn/quantized/_reference/__init__.py',
'torch/nn/quantized/_reference/modules/__init__.py',
'torch/nn/quantized/_reference/modules/conv.py',
'torch/nn/quantized/_reference/modules/linear.py',
'torch/nn/quantized/_reference/modules/rnn.py',
'torch/nn/quantized/_reference/modules/sparse.py',
'torch/nn/quantized/_reference/modules/utils.py',
'torch/nn/quantized/dynamic/__init__.py',
'torch/nn/quantized/dynamic/modules/__init__.py',
'torch/nn/quantized/dynamic/modules/conv.py',
'torch/nn/quantized/dynamic/modules/linear.py',
'torch/nn/quantized/dynamic/modules/rnn.py',
'torch/nn/quantized/functional.py',
'torch/nn/quantized/modules/__init__.py',
'torch/nn/quantized/modules/activation.py',
'torch/nn/quantized/modules/batchnorm.py',
'torch/nn/quantized/modules/conv.py',
'torch/nn/quantized/modules/dropout.py',
'torch/nn/quantized/modules/embedding_ops.py',
'torch/nn/quantized/modules/functional_modules.py',
'torch/nn/quantized/modules/linear.py',
'torch/nn/quantized/modules/normalization.py',
'torch/nn/quantized/modules/rnn.py',
'torch/nn/quantized/modules/utils.py',
'torch/signal/__init__.py',
'torch/signal/windows/__init__.py',
'torch/signal/windows/windows.py',
'torch/sparse/__init__.py',
'torch/sparse/_semi_structured_conversions.py',
'torch/sparse/_triton_ops.py',
'torch/sparse/semi_structured.py',
'torch/special/__init__.py',
'torch/storage.py',
'torch/testing/_internal/__init__.py',
'torch/testing/_internal/autocast_test_lists.py',
'torch/testing/_internal/autograd_function_db.py',
'torch/testing/_internal/check_kernel_launches.py',
'torch/testing/_internal/codegen/__init__.py',
'torch/testing/_internal/codegen/random_topo_test.py',
'torch/testing/_internal/common_cuda.py',
'torch/testing/_internal/common_distributed.py',
'torch/testing/_internal/common_jit.py',
'torch/testing/_internal/common_methods_invocations.py',
'torch/testing/_internal/common_modules.py',
'torch/testing/_internal/common_nn.py',
'torch/testing/_internal/common_pruning.py',
'torch/testing/_internal/common_quantization.py',
'torch/testing/_internal/common_quantized.py',
'torch/testing/_internal/common_subclass.py',
'torch/testing/_internal/common_utils.py',
'torch/testing/_internal/composite_compliance.py',
'torch/testing/_internal/hop_db.py',
'torch/testing/_internal/custom_op_db.py',
'torch/testing/_internal/data/__init__.py',
'torch/testing/_internal/data/network1.py',
'torch/testing/_internal/data/network2.py',
'torch/testing/_internal/dist_utils.py',
'torch/testing/_internal/distributed/__init__.py',
'torch/testing/_internal/distributed/_shard/__init__.py',
'torch/testing/_internal/distributed/_shard/sharded_tensor/__init__.py',
'torch/testing/_internal/distributed/_shard/sharded_tensor/_test_ops_common.py',
'torch/testing/_internal/distributed/_shard/sharded_tensor/_test_st_common.py',
'torch/testing/_internal/distributed/_shard/test_common.py',
'torch/testing/_internal/distributed/_tensor/__init__.py',
'torch/testing/_internal/distributed/_tensor/common_dtensor.py',
'torch/testing/_internal/distributed/ddp_under_dist_autograd_test.py',
'torch/testing/_internal/distributed/distributed_test.py',
'torch/testing/_internal/distributed/distributed_utils.py',
'torch/testing/_internal/distributed/fake_pg.py',
'torch/testing/_internal/distributed/multi_threaded_pg.py',
'torch/testing/_internal/distributed/nn/__init__.py',
'torch/testing/_internal/distributed/nn/api/__init__.py',
'torch/testing/_internal/distributed/nn/api/remote_module_test.py',
'torch/testing/_internal/distributed/rpc/__init__.py',
'torch/testing/_internal/distributed/rpc/dist_autograd_test.py',
'torch/testing/_internal/distributed/rpc/dist_optimizer_test.py',
'torch/testing/_internal/distributed/rpc/examples/__init__.py',
'torch/testing/_internal/distributed/rpc/examples/parameter_server_test.py',
'torch/testing/_internal/distributed/rpc/examples/reinforcement_learning_rpc_test.py',
'torch/testing/_internal/distributed/rpc/faulty_agent_rpc_test.py',
'torch/testing/_internal/distributed/rpc/faulty_rpc_agent_test_fixture.py',
'torch/testing/_internal/distributed/rpc/jit/__init__.py',
'torch/testing/_internal/distributed/rpc/jit/dist_autograd_test.py',
'torch/testing/_internal/distributed/rpc/jit/rpc_test.py',
'torch/testing/_internal/distributed/rpc/jit/rpc_test_faulty.py',
'torch/testing/_internal/distributed/rpc/rpc_agent_test_fixture.py',
'torch/testing/_internal/distributed/rpc/rpc_test.py',
'torch/testing/_internal/distributed/rpc/tensorpipe_rpc_agent_test_fixture.py',
'torch/testing/_internal/distributed/rpc_utils.py',
'torch/testing/_internal/generated/__init__.py',
'torch/testing/_internal/hypothesis_utils.py',
'torch/testing/_internal/inductor_utils.py',
'torch/testing/_internal/jit_metaprogramming_utils.py',
'torch/testing/_internal/jit_utils.py',
'torch/testing/_internal/logging_tensor.py',
'torch/testing/_internal/logging_utils.py',
'torch/testing/_internal/optests/__init__.py',
'torch/testing/_internal/optests/aot_autograd.py',
'torch/testing/_internal/optests/compile_check.py',
'torch/testing/_internal/optests/fake_tensor.py',
'torch/testing/_internal/optests/make_fx.py',
'torch/testing/_internal/quantization_torch_package_models.py',
'torch/testing/_internal/test_module/__init__.py',
'torch/testing/_internal/test_module/future_div.py',
'torch/testing/_internal/test_module/no_future_div.py',
'torch/utils/__init__.py',
'torch/utils/_contextlib.py',
'torch/utils/_cpp_extension_versioner.py',
'torch/utils/_crash_handler.py',
'torch/utils/_device.py',
'torch/utils/_foreach_utils.py',
'torch/utils/_freeze.py',
'torch/utils/_mode_utils.py',
'torch/utils/_python_dispatch.py',
'torch/utils/_stats.py',
'torch/utils/_traceback.py',
'torch/utils/_zip.py',
'torch/utils/backcompat/__init__.py',
'torch/utils/backend_registration.py',
'torch/utils/benchmark/__init__.py',
'torch/utils/benchmark/examples/__init__.py',
'torch/utils/benchmark/examples/blas_compare.py',
'torch/utils/benchmark/examples/blas_compare_setup.py',
'torch/utils/benchmark/examples/compare.py',
'torch/utils/benchmark/examples/end_to_end.py',
'torch/utils/benchmark/examples/fuzzer.py',
'torch/utils/benchmark/examples/op_benchmark.py',
'torch/utils/benchmark/examples/simple_timeit.py',
'torch/utils/benchmark/examples/sparse/compare.py',
'torch/utils/benchmark/examples/sparse/fuzzer.py',
'torch/utils/benchmark/examples/sparse/op_benchmark.py',
'torch/utils/benchmark/examples/spectral_ops_fuzz_test.py',
'torch/utils/benchmark/op_fuzzers/__init__.py',
'torch/utils/benchmark/op_fuzzers/binary.py',
'torch/utils/benchmark/op_fuzzers/sparse_binary.py',
'torch/utils/benchmark/op_fuzzers/sparse_unary.py',
'torch/utils/benchmark/op_fuzzers/spectral.py',
'torch/utils/benchmark/op_fuzzers/unary.py',
'torch/utils/benchmark/utils/__init__.py',
'torch/utils/benchmark/utils/_stubs.py',
'torch/utils/benchmark/utils/common.py',
'torch/utils/benchmark/utils/compare.py',
'torch/utils/benchmark/utils/compile.py',
'torch/utils/benchmark/utils/cpp_jit.py',
'torch/utils/benchmark/utils/fuzzer.py',
'torch/utils/benchmark/utils/sparse_fuzzer.py',
'torch/utils/benchmark/utils/timer.py',
'torch/utils/benchmark/utils/valgrind_wrapper/__init__.py',
'torch/utils/benchmark/utils/valgrind_wrapper/timer_interface.py',
'torch/utils/bottleneck/__init__.py',
'torch/utils/bottleneck/__main__.py',
'torch/utils/bundled_inputs.py',
'torch/utils/checkpoint.py',
'torch/utils/collect_env.py',
'torch/utils/cpp_backtrace.py',
'torch/utils/cpp_extension.py',
'torch/utils/data/__init__.py',
'torch/utils/data/_utils/__init__.py',
'torch/utils/data/_utils/collate.py',
'torch/utils/data/_utils/fetch.py',
'torch/utils/data/_utils/pin_memory.py',
'torch/utils/data/_utils/serialization.py',
'torch/utils/data/_utils/signal_handling.py',
'torch/utils/data/_utils/worker.py',
'torch/utils/data/backward_compatibility.py',
'torch/utils/data/dataloader.py',
'torch/utils/data/datapipes/__init__.py',
'torch/utils/data/datapipes/_decorator.py',
'torch/utils/data/datapipes/_hook_iterator.py',
'torch/utils/data/datapipes/_typing.py',
'torch/utils/data/datapipes/dataframe/__init__.py',
'torch/utils/data/datapipes/dataframe/dataframe_wrapper.py',
'torch/utils/data/datapipes/dataframe/dataframes.py',
'torch/utils/data/datapipes/dataframe/datapipes.py',
'torch/utils/data/datapipes/dataframe/structures.py',
'torch/utils/data/datapipes/datapipe.py',
'torch/utils/data/datapipes/gen_pyi.py',
'torch/utils/data/datapipes/iter/__init__.py',
'torch/utils/data/datapipes/iter/callable.py',
'torch/utils/data/datapipes/iter/combinatorics.py',
'torch/utils/data/datapipes/iter/combining.py',
'torch/utils/data/datapipes/iter/filelister.py',
'torch/utils/data/datapipes/iter/fileopener.py',
'torch/utils/data/datapipes/iter/grouping.py',
'torch/utils/data/datapipes/iter/routeddecoder.py',
'torch/utils/data/datapipes/iter/selecting.py',
'torch/utils/data/datapipes/iter/sharding.py',
'torch/utils/data/datapipes/iter/streamreader.py',
'torch/utils/data/datapipes/iter/utils.py',
'torch/utils/data/datapipes/map/__init__.py',
'torch/utils/data/datapipes/map/callable.py',
'torch/utils/data/datapipes/map/combinatorics.py',
'torch/utils/data/datapipes/map/combining.py',
'torch/utils/data/datapipes/map/grouping.py',
'torch/utils/data/datapipes/map/utils.py',
'torch/utils/data/datapipes/utils/__init__.py',
'torch/utils/data/datapipes/utils/common.py',
'torch/utils/data/datapipes/utils/decoder.py',
'torch/utils/data/datapipes/utils/snapshot.py',
'torch/utils/data/distributed.py',
'torch/utils/data/graph.py',
'torch/utils/data/graph_settings.py',
'torch/utils/data/sampler.py',
'torch/utils/dlpack.py',
'torch/utils/file_baton.py',
'torch/utils/flop_counter.py',
'torch/utils/hipify/__init__.py',
'torch/utils/hipify/constants.py',
'torch/utils/hipify/cuda_to_hip_mappings.py',
'torch/utils/hipify/hipify_python.py',
'torch/utils/hipify/version.py',
'torch/utils/hooks.py',
'torch/utils/jit/__init__.py',
'torch/utils/jit/log_extract.py',
'torch/utils/mkldnn.py',
'torch/utils/mobile_optimizer.py',
'torch/utils/model_dump/__init__.py',
'torch/utils/model_dump/__main__.py',
'torch/utils/model_zoo.py',
'torch/utils/show_pickle.py',
'torch/utils/tensorboard/__init__.py',
'torch/utils/tensorboard/_caffe2_graph.py',
'torch/utils/tensorboard/_convert_np.py',
'torch/utils/tensorboard/_embedding.py',
'torch/utils/tensorboard/_onnx_graph.py',
'torch/utils/tensorboard/_proto_graph.py',
'torch/utils/tensorboard/_pytorch_graph.py',
'torch/utils/tensorboard/_utils.py',
'torch/utils/tensorboard/summary.py',
'torch/utils/tensorboard/writer.py',
'torch/utils/throughput_benchmark.py',
'torch/utils/viz/__init__.py',
'torch/utils/viz/_cycles.py',
'torch/utils/weak.py',
'torch/xpu/_gpu_trace.py',
]
init_command = [
'python3',
'tools/linter/adapters/pip_init.py',
'--dry-run={{DRYRUN}}',
'--no-black-binary',
'black==23.12.1',
'ufmt==2.1.0',
'usort==1.0.6',
]
is_formatter = true
[[linter]]
code = 'COPYRIGHT'
include_patterns = ['**']
exclude_patterns = [
'.lintrunner.toml',
'fb/**',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=Confidential and proprietary',
'--linter-name=COPYRIGHT',
'--error-name=Confidential Code',
"""--error-description=\
Proprietary and confidential source code\
should not be contributed to PyTorch codebase\
""",
'--',
'@{{PATHSFILE}}'
]
[[linter]]
code = 'BAZEL_LINTER'
include_patterns = ['WORKSPACE']
command = [
'python3',
'tools/linter/adapters/bazel_linter.py',
'--binary=.lintbin/bazel',
'--',
'@{{PATHSFILE}}'
]
init_command = [
'python3',
'tools/linter/adapters/s3_init.py',
'--config-json=tools/linter/adapters/s3_init_config.json',
'--linter=bazel',
'--dry-run={{DRYRUN}}',
'--output-dir=.lintbin',
'--output-name=bazel',
]
is_formatter = true
[[linter]]
code = 'LINTRUNNER_VERSION'
include_patterns = ['**']
exclude_patterns = [
'fb/**',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/lintrunner_version_linter.py'
]
[[linter]]
code = 'RUFF'
include_patterns = ['**/*.py', '**/*.pyi']
exclude_patterns = [
'caffe2/**',
'functorch/docs/**',
'functorch/notebooks/**',
'torch/_inductor/fx_passes/serialized_patterns/**',
'scripts/**',
'third_party/**',
'fb/**',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/ruff_linter.py',
'--config=pyproject.toml',
'--show-disable',
'--',
'@{{PATHSFILE}}'
]
init_command = [
'python3',
'tools/linter/adapters/pip_init.py',
'--dry-run={{DRYRUN}}',
'ruff==0.4.8',
]
is_formatter = true
# This linter prevents merge conlicts in csv files in pytorch by enforcing
# three lines of whitespace between entries such that unless people are modifying
# the same line, merge conflicts should not arise in git or hg
[[linter]]
code = 'MERGE_CONFLICTLESS_CSV'
include_patterns = ['benchmarks/dynamo/ci_expected_accuracy/*.csv']
command = [
'python3',
'tools/linter/adapters/no_merge_conflict_csv_linter.py',
'--',
'@{{PATHSFILE}}'
]
is_formatter = true
[[linter]]
code = 'ATEN_CPU_GPU_AGNOSTIC'
include_patterns = [
# aten source
"aten/src/ATen/*.cpp",
"aten/src/ATen/cpu/*.cpp",
"aten/src/ATen/functorch/**/*.cpp",
"aten/src/ATen/nnapi/*.cpp",
"aten/src/ATen/quantized/*.cpp",
"aten/src/ATen/vulkan/*.cpp",
"aten/src/ATen/metal/*.cpp",
"aten/src/ATen/detail/CPUGuardImpl.cpp",
"aten/src/ATen/detail/MetaGuardImpl.cpp",
# aten native source
"aten/src/ATen/native/cpu/*.cpp",
"aten/src/ATen/native/ao_sparse/cpu/kernels/*.cpp",
"aten/src/ATen/native/ao_sparse/quantized/cpu/kernels/*.cpp",
"aten/src/ATen/native/quantized/cpu/kernels/*.cpp",
"aten/src/ATen/native/*.cpp",
"aten/src/ATen/native/cpu/**/*.cpp",
"aten/src/ATen/native/ao_sparse/*.cpp",
"aten/src/ATen/native/ao_sparse/**/*.cpp",
"aten/src/ATen/native/ao_sparse/quantized/*.cpp",
"aten/src/ATen/native/ao_sparse/quantized/**/*.cpp",
"aten/src/ATen/native/nested/*.cpp",
"aten/src/ATen/native/quantized/*.cpp",
"aten/src/ATen/native/quantized/**/*.cpp",
"aten/src/ATen/native/sparse/*.cpp",
"aten/src/ATen/native/transformers/*.cpp",
"aten/src/ATen/native/utils/*.cpp",
"aten/src/ATen/native/xnnpack/*.cpp",
"aten/src/ATen/native/metal/MetalPrepackOpRegister.cpp",
# aten headers
"aten/src/ATen/*.h",
"aten/src/ATen/functorch/**/*.h",
"aten/src/ATen/ops/*.h",
"aten/src/ATen/cpu/**/*.h",
"aten/src/ATen/nnapi/*.h",
"aten/src/ATen/quantized/*.h",
"aten/src/ATen/vulkan/*.h",
"aten/src/ATen/metal/*.h",
"aten/src/ATen/mps/*.h",
# aten native headers
"aten/src/ATen/native/*.h",
"aten/src/ATen/native/cpu/**/*.h",
"aten/src/ATen/native/nested/*.h",
"aten/src/ATen/native/sparse/*.h",
"aten/src/ATen/native/ao_sparse/*.h",
"aten/src/ATen/native/ao_sparse/cpu/*.h",
"aten/src/ATen/native/ao_sparse/quantized/*.h",
"aten/src/ATen/native/ao_sparse/quantized/cpu/*.h",
"aten/src/ATen/native/quantized/*.h",
"aten/src/ATen/native/quantized/cpu/*.h",
"aten/src/ATen/native/transformers/*.h",
"aten/src/ATen/native/quantized/cpu/qnnpack/include/*.h",
"aten/src/ATen/native/utils/*.h",
"aten/src/ATen/native/vulkan/ops/*.h",
"aten/src/ATen/native/xnnpack/*.h",
"aten/src/ATen/native/metal/MetalPrepackOpContext.h",
"aten/src/ATen/native/mps/Copy.h",
"aten/src/ATen/native/mkldnn/**/*.h",
]
exclude_patterns = [
"aten/src/ATen/Context.h",
"aten/src/ATen/Context.cpp",
"aten/src/ATen/DLConvertor.cpp",
"aten/src/ATen/core/Array.h",
"aten/src/ATen/native/quantized/ConvUtils.h",
"aten/src/ATen/native/sparse/SparseBlasImpl.cpp", # triton implementation
"aten/src/ATen/native/transformers/attention.cpp",
"aten/src/ATen/native/**/cudnn/**", # cudnn is cuda specific
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=(^#if.*USE_ROCM.*)|(^#if.*USE_CUDA.*)',
'--linter-name=ATEN_CPU',
'--error-name=aten-cpu should be gpu agnostic',
"""--error-description=\
We strongly discourage the compile-time divergence \
on ATen-CPU code for different GPU code. This \
disallows sharing the same aten-cpu shared object \
between different GPU backends \
""",
'--',
'@{{PATHSFILE}}'
]
is_formatter = true
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/pytorch.git
[email protected]:mirrors/pytorch.git
mirrors
pytorch
pytorch
main

搜索帮助