Skip to content

Commit

Permalink
Replaced deprecated pkg_resources.packaging with packaging module (py…
Browse files Browse the repository at this point in the history
…torch#113023)

Usage of `from pkg_resources import packaging` leads to a deprecation warning:
```
DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
```
and in strict tests where warnings are errors, this leads to CI breaks, e.g.: pytorch/vision#8092

Replacing `pkg_resources.package` with `package` as it is now a pytorch dependency:
https://github.com/pytorch/pytorch/blob/fa9045a8725214c05ae4dcec5a855820b861155e/requirements.txt#L19
Pull Request resolved: pytorch#113023
Approved by: https://github.com/Skylion007, https://github.com/malfet
  • Loading branch information
vfdev-5 authored and jeffdaily committed May 29, 2024
1 parent ae01701 commit 2e4abc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torch/utils/cpp_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -2335,7 +2335,8 @@ def sanitize_flags(flags):
cuda_compile_rule = ['rule cuda_compile']
nvcc_gendeps = ''
# --generate-dependencies-with-compile is not supported by ROCm
if torch.version.cuda is not None:
# Nvcc flag `--generate-dependencies-with-compile` is not supported by sccache, which may increase build time.
if torch.version.cuda is not None and os.getenv('TORCH_EXTENSION_SKIP_NVCC_GEN_DEPENDENCIES', '0') != '1':
cuda_compile_rule.append(' depfile = $out.d')
cuda_compile_rule.append(' deps = gcc')
# Note: non-system deps with nvcc are only supported
Expand Down

0 comments on commit 2e4abc8

Please sign in to comment.