Developer Tools

PyTorch removes 3 dead build variables in CMake cleanup PR #190469

Empty variables and missing directories removed from aten and caffe2 CMake.

Deep Dive

PyTorch maintainer cyyever has merged a clean-up pull request ( #190469 ) that eliminates three dead source-collection variables from the project's CMake files. The first, `ATen_HIP_SRCS_W_SORT_BY_KEY`, was introduced as an empty variable in PR #35581 for symmetry with a CUDA-specific workaround for nvcc separable compilation. Under ROCm (AMD's HIP platform), the sorted sources flow through the regular `ATen_HIP_SRCS` glob, so this variable never received any files. The live CUDA counterparts are left untouched.

The second variable, `FLASH_ATTENTION_CUDA_SOURCES`, was added in PR #111886 as a mirror of `MEM_EFF_ATTENTION_CUDA_SOURCES`, but no consumer ever read it—the MSVC `/Zc:lambda` loop only processes the MEM_EFF list. Since PR #146372, the referenced `${flash_attention_cuda_cu}` is no longer defined, making the variable entirely inert. Finally, the MTIA globs and `ATen_MTIA_SRCS` plumbing are removed because `aten/src/ATen/mtia/` never existed in the open-source tree, and the `native/mtia/` directory was deleted in PR #176980. The `USE_MTIA` option and the `--mtia` torchgen flag remain active—they control MTIA dispatch-key code generation, and internal MTIA builds continue to use Buck instead of CMakeLists.

Key Points
  • ATen_HIP_SRCS_W_SORT_BY_KEY was an empty variable from PR #35581 that never had files appended.
  • FLASH_ATTENTION_CUDA_SOURCES was a dead mirror of MEM_EFF_ATTENTION_CUDA_SOURCES, never consumed since PR #146372.
  • MTIA globs removed because the source directories never existed in OSS; internal MTIA builds use Buck.

Why It Matters

Removing dead code reduces build system complexity and maintenance burden for PyTorch contributors.

📬 Get the top 10 AI stories daily