Skip to content
Open
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
7 changes: 4 additions & 3 deletions python/setup_tools/setup_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ def handle_flagtree_backend():
print(f"\033[1;32m[INFO] FlagtreeBackend is {configs.flagtree_backend}\033[0m")
configs.extend_backends.append(configs.flagtree_backend)
if "editable_wheel" in sys.argv and configs.flagtree_backend not in configs.plugin_backends:
ext_sourcedir = os.path.abspath(f"./third_party/{configs.flagtree_backend}/python/{ext_sourcedir}") + "/"
configs.ext_sourcedir = os.path.abspath(
f"./third_party/{configs.flagtree_backend}/python/{configs.ext_sourcedir}") + "/"


def handle_plugin_backend(editable):
Expand All @@ -310,6 +311,8 @@ def handle_plugin_backend(editable):
os.makedirs(dst_build_plugin_dir)
dst_build_plugin_path = dst_build_plugin_dir / flagtree_plugin_so
shutil.copy(src_build_plugin_path, dst_build_plugin_path)
dst_build_plugin_path = Path(__file__).resolve().parent.parent.parent / "python" / "triton" / "_C"
shutil.copy(src_build_plugin_path, dst_build_plugin_path)
src_install_plugin_path = flagtree_backend_dir / flagtree_plugin_so
if flagtree_backend in ("mthreads", "sunrise"):
dst_install_plugin_dir = Path(
Expand Down Expand Up @@ -362,8 +365,6 @@ def uninstall_triton():
download_flagtree_third_party("flir", condition=(flagtree_backend == "aipu"), hock=utils.aipu.precompile_hock,
required=True)

handle_plugin_backend(False)

handle_flagtree_backend()

cache = FlagTreeCache()
Expand Down
11 changes: 9 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ def build_extension(self, ext):
thirdparty_cmake_args = get_thirdparty_packages([get_llvm_package_info()])
thirdparty_cmake_args += self.get_pybind11_cmake_args()
extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.path)))
wheeldir = os.path.dirname(extdir)
print(f"extdir {extdir}")
wheeldir = os.path.dirname(os.path.dirname(extdir))

# create build directories
if not os.path.exists(self.build_temp):
Expand Down Expand Up @@ -713,6 +714,11 @@ def add_link_to_backends(external_only):
package_data_tools = ["compile.h", "compile.c"]
if helper.flagtree_backend == "xpu":
package_data_tools += ["compile_xpu.h", "compile_xpu.c"]

if helper.flagtree_backend == "sunrise":
package_data = {"": ["*TritonPlugin.so"]}
else:
package_data = {}
# package_data = {
# "triton/tools/extra": sum((b.tools_package_data for b in backends), []),
# **{f"triton/backends/{b.name}": b.package_data
Expand Down Expand Up @@ -855,8 +861,9 @@ def get_git_version_suffix():
packages=list(get_packages()),
package_dir=dict(get_package_dirs()),
entry_points=get_entry_points(),
package_data=package_data,
include_package_data=True,
ext_modules=[CMakeExtension("triton", "triton/_C/")],
ext_modules=[CMakeExtension("triton", helper.configs.ext_sourcedir)],
cmdclass={
"bdist_wheel": plugin_bdist_wheel,
"build_ext": CMakeBuild,
Expand Down
2 changes: 1 addition & 1 deletion third_party/sunrise/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ option(EDITABLE_MODE "Build in developer (editable) mode" OFF)
if(FLAGTREE_PLUGIN)
set(SUNRISE_PLUGIN_DIR "${Python3_SITELIB}/triton/_C")
elseif(EDITABLE_MODE)
set(SUNRISE_PLUGIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(SUNRISE_PLUGIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/python/triton/_C")
else()
set(SUNRISE_PLUGIN_DIR "${Python3_SITELIB}/triton/_C")
endif()
Expand Down
1 change: 1 addition & 0 deletions third_party/sunrise/python/triton/backends
47 changes: 0 additions & 47 deletions third_party/sunrise/python/triton/backends/__init__.py

This file was deleted.

90 changes: 0 additions & 90 deletions third_party/sunrise/python/triton/backends/compiler.py

This file was deleted.

84 changes: 0 additions & 84 deletions third_party/sunrise/python/triton/backends/driver.py

This file was deleted.

Loading