1 Star 0 Fork 56

Xqh/pytorch

forked from Gitee 极速下载/pytorch 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.lintrunner.toml 80.74 KB
一键复制 编辑 原始数据 按行查看 历史
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236
[[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',
'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.9.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/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/Float8*.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',
'aten/src/ATen/core/TensorImpl_test.cpp',
'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/jit/serialization/import_legacy.cpp',
'torch/csrc/jit/serialization/export.cpp',
'torch/csrc/lazy/**/*',
'torch/csrc/onnx/init.cpp',
'torch/csrc/mps/**/*',
]
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',
'torch/__init__.py', # Skip this file to format because it's part of the public API
# 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_hub.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_fuser_te.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_nestedtensor.py',
'test/test_nn.py',
'test/test_nnapi.py',
'test/test_numba_integration.py',
'test/test_numpy_interop.py',
'test/test_nvfuser_dynamo.py',
'test/test_nvfuser_frontend.py',
'test/test_openmp.py',
'test/test_optim.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_shape_ops.py',
'test/test_show_pickle.py',
'test/test_sort_and_select.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/_higher_order_ops/__init__.py',
'torch/_higher_order_ops/out_dtype.py',
'torch/_higher_order_ops/wrap.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/distributed/__init__.py',
'torch/distributed/_composable_state.py',
'torch/distributed/_shard/__init__.py',
'torch/distributed/_shard/_utils.py',
'torch/distributed/_shard/api.py',
'torch/distributed/_shard/checkpoint/__init__.py',
'torch/distributed/_shard/common_op_utils.py',
'torch/distributed/_shard/metadata.py',
'torch/distributed/_shard/op_registry_utils.py',
'torch/distributed/_shard/sharded_optim/__init__.py',
'torch/distributed/_shard/sharded_optim/api.py',
'torch/distributed/_shard/sharded_tensor/__init__.py',
'torch/distributed/_shard/sharded_tensor/_ops/__init__.py',
'torch/distributed/_shard/sharded_tensor/_ops/_common.py',
'torch/distributed/_shard/sharded_tensor/_ops/binary_cmp.py',
'torch/distributed/_shard/sharded_tensor/_ops/init.py',
'torch/distributed/_shard/sharded_tensor/_ops/misc_ops.py',
'torch/distributed/_shard/sharded_tensor/_ops/tensor_ops.py',
'torch/distributed/_shard/sharded_tensor/api.py',
'torch/distributed/_shard/sharded_tensor/logger.py',
'torch/distributed/_shard/sharded_tensor/logging_handlers.py',
'torch/distributed/_shard/sharded_tensor/metadata.py',
'torch/distributed/_shard/sharded_tensor/reshard.py',
'torch/distributed/_shard/sharded_tensor/shard.py',
'torch/distributed/_shard/sharded_tensor/utils.py',
'torch/distributed/_shard/sharder.py',
'torch/distributed/_shard/sharding_plan/__init__.py',
'torch/distributed/_shard/sharding_plan/api.py',
'torch/distributed/_shard/sharding_spec/__init__.py',
'torch/distributed/_shard/sharding_spec/_internals.py',
'torch/distributed/_shard/sharding_spec/api.py',
'torch/distributed/_shard/sharding_spec/chunk_sharding_spec.py',
'torch/distributed/_shard/sharding_spec/chunk_sharding_spec_ops/__init__.py',
'torch/distributed/_shard/sharding_spec/chunk_sharding_spec_ops/_common.py',
'torch/distributed/_shard/sharding_spec/chunk_sharding_spec_ops/embedding.py',
'torch/distributed/_shard/sharding_spec/chunk_sharding_spec_ops/embedding_bag.py',
'torch/distributed/_sharded_tensor/__init__.py',
'torch/distributed/_sharding_spec/__init__.py',
'torch/distributed/_tools/__init__.py',
'torch/distributed/_tools/memory_tracker.py',
'torch/distributed/algorithms/__init__.py',
'torch/distributed/algorithms/_checkpoint/__init__.py',
'torch/distributed/algorithms/_checkpoint/checkpoint_wrapper.py',
'torch/distributed/algorithms/_comm_hooks/__init__.py',
'torch/distributed/algorithms/_comm_hooks/default_hooks.py',
'torch/distributed/algorithms/_optimizer_overlap/__init__.py',
'torch/distributed/algorithms/_optimizer_overlap/optimizer_overlap.py',
'torch/distributed/algorithms/_quantization/__init__.py',
'torch/distributed/algorithms/_quantization/quantization.py',
'torch/distributed/algorithms/ddp_comm_hooks/__init__.py',
'torch/distributed/algorithms/ddp_comm_hooks/ddp_zero_hook.py',
'torch/distributed/algorithms/ddp_comm_hooks/debugging_hooks.py',
'torch/distributed/algorithms/ddp_comm_hooks/default_hooks.py',
'torch/distributed/algorithms/ddp_comm_hooks/mixed_precision_hooks.py',
'torch/distributed/algorithms/ddp_comm_hooks/optimizer_overlap_hooks.py',
'torch/distributed/algorithms/ddp_comm_hooks/post_localSGD_hook.py',
'torch/distributed/algorithms/ddp_comm_hooks/powerSGD_hook.py',
'torch/distributed/algorithms/ddp_comm_hooks/quantization_hooks.py',
'torch/distributed/algorithms/join.py',
'torch/distributed/algorithms/model_averaging/__init__.py',
'torch/distributed/algorithms/model_averaging/averagers.py',
'torch/distributed/algorithms/model_averaging/hierarchical_model_averager.py',
'torch/distributed/algorithms/model_averaging/utils.py',
'torch/distributed/argparse_util.py',
'torch/distributed/autograd/__init__.py',
'torch/distributed/benchmarks/benchmark_ddp_rpc.py',
'torch/distributed/c10d_logger.py',
'torch/distributed/collective_utils.py',
'torch/distributed/constants.py',
'torch/distributed/distributed_c10d.py',
'torch/distributed/elastic/__init__.py',
'torch/distributed/elastic/agent/__init__.py',
'torch/distributed/elastic/agent/server/__init__.py',
'torch/distributed/elastic/agent/server/api.py',
'torch/distributed/elastic/agent/server/local_elastic_agent.py',
'torch/distributed/elastic/events/__init__.py',
'torch/distributed/elastic/events/api.py',
'torch/distributed/elastic/events/handlers.py',
'torch/distributed/elastic/metrics/__init__.py',
'torch/distributed/elastic/metrics/api.py',
'torch/distributed/elastic/multiprocessing/__init__.py',
'torch/distributed/elastic/multiprocessing/api.py',
'torch/distributed/elastic/multiprocessing/errors/__init__.py',
'torch/distributed/elastic/multiprocessing/errors/error_handler.py',
'torch/distributed/elastic/multiprocessing/errors/handlers.py',
'torch/distributed/elastic/multiprocessing/redirects.py',
'torch/distributed/elastic/multiprocessing/tail_log.py',
'torch/distributed/elastic/rendezvous/__init__.py',
'torch/distributed/elastic/rendezvous/api.py',
'torch/distributed/elastic/rendezvous/c10d_rendezvous_backend.py',
'torch/distributed/elastic/rendezvous/dynamic_rendezvous.py',
'torch/distributed/elastic/rendezvous/etcd_rendezvous.py',
'torch/distributed/elastic/rendezvous/etcd_rendezvous_backend.py',
'torch/distributed/elastic/rendezvous/etcd_server.py',
'torch/distributed/elastic/rendezvous/etcd_store.py',
'torch/distributed/elastic/rendezvous/registry.py',
'torch/distributed/elastic/rendezvous/static_tcp_rendezvous.py',
'torch/distributed/elastic/rendezvous/utils.py',
'torch/distributed/elastic/timer/__init__.py',
'torch/distributed/elastic/timer/api.py',
'torch/distributed/elastic/timer/file_based_local_timer.py',
'torch/distributed/elastic/timer/local_timer.py',
'torch/distributed/elastic/utils/__init__.py',
'torch/distributed/elastic/utils/api.py',
'torch/distributed/elastic/utils/data/__init__.py',
'torch/distributed/elastic/utils/data/cycling_iterator.py',
'torch/distributed/elastic/utils/data/elastic_distributed_sampler.py',
'torch/distributed/elastic/utils/distributed.py',
'torch/distributed/elastic/utils/log_level.py',
'torch/distributed/elastic/utils/logging.py',
'torch/distributed/elastic/utils/store.py',
'torch/distributed/examples/memory_tracker_example.py',
'torch/distributed/launch.py',
'torch/distributed/launcher/__init__.py',
'torch/distributed/launcher/api.py',
'torch/distributed/logging_handlers.py',
'torch/distributed/nn/__init__.py',
'torch/distributed/nn/api/__init__.py',
'torch/distributed/nn/api/remote_module.py',
'torch/distributed/nn/functional.py',
'torch/distributed/nn/jit/__init__.py',
'torch/distributed/nn/jit/instantiator.py',
'torch/distributed/nn/jit/templates/__init__.py',
'torch/distributed/nn/jit/templates/remote_module_template.py',
'torch/distributed/optim/__init__.py',
'torch/distributed/optim/apply_optimizer_in_backward.py',
'torch/distributed/optim/functional_adadelta.py',
'torch/distributed/optim/functional_adagrad.py',
'torch/distributed/optim/functional_adam.py',
'torch/distributed/optim/functional_adamax.py',
'torch/distributed/optim/functional_adamw.py',
'torch/distributed/optim/functional_rmsprop.py',
'torch/distributed/optim/functional_rprop.py',
'torch/distributed/optim/functional_sgd.py',
'torch/distributed/optim/named_optimizer.py',
'torch/distributed/optim/optimizer.py',
'torch/distributed/optim/post_localSGD_optimizer.py',
'torch/distributed/optim/utils.py',
'torch/distributed/optim/zero_redundancy_optimizer.py',
'torch/distributed/pipeline/__init__.py',
'torch/distributed/pipeline/sync/__init__.py',
'torch/distributed/pipeline/sync/_balance/__init__.py',
'torch/distributed/pipeline/sync/_balance/blockpartition.py',
'torch/distributed/pipeline/sync/_balance/profile.py',
'torch/distributed/pipeline/sync/batchnorm.py',
'torch/distributed/pipeline/sync/checkpoint.py',
'torch/distributed/pipeline/sync/copy.py',
'torch/distributed/pipeline/sync/dependency.py',
'torch/distributed/pipeline/sync/microbatch.py',
'torch/distributed/pipeline/sync/phony.py',
'torch/distributed/pipeline/sync/pipe.py',
'torch/distributed/pipeline/sync/pipeline.py',
'torch/distributed/pipeline/sync/skip/__init__.py',
'torch/distributed/pipeline/sync/skip/layout.py',
'torch/distributed/pipeline/sync/skip/namespace.py',
'torch/distributed/pipeline/sync/skip/portal.py',
'torch/distributed/pipeline/sync/skip/skippable.py',
'torch/distributed/pipeline/sync/skip/tracker.py',
'torch/distributed/pipeline/sync/stream.py',
'torch/distributed/pipeline/sync/utils.py',
'torch/distributed/pipeline/sync/worker.py',
'torch/distributed/remote_device.py',
'torch/distributed/rendezvous.py',
'torch/distributed/rpc/__init__.py',
'torch/distributed/rpc/_testing/__init__.py',
'torch/distributed/rpc/_testing/faulty_agent_backend_registry.py',
'torch/distributed/rpc/_utils.py',
'torch/distributed/rpc/api.py',
'torch/distributed/rpc/backend_registry.py',
'torch/distributed/rpc/constants.py',
'torch/distributed/rpc/functions.py',
'torch/distributed/rpc/internal.py',
'torch/distributed/rpc/options.py',
'torch/distributed/rpc/rref_proxy.py',
'torch/distributed/rpc/server_process_global_profiler.py',
'torch/distributed/run.py',
'torch/distributed/tensor/__init__.py',
'torch/distributed/tensor/parallel/__init__.py',
'torch/distributed/tensor/parallel/_utils.py',
'torch/distributed/tensor/parallel/_view_with_dim_change.py',
'torch/distributed/tensor/parallel/api.py',
'torch/distributed/tensor/parallel/fsdp.py',
'torch/distributed/tensor/parallel/input_reshard.py',
'torch/distributed/tensor/parallel/multihead_attention_tp.py',
'torch/distributed/tensor/parallel/style.py',
'torch/distributed/utils.py',
'torch/fft/__init__.py',
'torch/func/__init__.py',
'torch/functional.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/hub.py',
'torch/library.py',
'torch/linalg/__init__.py',
# UFMT causes import cycle on masked
'torch/masked/__init__.py',
'torch/masked/_docs.py',
'torch/masked/_ops.py',
'torch/masked/maskedtensor/__init__.py',
'torch/masked/maskedtensor/_ops_refs.py',
'torch/masked/maskedtensor/binary.py',
'torch/masked/maskedtensor/core.py',
'torch/masked/maskedtensor/creation.py',
'torch/masked/maskedtensor/passthrough.py',
'torch/masked/maskedtensor/reductions.py',
'torch/masked/maskedtensor/unary.py',
'torch/monitor/__init__.py',
'torch/nested/__init__.py',
'torch/nn/__init__.py',
'torch/nn/_reduction.py',
'torch/nn/backends/__init__.py',
'torch/nn/backends/thnn.py',
'torch/nn/common_types.py',
'torch/nn/cpp.py',
'torch/nn/functional.py',
'torch/nn/grad.py',
'torch/nn/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/modules/__init__.py',
'torch/nn/modules/_functions.py',
'torch/nn/modules/activation.py',
'torch/nn/modules/adaptive.py',
'torch/nn/modules/batchnorm.py',
'torch/nn/modules/channelshuffle.py',
'torch/nn/modules/container.py',
'torch/nn/modules/conv.py',
'torch/nn/modules/distance.py',
'torch/nn/modules/dropout.py',
'torch/nn/modules/flatten.py',
'torch/nn/modules/fold.py',
'torch/nn/modules/instancenorm.py',
'torch/nn/modules/lazy.py',
'torch/nn/modules/linear.py',
'torch/nn/modules/loss.py',
'torch/nn/modules/module.py',
'torch/nn/modules/normalization.py',
'torch/nn/modules/padding.py',
'torch/nn/modules/pixelshuffle.py',
'torch/nn/modules/pooling.py',
'torch/nn/modules/rnn.py',
'torch/nn/modules/sparse.py',
'torch/nn/modules/transformer.py',
'torch/nn/modules/upsampling.py',
'torch/nn/modules/utils.py',
'torch/nn/parallel/__init__.py',
'torch/nn/parallel/_functions.py',
'torch/nn/parallel/comm.py',
'torch/nn/parallel/data_parallel.py',
'torch/nn/parallel/parallel_apply.py',
'torch/nn/parallel/replicate.py',
'torch/nn/parallel/scatter_gather.py',
'torch/nn/parameter.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/nn/utils/__init__.py',
'torch/nn/utils/_deprecation_utils.py',
'torch/nn/utils/_expanded_weights/__init__.py',
'torch/nn/utils/_expanded_weights/conv_expanded_weights.py',
'torch/nn/utils/_expanded_weights/conv_utils.py',
'torch/nn/utils/_expanded_weights/embedding_expanded_weights.py',
'torch/nn/utils/_expanded_weights/expanded_weights_impl.py',
'torch/nn/utils/_expanded_weights/expanded_weights_utils.py',
'torch/nn/utils/_expanded_weights/group_norm_expanded_weights.py',
'torch/nn/utils/_expanded_weights/instance_norm_expanded_weights.py',
'torch/nn/utils/_expanded_weights/layer_norm_expanded_weights.py',
'torch/nn/utils/_expanded_weights/linear_expanded_weights.py',
'torch/nn/utils/_per_sample_grad.py',
'torch/nn/utils/clip_grad.py',
'torch/nn/utils/convert_parameters.py',
'torch/nn/utils/fusion.py',
'torch/nn/utils/init.py',
'torch/nn/utils/memory_format.py',
'torch/nn/utils/parametrizations.py',
'torch/nn/utils/parametrize.py',
'torch/nn/utils/prune.py',
'torch/nn/utils/rnn.py',
'torch/nn/utils/spectral_norm.py',
'torch/nn/utils/weight_norm.py',
'torch/overrides.py',
'torch/quasirandom.py',
'torch/random.py',
'torch/return_types.py',
'torch/serialization.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_device_type.py',
'torch/testing/_internal/common_distributed.py',
'torch/testing/_internal/common_dtype.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/pipe_with_ddp_test.py',
'torch/testing/_internal/distributed/pipeline/__init__.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.4',
]
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xqh142857/pytorch.git
git@gitee.com:xqh142857/pytorch.git
xqh142857
pytorch
pytorch
main

搜索帮助