PyTorch removes 3 dead CMake branches in PR #190468
Three unreachable code paths eliminated to streamline build system logic.
A recent pull request (PR #190468) against the PyTorch repository removes three unreachable CMake branches, cleaning up code that could never execute under current build constraints. The PR, authored by cyyever and approved by albanD, targets specific files in the PyTorch build system.
The first removed branch handled a pre-CUDA-12.1 `--source-in-ptx` flag in `cmake/public/cuda.cmake`, but since `cuda.cmake` already rejects CUDA versions below 12.1 with a `FATAL_ERROR`, the condition `VERSION_LESS 12.1` was always false. The second deletion removes a skip for `-Wunused-private-field` in `cmake/public/utils.cmake` because PR #150077 replaced individual `-Wunused-*` flags with the blanket `-Wunused`, making the skip dead code. The third removal eliminates a duplicate CUDA+ROCm mutual-exclusion check in `aten/src/ATen/CMakeLists.txt`; the same check already runs earlier in `aten/CMakeLists.txt`, so the inner one could never fire. These changes reduce confusion and make the build files more maintainable.
- Removed pre-CUDA-12.1 `--source-in-ptx` branch: condition was always false because CUDA <12.1 is already rejected.
- Removed `-Wunused-private-field` skip: PR #150077 replaced individual `-Wunused*` options with a single `-Wunused`.
- Removed duplicate CUDA+ROCm mutual-exclusion check: identical FATAL_ERROR already exists in parent `aten/CMakeLists.txt`.
Why It Matters
Cleaner build configuration reduces confusion for PyTorch contributors and future maintenance overhead.