Revert "[HOTFIX] Disable DISTRIBUTED_C10D_DIRECT_ACCESS for now (#161946)"

This reverts commit 5561e45758.

Reverted https://github.com/pytorch/pytorch/pull/161946 on behalf of https://github.com/jeanschmidt due to Need to be reverted so https://github.com/pytorch/pytorch/pull/159889 can be ([comment](https://github.com/pytorch/pytorch/pull/161946#issuecomment-3246663376))
This commit is contained in:
PyTorch MergeBot 2025-09-02 20:18:52 +00:00
parent b4ad38279b
commit 82f63c8f6d

View File

@ -1801,3 +1801,26 @@ command = [
"python3",
"tools/linter/adapters/gb_registry_linter.py",
]
[[linter]]
code = 'DISTRIBUTED_C10D_DIRECT_ACCESS'
include_patterns = ['**/*.py']
exclude_patterns = [
'torch/distributed/_distributed_c10d.py',
'fb/**',
'**/fb/**',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
'--pattern=torch\._C\._distributed_c10d',
'--linter-name=DISTRIBUTED_C10D_DIRECT_ACCESS',
'--error-name=direct access to torch._C._distributed_c10d',
"""--error-description=\
Never access torch._C._distributed_c10d directly in code. Always \
import from and use torch.distributed._distributed_c10d which is \
guaranteed to have all functions available\
""",
'--',
'@{{PATHSFILE}}'
]