Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions build_tools/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@ def get_build_ext(
class _CMakeBuildExtension(extension_cls):
"""Setuptools command with support for CMake extension modules"""

def finalize_options(self) -> None:
super().finalize_options()
# Persist the intermediate object directory (build_temp) across builds.
# Framework extensions (e.g. transformer_engine_torch) are compiled by
# setuptools/pip into build_temp, but pip normally points it at an
# ephemeral temp dir, so every `pip install` recompiles all objects from
# scratch. Rooting it at a stable location lets the underlying ninja skip
# unchanged objects. Mirrors the persistent CMake build dir above.
root_dir = Path(__file__).resolve().parent.parent
Comment thread
ipanfilo marked this conversation as resolved.
build_temp = root_dir / "build" / "ext_temp"
build_temp.mkdir(parents=True, exist_ok=True)
self.build_temp = str(build_temp)

def run(self) -> None:
# Build CMake extensions
for ext in self.extensions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "common/util/cuda_runtime.h"
#include "../../common.h"
#include "../../common/util/system.h"
#include "../../util/system.h"

#include "ck_tile/core.hpp"
#include "ck_tile/host/kernel_launch.hpp"
Expand Down
Loading