diff --git a/.github/workflows/metax-build-and-test.yml b/.github/workflows/metax-build-and-test.yml index 28f471fc0..0e635d74e 100644 --- a/.github/workflows/metax-build-and-test.yml +++ b/.github/workflows/metax-build-and-test.yml @@ -12,7 +12,7 @@ concurrency: jobs: metax-build-and-test: - runs-on: metax + runs-on: flagtree-metax if: ${{ github.repository == 'FlagTree/flagtree' || github.repository == 'flagos-ai/flagtree' }} steps: - name: Setup environment diff --git a/python/setup_tools/setup_helper.py b/python/setup_tools/setup_helper.py index 2a0c20bb7..1d52c2b31 100644 --- a/python/setup_tools/setup_helper.py +++ b/python/setup_tools/setup_helper.py @@ -330,7 +330,7 @@ def handle_plugin_backend(editable): plugin_mode = os.getenv("FLAGTREE_PLUGIN") if plugin_mode and plugin_mode.upper() not in ["0", "OFF"]: return - if flagtree_backend in ["iluvatar", "mthreads", "sunrise"]: + if flagtree_backend in ["iluvatar", "mthreads", "metax", "sunrise"]: flagtree_backend_dir = Path.home() / ".flagtree" / flagtree_backend flagtree_plugin_so = flagtree_backend + "TritonPlugin.so" if editable is False: @@ -341,7 +341,7 @@ def handle_plugin_backend(editable): dst_build_plugin_path = dst_build_plugin_dir / flagtree_plugin_so 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"): + if flagtree_backend in ("mthreads", "metax", "sunrise"): dst_install_plugin_dir = Path( __file__).resolve().parent.parent.parent / "third_party" / flagtree_backend / "python" / "triton" / "_C" else: diff --git a/third_party/metax/CMakeLists.txt b/third_party/metax/CMakeLists.txt index 5a39b450f..0dfe0e3a8 100644 --- a/third_party/metax/CMakeLists.txt +++ b/third_party/metax/CMakeLists.txt @@ -1,6 +1,14 @@ add_subdirectory(include) add_subdirectory(lib) +option(EDITABLE_MODE "Build in developer (editable) mode" OFF) +if(FLAGTREE_PLUGIN) + set(METAX_PLUGIN_DIR "${Python3_SITELIB}/triton/_C") +elseif(EDITABLE_MODE) + set(METAX_PLUGIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +else() + set(METAX_PLUGIN_DIR "${Python3_SITELIB}/triton/_C") +endif() if(TRITON_BUILD_PYTHON_MODULE) if(FLAGTREE_PLUGIN) add_subdirectory(plugin) @@ -12,7 +20,7 @@ if(TRITON_BUILD_PYTHON_MODULE) NAMES metaxTritonPlugin.so PATHS - ${CMAKE_CURRENT_SOURCE_DIR} + ${METAX_PLUGIN_DIR} REQUIRED ) add_triton_plugin(TritonMetax