diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a96d0caf..bafab148c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.20.0) -project(pybuda LANGUAGES CXX) +project(ttforge LANGUAGES CXX) find_program(CLANG_17 clang++-17) find_program(CLANG clang) @@ -8,7 +8,7 @@ if(CLANG_17 AND CLANG) set(CMAKE_CXX_COMPILER "${CLANG_17}") set(CMAKE_C_COMPILER "${CLANG}") else() - message(WARNING "Clang++-17 or clang not found!!!") + message(FATAL_ERROR "Clang++-17 or clang not found!!!") endif() set(CMAKE_CXX_STANDARD 17) @@ -19,13 +19,13 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) include(Utils) -check_required_env_var(PYBUDA_PYTHON_VERSION) -check_required_env_var(PYBUDA_TOOLCHAIN_DIR) -check_required_env_var(PYBUDA_VENV_DIR) +check_required_env_var(TTFORGE_PYTHON_VERSION) +check_required_env_var(TTFORGE_TOOLCHAIN_DIR) +check_required_env_var(TTFORGE_VENV_DIR) -set(PYBUDA_PYTHON_VERSION $ENV{PYBUDA_PYTHON_VERSION}) -set(PYBUDA_TOOLCHAIN_DIR $ENV{PYBUDA_TOOLCHAIN_DIR}) -set(PYBUDA_VENV_DIR $ENV{PYBUDA_VENV_DIR}) +set(TTFORGE_PYTHON_VERSION $ENV{TTFORGE_PYTHON_VERSION}) +set(TTFORGE_TOOLCHAIN_DIR $ENV{TTFORGE_TOOLCHAIN_DIR}) +set(TTFORGE_VENV_DIR $ENV{TTFORGE_VENV_DIR}) set(TTMLIR_TOOLCHAIN_DIR $ENV{TTMLIR_TOOLCHAIN_DIR}) set(TTMLIR_VENV_DIR $ENV{TTMLIR_VENV_DIR}) @@ -36,9 +36,9 @@ endif() add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wno-unused-parameter) -set(PYBUDA_CSRC_WARNINGS -Wall -Wextra -Wno-pragmas -Wno-unused-parameter) +set(TTFORGE_CSRC_WARNINGS -Wall -Wextra -Wno-pragmas -Wno-unused-parameter) set(CFLAGS_NO_WARN -DFMT_HEADER_ONLY) -set(PYBUDA_CSRC_CFLAGS ${CFLAGS_NO_WARN} ${PYBUDA_CSRC_WARNINGS} -DUTILS_LOGGER_PYTHON_OSTREAM_REDIRECT=1) +set(TTFORGE_CSRC_CFLAGS ${CFLAGS_NO_WARN} ${TTFORGE_CSRC_WARNINGS} -DUTILS_LOGGER_PYTHON_OSTREAM_REDIRECT=1) set(CONFIG_LDFLAGS "") diff --git a/README.md b/README.md index fe1d360e3..660bd9372 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,35 @@ -### Building dependencies -* `cmake` -* `clang` -* `Ninja` - sudo apt-get install ninja-build +Building dependencies +----- +* `cmake3.20` +* `clang` and `clang++-17` +* `Ninja` +* `Python3.10` -### Building environment -This is one off step. It will pull all dependencies needed for tt-forge. +Building environment +----- +This is one off step to build the toolchain and create virtual environment for tt-forge. +Generally you need to run this step only once, unless you want to update the toolchain. * `git submodule update --init --recursive -f` * `source env/activate` * `cmake -B env/build env` * `cmake --build env/build` -### Build tt-forge +Build tt-forge +----- * `source env/activate` * `cmake -G Ninja -B build .` * `cmake --build build` -### Cleanup +Cleanup +----- * `rm -rf build` - to cleanup tt-forge build artifacts. * `./clean_all.sh` - to cleanup all build artifacts (tt-forge/tvm/tt-mlir/tt-metal). This will not remove toolchain dependencies. -### Environment variables: +Environment variables: +----- * `TTMLIR_TOOLCHAIN_DIR` - points to toolchain dir where dependencies of TTLMIR will be installed. If not defined it defaults to /opt/ttmlir-toolchain * `TTMLIR_VENV_DIR` - points to virtual environment directory of TTMLIR.If not defined it defaults to /opt/ttmlir-toolchain/venv -* `PYBUDA_TOOLCHAIN_DIR` - points to toolchain dir where dependencies of PyBuda will be installed. If not defined it defaults to /opt/pybuda-toolchain -* `PYBUDA_VENV_DIR` - points to virtual environment directory of tt-forge. If not defined it defaults to /opt/pybuda-toolchain/venv -* `PYBUDA_PYTHON_VERSION` - set to override python version. If not defined it defaults to python3.10 +* `TTFORGE_TOOLCHAIN_DIR` - points to toolchain dir where dependencies of tt-forge will be installed. If not defined it defaults to /opt/ttforge-toolchain +* `TTFORGE_VENV_DIR` - points to virtual environment directory of tt-forge. If not defined it defaults to /opt/ttforge-toolchain/venv +* `TTFORGE_PYTHON_VERSION` - set to override python version. If not defined it defaults to python3.10 diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake index da33ba8e7..26c58a7e3 100644 --- a/cmake/Utils.cmake +++ b/cmake/Utils.cmake @@ -1,4 +1,4 @@ -### Utility functions for pybuda ### +### Utility functions for tt-forge ### ### Check if an environment variable exists ### function(check_env_variable_internal VARIABLE_NAME ret) diff --git a/env/CMakeLists.txt b/env/CMakeLists.txt index 66cef1a2d..ebeb8fce2 100644 --- a/env/CMakeLists.txt +++ b/env/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.20.0) -project(pybuda-toolchain LANGUAGES CXX) +project(ttforge-toolchain LANGUAGES CXX) # Get parent directory of current source directory get_filename_component(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) @@ -9,19 +9,19 @@ list(APPEND CMAKE_MODULE_PATH ${PARENT_DIR}/cmake) include(Utils) # Check if the environment variable is set, if not error out -check_required_env_var(PYBUDA_PYTHON_VERSION) -check_required_env_var(PYBUDA_TOOLCHAIN_DIR) -check_required_env_var(PYBUDA_VENV_DIR) +check_required_env_var(TTFORGE_PYTHON_VERSION) +check_required_env_var(TTFORGE_TOOLCHAIN_DIR) +check_required_env_var(TTFORGE_VENV_DIR) -set(PYBUDA_PYTHON_VERSION $ENV{PYBUDA_PYTHON_VERSION}) -set(PYBUDA_TOOLCHAIN_DIR $ENV{PYBUDA_TOOLCHAIN_DIR}) -set(PYBUDA_VENV_DIR $ENV{PYBUDA_VENV_DIR}) +set(TTFORGE_PYTHON_VERSION $ENV{TTFORGE_PYTHON_VERSION}) +set(TTFORGE_TOOLCHAIN_DIR $ENV{TTFORGE_TOOLCHAIN_DIR}) +set(TTFORGE_VENV_DIR $ENV{TTFORGE_VENV_DIR}) set(TTMLIR_TOOLCHAIN_DIR $ENV{TTMLIR_TOOLCHAIN_DIR}) set(TTMLIR_VENV_DIR $ENV{TTMLIR_VENV_DIR}) -if (NOT EXISTS "${PYBUDA_TOOLCHAIN_DIR}") - message( FATAL_ERROR "The directory ${PYBUDA_TOOLCHAIN_DIR} does not exist. Please create it before running this script.\n sudo mkdir -p ${PYBUDA_TOOLCHAIN_DIR}\n sudo chown -R $ENV{USER} ${PYBUDA_TOOLCHAIN_DIR}") +if (NOT EXISTS "${TTFORGE_TOOLCHAIN_DIR}") + message( FATAL_ERROR "The directory ${TTFORGE_TOOLCHAIN_DIR} does not exist. Please create it before running this script.\n sudo mkdir -p ${TTFORGE_TOOLCHAIN_DIR}\n sudo chown -R $ENV{USER} ${TTFORGE_TOOLCHAIN_DIR}") endif() if (NOT EXISTS "${TTMLIR_TOOLCHAIN_DIR}") @@ -31,8 +31,8 @@ endif() # Install all python dependencies add_custom_target(python-venv ALL COMMAND - PYBUDA_PYTHON_VERSION=${PYBUDA_PYTHON_VERSION} - PYBUDA_TOOLCHAIN_DIR=${PYBUDA_TOOLCHAIN_DIR} + TTFORGE_PYTHON_VERSION=${TTFORGE_PYTHON_VERSION} + TTFORGE_TOOLCHAIN_DIR=${TTFORGE_TOOLCHAIN_DIR} CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} - PYBUDA_VENV_DIR=${PYBUDA_VENV_DIR} + TTFORGE_VENV_DIR=${TTFORGE_VENV_DIR} bash ${CMAKE_CURRENT_SOURCE_DIR}/create_venv.sh) diff --git a/env/README.md b/env/README.md index b36f90214..dfdcd5387 100644 --- a/env/README.md +++ b/env/README.md @@ -1,9 +1,17 @@ -This directory contains all environment dependencies for the project. -All dependencies are installed to /opt/pybuda-toolchain. - -load_env_variables.sh - Script to load the environment variables for the project. - - Its used when downloading dependencies for the project. - - Its also used when activating env for project. This is important since it contains path to different lib/inc paths. +Overview +----- +This directory contains all environment dependencies for tt-forge. By default all dependencies will be installed +to the /opt/ttforge-toolchain directory. To override this behavior, set the `TTFORGE_TOOLCHAIN_DIR` environment variable. +Note that you need to build toolchain only once, unless you want to update it. Dependencies: -(Python.3.10)[https://www.python.org/downloads/release/python-3100/] - Version of python which is compatible with the project. +----- +* [Python.3.10](https://www.python.org/downloads/release/python-3100/) - Version of python which is compatible with the project. +* [cmake3.20](https://cmake.org/download/) - Version of cmake which is compatible with the project. + +Building the toolchain +----- +To build toolchain you need to run the following commands from the root directory of the project: +* `source env/activate` - This command will set all environment variables needed for the project. +* `cmake -B env/build env` - This command will generate the build files for the project. +* `cmake --build env/build` - This command will build the project. diff --git a/env/activate b/env/activate index b2d5264b7..697515a45 100644 --- a/env/activate +++ b/env/activate @@ -2,20 +2,20 @@ # NOTE # These env variables are stored in this file because they are needed by both -# toolchain project and the pybuda project. This file is sourced by both projects. +# toolchain project and the tt-forge project. This file is sourced by both projects. # For tt-mlir we have similar env variables but since we build toolchain and binaries of tt-mlir -# using install.sh from tt-mlir project, we only define them in pybuda project top level cmake file. +# using install.sh from tt-mlir project, we only define them in tt-forge project top level cmake file. -# Set PYBUDA_TOOLCHAIN_DIR to a default value if not already set -export PYBUDA_TOOLCHAIN_DIR="${PYBUDA_TOOLCHAIN_DIR:-/opt/pybuda-toolchain}" +# Set TTFORGE_TOOLCHAIN_DIR to a default value if not already set +export TTFORGE_TOOLCHAIN_DIR="${TTFORGE_TOOLCHAIN_DIR:-/opt/ttforge-toolchain}" # Set PYTHON_VERSION -export PYBUDA_PYTHON_VERSION="${PYBUDA_PYTHON_VERSION:-python3.10}" +export TTFORGE_PYTHON_VERSION="${TTFORGE_PYTHON_VERSION:-python3.10}" -# Set PYBUDA_VENV_DIR to a default value if not already set -export PYBUDA_VENV_DIR="${PYBUDA_VENV_DIR:-${PYBUDA_TOOLCHAIN_DIR}/venv}" +# Set TTFORGE_VENV_DIR to a default value if not already set +export TTFORGE_VENV_DIR="${TTFORGE_VENV_DIR:-${TTFORGE_TOOLCHAIN_DIR}/venv}" -[ -f $PYBUDA_VENV_DIR/bin/activate ] && source $PYBUDA_VENV_DIR/bin/activate +[ -f $TTFORGE_VENV_DIR/bin/activate ] && source $TTFORGE_VENV_DIR/bin/activate if [ -n "$PROJECT_ROOT" ]; then export TT_METAL_HOME="$PROJECT_ROOT/third_party/tt-mlir/third_party/tt-metal/src/tt-metal" diff --git a/env/create_venv.sh b/env/create_venv.sh index 87b27f835..944e8016f 100644 --- a/env/create_venv.sh +++ b/env/create_venv.sh @@ -1,15 +1,15 @@ -if [[ -z "$PYBUDA_PYTHON_VERSION" ]]; then - echo "PYBUDA_PYTHON_VERSION environment variable is not set" +if [[ -z "$TTFORGE_PYTHON_VERSION" ]]; then + echo "TTFORGE_PYTHON_VERSION environment variable is not set" exit 1 fi -if [[ -z "$PYBUDA_TOOLCHAIN_DIR" ]]; then - echo "PYBUDA_TOOLCHAIN_DIR environment variable is not set" +if [[ -z "$TTFORGE_TOOLCHAIN_DIR" ]]; then + echo "TTFORGE_TOOLCHAIN_DIR environment variable is not set" exit 1 fi -if [[ -z "$PYBUDA_VENV_DIR" ]]; then - echo "PYBUDA_VENV_DIR environment variable is not set" +if [[ -z "$TTFORGE_VENV_DIR" ]]; then + echo "TTFORGE_VENV_DIR environment variable is not set" exit 1 fi @@ -27,9 +27,9 @@ else REQUIREMENTS_FILE="$CURRENT_SOURCE_DIR/linux_requirements.txt" fi -$PYBUDA_PYTHON_VERSION -m venv $PYBUDA_VENV_DIR +$TTFORGE_PYTHON_VERSION -m venv $TTFORGE_VENV_DIR unset LD_PRELOAD -source $PYBUDA_VENV_DIR/bin/activate +source $TTFORGE_VENV_DIR/bin/activate python -m pip install --upgrade pip pip3 install wheel==0.37.1 pip3 install -r $REQUIREMENTS_FILE -f https://download.pytorch.org/whl/cpu/torch_stable.html diff --git a/pybuda/README.md b/pybuda/README.md deleted file mode 100644 index 550fffbf5..000000000 --- a/pybuda/README.md +++ /dev/null @@ -1,44 +0,0 @@ -Tenstorrent PyBuda -================== - -[INTERNAL README] - -`pybuda` is a python front-end for Tenstorrent Buda framework, and the main environment for writing and running ML models. - -`pybuda` is designed to be used externally, and therefore many configuration defaults are for "production" mode - debug logging is turned off, device defaults to silicon, etc. -When used for internal develoment, set env variable PYBUDA_DEVMODE to a non-empty string, which will switch defaults to more development-friendly options. - -Build ------ -After cloning and recursively updating the repo: -``` -git submodule sync -git submodule update --init --recursive -f -``` - -Run `make pybuda`, and enable the python environment by running `source build/python_env/bin/activate` -Optionally, run `CONFIG=debug make build` to build with debug information. - -To build and use tvm do: -``` -./third_party/tvm/install.sh -source ./third_party/tvm/enable.sh -``` - -In our dev environment tests need to run from the base dir `pytest pybuda/test/test_sanity.py` instead of `cd pybuda/test && pytest test_sanity.py`, the second option will not work. - -Git Workflow ------------- -In general we prefer to use rebasing instead of merging of development/feature branches. The suggested git workflow is as follows: -``` -git checkout -b my_feature_branch -# Do some work on my_feature_branch, now ready to merge into main -git checkout main -git pull -git checkout my_feature_branch -git rebase main -# resolve merge conflicts -git push --force # optionally update your remote my_feature_branch -git checkout main -git merge my_feature_branch -``` diff --git a/pybuda/csrc/CMakeLists.txt b/pybuda/csrc/CMakeLists.txt index 1ee9d983e..89c247d3d 100644 --- a/pybuda/csrc/CMakeLists.txt +++ b/pybuda/csrc/CMakeLists.txt @@ -1,4 +1,4 @@ -set(PYTHON_SITE_PACKAGES_DIR ${PYBUDA_VENV_DIR}/lib/${PYBUDA_PYTHON_VERSION}/site-packages) +set(PYTHON_SITE_PACKAGES_DIR ${TTFORGE_VENV_DIR}/lib/${TTFORGE_PYTHON_VERSION}/site-packages) set(CMAKE_PREFIX_PATH ${PYTHON_SITE_PACKAGES_DIR}/torch @@ -13,7 +13,7 @@ set(TTMLIR_INCLUDE_DIRS ${TT_MLIR_ROOT_DIR}/build/include ${TT_MLIR_ROOT_DIR}/runtime/include) -set(PYBUDA_CSRC_INCLUDES +set(TTFORGE_CSRC_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/third_party @@ -28,7 +28,7 @@ set(PYBUDA_CSRC_INCLUDES ${TTMLIR_INCLUDE_DIRS} ) -include_directories(${PYBUDA_CSRC_INCLUDES}) +include_directories(${TTFORGE_CSRC_INCLUDES}) # This is workaround for utils/assert.hpp using ##__VA_ARGS__ which is not supported by clang include_directories(SYSTEM ${CMAKE_SOURCE_DIR}) include_directories(SYSTEM ${TORCH_INCLUDE_DIRS}) @@ -41,7 +41,7 @@ add_subdirectory(reportify) add_subdirectory(runtime) add_subdirectory(tt_torch_device) -### pybuda_csrc_objs ### +### ttforge_csrc_objs ### file(GLOB CPP_FILES "pybuda_bindings.cpp" @@ -50,20 +50,20 @@ file(GLOB CPP_FILES "lower_to_buda/common.cpp" ) -add_library(pybuda_csrc_objs OBJECT ${CPP_FILES}) -target_compile_options(pybuda_csrc_objs PRIVATE ${STATIC_LIB_FLAGS} ${PYBUDA_CSRC_CFLAGS}) -add_dependencies(pybuda_csrc_objs build_tt_mlir) +add_library(ttforge_csrc_objs OBJECT ${CPP_FILES}) +target_compile_options(ttforge_csrc_objs PRIVATE ${STATIC_LIB_FLAGS} ${TTFORGE_CSRC_CFLAGS}) +add_dependencies(ttforge_csrc_objs build_tt_mlir) -### End of pybuda_csrc_objs ### +### End of ttforge_csrc_objs ### -######## pybuda_csrc ######## +######## ttforge_csrc ######## set(TTMLIR_LIB_DIR "${CMAKE_SOURCE_DIR}/third_party/tt-mlir/build/lib") set(TTRUNTIME_LIB_DIR "${CMAKE_SOURCE_DIR}/third_party/tt-mlir/build/runtime/lib") set(METAL_LIB_DIR "${CMAKE_SOURCE_DIR}/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib") -set(TORCH_LIB_DIR "${PYBUDA_VENV_DIR}/lib/${PYBUDA_PYTHON_VERSION}/site-packages/torch/lib") +set(TORCH_LIB_DIR "${TTFORGE_VENV_DIR}/lib/${TTFORGE_PYTHON_VERSION}/site-packages/torch/lib") -add_library(pybuda_csrc SHARED) +add_library(ttforge_csrc SHARED) set(METAL_LIB_DIR "${CMAKE_SOURCE_DIR}/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib") @@ -71,7 +71,7 @@ set(METAL_LIB_DIR "${CMAKE_SOURCE_DIR}/third_party/tt-mlir/third_party/tt-metal/ add_library(ttnn SHARED IMPORTED) set_property(TARGET ttnn PROPERTY IMPORTED_LOCATION "${METAL_LIB_DIR}/_ttnn.so") -target_link_libraries(pybuda_csrc PRIVATE +target_link_libraries(ttforge_csrc PRIVATE graph autograd shared_utils @@ -79,7 +79,7 @@ target_link_libraries(pybuda_csrc PRIVATE reportify tt_torch_device runtime - pybuda_csrc_objs + ttforge_csrc_objs # NOTE: ordering of the libraries will affect the linking LLVM @@ -111,33 +111,34 @@ target_link_libraries(pybuda_csrc PRIVATE m torch_python c10 - ${PYBUDA_PYTHON_VERSION} + ${TTFORGE_PYTHON_VERSION} ${TORCH_LIBRARIES} ) -target_compile_options(pybuda_csrc PRIVATE - ${PYBUDA_CSRC_CFLAGS} +target_compile_options(ttforge_csrc PRIVATE + ${TTFORGE_CSRC_CFLAGS} ${CXXFLAGS} ${SHARED_LIB_FLAGS} ) -target_link_directories(pybuda_csrc PRIVATE +target_link_directories(ttforge_csrc PRIVATE ${TTMLIR_TOOLCHAIN_DIR}/lib ${TTMLIR_LIB_DIR} ${TTRUNTIME_LIB_DIR} ${METAL_LIB_DIR} ${TORCH_LIB_DIR}) -### End of pybuda_csrc ### +### End of ttforge_csrc ### -#### Copy python module extension to pybuda directory #### -add_custom_target(run_after_pybuda_csrc ALL - COMMAND mkdir -p ${PYBUDA_VENV_DIR}/lib/${PYBUDA_PYTHON_VERSION}/site-packages/pybuda - COMMAND cp $ ${PYBUDA_VENV_DIR}/lib/${PYBUDA_PYTHON_VERSION}/site-packages/pybuda/_C.so - COMMAND touch -r $ ${PYBUDA_VENV_DIR}/lib/${PYBUDA_PYTHON_VERSION}/site-packages/pybuda/_C.so - COMMAND ln -sf ${PYBUDA_VENV_DIR}/lib/${PYBUDA_PYTHON_VERSION}/site-packages/pybuda/_C.so ${CMAKE_SOURCE_DIR}/pybuda/pybuda/_C.so - COMMENT "Running run_after_pybuda_csrc to copy the python module extension to pybuda directory" +#### Copy python module extension to ttforge directory #### + +add_custom_target(run_after_ttforge_csrc ALL + COMMAND mkdir -p ${TTFORGE_VENV_DIR}/lib/${TTFORGE_PYTHON_VERSION}/site-packages/pybuda + COMMAND cp $ ${TTFORGE_VENV_DIR}/lib/${TTFORGE_PYTHON_VERSION}/site-packages/pybuda/_C.so + COMMAND touch -r $ ${TTFORGE_VENV_DIR}/lib/${TTFORGE_PYTHON_VERSION}/site-packages/pybuda/_C.so + COMMAND ln -sf ${TTFORGE_VENV_DIR}/lib/${TTFORGE_PYTHON_VERSION}/site-packages/pybuda/_C.so ${CMAKE_SOURCE_DIR}/pybuda/pybuda/_C.so + COMMENT "Running run_after_ttforge_csrc to copy the python module extension to pybuda directory" USES_TERMINAL ) -add_dependencies(run_after_pybuda_csrc pybuda_csrc) +add_dependencies(run_after_ttforge_csrc ttforge_csrc) diff --git a/pybuda/csrc/autograd/CMakeLists.txt b/pybuda/csrc/autograd/CMakeLists.txt index 7f35e9dd9..8fe4ffcc7 100644 --- a/pybuda/csrc/autograd/CMakeLists.txt +++ b/pybuda/csrc/autograd/CMakeLists.txt @@ -4,5 +4,5 @@ add_library(autograd binding.cpp python_bindings.cpp) -target_compile_options(autograd PRIVATE ${STATIC_LIB_FLAGS} ${PYBUDA_CSRC_CFLAGS}) +target_compile_options(autograd PRIVATE ${STATIC_LIB_FLAGS} ${TTFORGE_CSRC_CFLAGS}) diff --git a/pybuda/csrc/backend_api/CMakeLists.txt b/pybuda/csrc/backend_api/CMakeLists.txt index 8fb8f8479..8072edee9 100644 --- a/pybuda/csrc/backend_api/CMakeLists.txt +++ b/pybuda/csrc/backend_api/CMakeLists.txt @@ -5,5 +5,5 @@ add_library(backend_api target_link_libraries(backend_api shared_utils) add_dependencies(backend_api shared_utils) -target_compile_options(backend_api PRIVATE ${STATIC_LIB_FLAGS} ${PYBUDA_CSRC_CFLAGS}) +target_compile_options(backend_api PRIVATE ${STATIC_LIB_FLAGS} ${TTFORGE_CSRC_CFLAGS}) diff --git a/pybuda/csrc/graph_lib/CMakeLists.txt b/pybuda/csrc/graph_lib/CMakeLists.txt index b3b0549aa..ad6b30900 100644 --- a/pybuda/csrc/graph_lib/CMakeLists.txt +++ b/pybuda/csrc/graph_lib/CMakeLists.txt @@ -9,5 +9,5 @@ add_library(graph utils.cpp python_bindings.cpp) -target_compile_options(graph PRIVATE ${STATIC_LIB_FLAGS} ${PYBUDA_CSRC_CFLAGS}) +target_compile_options(graph PRIVATE ${STATIC_LIB_FLAGS} ${TTFORGE_CSRC_CFLAGS}) diff --git a/pybuda/csrc/reportify/CMakeLists.txt b/pybuda/csrc/reportify/CMakeLists.txt index 759d6a76a..bd6a7bf7e 100644 --- a/pybuda/csrc/reportify/CMakeLists.txt +++ b/pybuda/csrc/reportify/CMakeLists.txt @@ -4,5 +4,5 @@ add_library(reportify paths.cpp to_json.cpp) -target_compile_options(reportify PRIVATE ${STATIC_LIB_FLAGS} ${PYBUDA_CSRC_CFLAGS}) +target_compile_options(reportify PRIVATE ${STATIC_LIB_FLAGS} ${TTFORGE_CSRC_CFLAGS}) diff --git a/pybuda/csrc/runtime/CMakeLists.txt b/pybuda/csrc/runtime/CMakeLists.txt index ea9c4fe32..79dcbd7b6 100644 --- a/pybuda/csrc/runtime/CMakeLists.txt +++ b/pybuda/csrc/runtime/CMakeLists.txt @@ -1,4 +1,4 @@ add_library(runtime STATIC runtime.cpp tt_device.cpp python_bindings.cpp) add_dependencies(runtime build_tt_mlir) -target_compile_options(runtime PRIVATE ${STATIC_LIB_FLAGS} ${PYBUDA_CSRC_CFLAGS}) +target_compile_options(runtime PRIVATE ${STATIC_LIB_FLAGS} ${TTFORGE_CSRC_CFLAGS}) diff --git a/pybuda/csrc/shared_utils/CMakeLists.txt b/pybuda/csrc/shared_utils/CMakeLists.txt index ffa249df8..1ebdf0528 100644 --- a/pybuda/csrc/shared_utils/CMakeLists.txt +++ b/pybuda/csrc/shared_utils/CMakeLists.txt @@ -5,4 +5,4 @@ add_library(shared_utils sparse_matmul_utils.cpp string_extension.cpp) -target_compile_options(shared_utils PRIVATE ${STATIC_LIB_FLAGS} ${PYBUDA_CSRC_CFLAGS}) +target_compile_options(shared_utils PRIVATE ${STATIC_LIB_FLAGS} ${TTFORGE_CSRC_CFLAGS}) diff --git a/pybuda/csrc/tt_torch_device/CMakeLists.txt b/pybuda/csrc/tt_torch_device/CMakeLists.txt index 9272b56b3..42ba12876 100644 --- a/pybuda/csrc/tt_torch_device/CMakeLists.txt +++ b/pybuda/csrc/tt_torch_device/CMakeLists.txt @@ -4,5 +4,5 @@ add_library(tt_torch_device torch_device_impl.cpp python_bindings.cpp) -target_compile_options(tt_torch_device PRIVATE ${STATIC_LIB_FLAGS} ${PYBUDA_CSRC_CFLAGS}) +target_compile_options(tt_torch_device PRIVATE ${STATIC_LIB_FLAGS} ${TTFORGE_CSRC_CFLAGS}) add_dependencies(tt_torch_device build_tt_mlir) diff --git a/pybuda/pybuda/CMakeLists.txt b/pybuda/pybuda/CMakeLists.txt index 33bba1fcf..40dcf221b 100644 --- a/pybuda/pybuda/CMakeLists.txt +++ b/pybuda/pybuda/CMakeLists.txt @@ -1,5 +1,5 @@ -add_custom_target(install_pybuda ALL +add_custom_target(install_ttforge ALL COMMAND cd "${CMAKE_SOURCE_DIR}/pybuda" && pip install -e . - COMMENT "Installing pybuda module") + COMMENT "Installing ttforge module") -add_dependencies(install_pybuda run_after_pybuda_csrc) +add_dependencies(install_ttforge run_after_ttforge_csrc)