From 3bc20f886ada1b212e2b9df8cf1771707a165eb5 Mon Sep 17 00:00:00 2001 From: Milan Topalovic Date: Tue, 23 Jul 2024 07:23:39 +0000 Subject: [PATCH] Remove makefile references from ttforge --- Makefile | 176 -------------------------- docs/public/module.mk | 28 ---- pybuda/csrc/autograd/module.mk | 23 ---- pybuda/csrc/backend_api/module.mk | 25 ---- pybuda/csrc/graph_lib/module.mk | 31 ----- pybuda/csrc/graph_lib/tests/module.mk | 22 ---- pybuda/csrc/module.mk | 62 --------- pybuda/csrc/passes/tests/module.mk | 23 ---- pybuda/csrc/reportify/module.mk | 23 ---- pybuda/csrc/shared_utils/module.mk | 26 ---- pybuda/csrc/tt_torch_device/module.mk | 22 ---- pybuda/module.mk | 8 -- 12 files changed, 469 deletions(-) delete mode 100644 Makefile delete mode 100644 docs/public/module.mk delete mode 100644 pybuda/csrc/autograd/module.mk delete mode 100644 pybuda/csrc/backend_api/module.mk delete mode 100644 pybuda/csrc/graph_lib/module.mk delete mode 100644 pybuda/csrc/graph_lib/tests/module.mk delete mode 100644 pybuda/csrc/module.mk delete mode 100644 pybuda/csrc/passes/tests/module.mk delete mode 100644 pybuda/csrc/reportify/module.mk delete mode 100644 pybuda/csrc/shared_utils/module.mk delete mode 100644 pybuda/csrc/tt_torch_device/module.mk delete mode 100644 pybuda/module.mk diff --git a/Makefile b/Makefile deleted file mode 100644 index 79a5e78be..000000000 --- a/Makefile +++ /dev/null @@ -1,176 +0,0 @@ -.SUFFIXES: - -OS ?= $(shell uname) - -ifeq ($(OS),Linux) -MAKEFLAGS := --jobs=$(shell nproc) --output-sync=target -else ifeq ($(OS),Darwin) -MAKEFLAGS := --jobs=$(shell sysctl -n hw.physicalcpu) --output-sync=target -else -$(error "Unknown OS: $(OS)") -endif - -# Setup CONFIG, DEVICE_RUNNER, and out/build dirs first -CONFIG ?= assert -ARCH_NAME ?= grayskull -# TODO: enable OUT to be per config (this impacts all scripts that run tests) -# OUT ?= build_$(DEVICE_RUNNER)_$(CONFIG) -OUT ?= build -PREFIX ?= $(OUT) - -CONFIG_CFLAGS = -CONFIG_LDFLAGS = -CONFIG_CXXFLAGS = - -ifeq ($(CONFIG), release) -CONFIG_CFLAGS += -O3 -CONFIG_CXXFLAGS = -fvisibility-inlines-hidden -else ifeq ($(CONFIG), ci) # significantly smaller artifacts -CONFIG_CFLAGS += -O3 -DDEBUG -Werror -else ifeq ($(CONFIG), assert) -CONFIG_CFLAGS += -O3 -g -DDEBUG -else ifeq ($(CONFIG), asan) -CONFIG_CFLAGS += -O3 -g -DDEBUG -fsanitize=address -CONFIG_LDFLAGS += -fsanitize=address -ifeq ($(findstring clang,$(CC)),clang) -CONFIG_CFLAGS += -shared-libasan -CONFIG_LDFLAGS += -shared-libasan -endif -else ifeq ($(CONFIG), ubsan) -CONFIG_CFLAGS += -O3 -g -DDEBUG -fsanitize=undefined -CONFIG_LDFLAGS += -fsanitize=undefined -else ifeq ($(CONFIG), gprof) -CONFIG_CFLAGS += -O3 -g -DDEBUG -pg -CONFIG_LDFLAGS += -pg -else ifeq ($(CONFIG), debug) -CONFIG_CFLAGS += -O0 -g -DDEBUG -else -$(error Unknown value for CONFIG "$(CONFIG)") -endif - -OBJDIR = $(OUT)/obj -LIBDIR = $(OUT)/lib -BINDIR = $(OUT)/bin -INCDIR = $(OUT)/include -TESTDIR = $(OUT)/test -DOCSDIR = $(OUT)/docs -SUBMODULESDIR = $(OUT)/submodules - -# Python version -PYTHON_VERSION ?= python3.8 -PYTHON_INCLUDES = $(shell $(PYTHON_VERSION)-config --includes) -PYTHON_LDFLAGS = $(shell $(PYTHON_VERSION)-config --ldflags) - -# Top level flags, compiler, defines etc. - -#WARNINGS ?= -Wall -Wextra -WARNINGS ?= -Wdelete-non-virtual-dtor -Wreturn-type -Wswitch -Wuninitialized -Wno-unused-parameter -CC ?= clang -CXX ?= clang++ -CFLAGS_NO_WARN ?= -MMD -I. $(CONFIG_CFLAGS) -DBUILD_DIR=\"$(OUT)\" -I$(INCDIR) -DFMT_HEADER_ONLY -Ithird_party/fmt -Ithird_party/pybind11/include $(PYTHON_INCLUDES) -CFLAGS ?= $(CFLAGS_NO_WARN) $(WARNINGS) -CXXFLAGS ?= --std=c++17 $(CONFIG_CXXFLAGS) -LDFLAGS ?= $(CONFIG_LDFLAGS) -Wl,-rpath,$(PREFIX)/lib -L$(LIBDIR) -v -SHARED_LIB_FLAGS = -shared -fPIC -STATIC_LIB_FLAGS = -fPIC -ifeq ($(findstring clang,$(CC)),clang) -WARNINGS += -Wno-c++11-narrowing -LDFLAGS += -lstdc++ -else -WARNINGS += -Wmaybe-uninitialized -LDFLAGS += -lstdc++ -endif -GIT_COMMON_DIR=$(shell git rev-parse --git-common-dir) -SUBMODULES=$(shell git submodule status | grep -o "third_party/[^ ]*") -SUBMODULES_UPDATED=$(addprefix $(SUBMODULESDIR)/, $(SUBMODULES:%=%.checkout)) -SKIP_BBE_UPDATE ?= 0 -SKIP_SUBMODULE_UPDATE ?= $(SKIP_BBE_UPDATE) - -ifeq ($(EMULATION_DEVICE_EN), 1) - TENSIX_EMULATION_ZEBU = $(TENSIX_EMULATION_ROOT)/zebu - TENSIX_EMULATION_ZCUI_WORK = $(TENSIX_EMULATION_ROOT)/targets/tensix_2x2_1dram_BH/zcui.work -endif - -all: update_submodules build ; - -# These must be in dependency order (enforces no circular deps) -include python_env/module.mk -include pybuda/module.mk -include docs/public/module.mk - -update_submodules: $(SUBMODULES_UPDATED) emulation_device_links ; - -$(SUBMODULESDIR)/%.checkout: - @mkdir -p $(dir $@) -ifeq ($(SKIP_SUBMODULE_UPDATE), 0) - git submodule update --init --recursive $(@:$(SUBMODULESDIR)/%.checkout=%) - #git -C $(@:$(SUBMODULESDIR)/%.checkout=%) submodule foreach --recursive git lfs install || true - #git -C $(@:$(SUBMODULESDIR)/%.checkout=%) submodule foreach --recursive git lfs pull - #git -C $(@:$(SUBMODULESDIR)/%.checkout=%) submodule foreach --recursive git lfs checkout HEAD -endif - touch $@ - -emulation_device_links: -ifeq ($(EMULATION_DEVICE_EN), 1) - @echo "Linking and copying emulation device files..." - ln -sf $(TENSIX_EMULATION_ZCUI_WORK) $(OUT)/. - ln -sf $(TENSIX_EMULATION_ZCUI_WORK) ../ - cp -f $(TENSIX_EMULATION_ZEBU)/scripts/designFeatures ./ -endif - -build: pybuda third_party/tvm ; - -third_party/tvm: $(SUBMODULESDIR)/third_party/tvm.build ; - -$(SUBMODULESDIR)/third_party/tvm.build: $(PYTHON_ENV) $(SUBMODULESDIR)/third_party/tvm.checkout - bash -c "source $(PYTHON_ENV_ROOT)/bin/activate && ./third_party/tvm/install.sh" - touch $@ - -build_tests: pybuda/csrc/graph_lib/tests pybuda/csrc/passes/tests ; - -run_tests: build_tests - @echo "Running tests..." - $(TESTDIR)/pybuda/csrc/graph_lib/tests/graphlib_unit_tests - $(TESTDIR)/pybuda/csrc/passes/tests/passes_unit_tests - -clean: - rm -rf $(OUT) - rm -rf third_party/tvm/build - rm -rf build_deps/ - -clean_no_python: - find $(OUT)/ -maxdepth 1 -mindepth 1 -type d -not -name 'python_env' -print0 | xargs -0 -I {} rm -Rf {} - find $(OUT)/ -maxdepth 1 -type f -delete - - -.PHONY: install -install: all -ifeq ($(PREFIX), $(OUT)) - @echo "To install you must set PREFIX, e.g." - @echo "" - @echo " PREFIX=/usr CONFIG=release make install" - @echo "" - @exit 1 -endif - cp -r $(LIBDIR)/* $(PREFIX)/lib/ - cp -r $(INCDIR)/* $(PREFIX)/include/ - cp -r $(BINDIR)/* $(PREFIX)/bin/ - -.PHONY: b0 -b0: export LD_LIBRARY_PATH=versim/wormhole_b0/lib:versim/wormhole_b0/lib/ext -b0: export BACKEND_ARCH_NAME=wormhole_b0 -b0: build ; - -.PHONY: build_tvm -build_tvm: third_party/tvm ; - -.PHONY: stubs -stubs: - pip install mypy - stubgen -m pybuda._C -m pybuda._C.autograd -m pybuda._C.graph -m pybuda._C.torch_device -o pybuda - -# Cleaning PyBuda and BBE artifacts -.PHONY: clean_tt -clean_tt: - @rm -rf .hlkc_cache/ .pkl_memoize_py3/ generated_modules/ tt_build/ - @rm -f *netlist.yaml diff --git a/docs/public/module.mk b/docs/public/module.mk deleted file mode 100644 index 78bd4db4c..000000000 --- a/docs/public/module.mk +++ /dev/null @@ -1,28 +0,0 @@ -DOCS_PUBLIC_DIR = $(DOCSDIR)/public -DOCS_PUBLIC_SRC_DIR = docs/public -DOCS_PUBLIC_SRCS = $(shell find $(DOCS_PUBLIC_SRC_DIR) -type f -name '*.rst') -DOCS_PUBLIC_SPHINX_BUILDER = html -DOCS_PUBLIC_BUILD_SCRIPT = docs/public/build.sh - -docs/public: $(DOCS_PUBLIC_DIR) - -.PHONY: foo - -$(DOCS_PUBLIC_DIR): $(DOCS_PUBLIC_BUILD_SCRIPT) $(DOCS_PUBLIC_SRCS) $(PYTHON_ENV) foo - LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(LIBDIR) \ - PYTHON_ENV=$(PYTHON_ENV) \ - BUILDER=$(DOCS_PUBLIC_SPHINX_BUILDER) \ - SOURCE_DIR=$(DOCS_PUBLIC_SRC_DIR) \ - INSTALL_DIR=$(@) \ - $(DOCS_PUBLIC_BUILD_SCRIPT) - -docs/public/publish: docs/public - rsync --delete -avz $(DOCS_PUBLIC_DIR)/html/ yyz-webservice-02:/var/www/html/docs/pybuda-docs - -docs/pdf: $(PYTHON_ENV) foo - LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(LIBDIR) \ - PYTHON_ENV=$(PYTHON_ENV) \ - BUILDER=latexpdf \ - SOURCE_DIR=$(DOCS_PUBLIC_SRC_DIR) \ - INSTALL_DIR=$(@) \ - $(DOCS_PUBLIC_BUILD_SCRIPT) diff --git a/pybuda/csrc/autograd/module.mk b/pybuda/csrc/autograd/module.mk deleted file mode 100644 index 57f24bb81..000000000 --- a/pybuda/csrc/autograd/module.mk +++ /dev/null @@ -1,23 +0,0 @@ -PYBUDA_CSRC_AUTOGRAD = ${LIBDIR}/libautograd.a -PYBUDA_CSRC_AUTOGRAD_SRCS = \ - pybuda/csrc/autograd/autograd.cpp \ - pybuda/csrc/autograd/binding.cpp \ - pybuda/csrc/autograd/python_bindings.cpp - -PYBUDA_CSRC_AUTOGRAD_OBJS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_AUTOGRAD_SRCS:.cpp=.o)) -PYBUDA_CSRC_AUTOGRAD_DEPS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_AUTOGRAD_SRCS:.cpp=.d)) - -PYBUDA_CSRC_AUTOGRAD_INCLUDES = $(PYBUDA_CSRC_INCLUDES) - --include $(PYBUDA_CSRC_AUTOGRAD_DEPS) - -pybuda/csrc/autograd: $(PYBUDA_CSRC_AUTOGRAD) - -$(PYBUDA_CSRC_AUTOGRAD): $(PYBUDA_CSRC_AUTOGRAD_OBJS) - @mkdir -p $(LIBDIR) - ar rcs $@ $^ - -$(OBJDIR)/pybuda/csrc/autograd/%.o: pybuda/csrc/autograd/%.cpp - @mkdir -p $(@D) - $(CXX) $(PYBUDA_CSRC_CFLAGS) $(CXXFLAGS) $(STATIC_LIB_FLAGS) $(PYBUDA_CSRC_AUTOGRAD_INCLUDES) -c -o $@ $< - diff --git a/pybuda/csrc/backend_api/module.mk b/pybuda/csrc/backend_api/module.mk deleted file mode 100644 index 4605c1a95..000000000 --- a/pybuda/csrc/backend_api/module.mk +++ /dev/null @@ -1,25 +0,0 @@ -# Every variable in subdir must be prefixed with subdir (emulating a namespace) - -PYBUDA_CSRC_BACKENDAPI_LIB = $(LIBDIR)/libbackend_api.a -PYBUDA_CSRC_BACKENDAPI_SRCS += \ - pybuda/csrc/backend_api/backend_api.cpp \ - pybuda/csrc/backend_api/arch_type.cpp - -PYBUDA_CSRC_BACKENDAPI_INCLUDES = $(PYBUDA_CSRC_INCLUDES) $(BACKEND_INCLUDES) - -PYBUDA_CSRC_BACKENDAPI_OBJS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_BACKENDAPI_SRCS:.cpp=.o)) -PYBUDA_CSRC_BACKENDAPI_DEPS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_BACKENDAPI_SRCS:.cpp=.d)) - --include $(PYBUDA_CSRC_BACKENDAPI_DEPS) - -# Each module has a top level target as the entrypoint which must match the subdir name -pybuda/csrc/backend_api: $(PYBUDA_CSRC_BACKENDAPI_LIB) $(PYBUDA_CSRC_SHARED_UTILS_LIB) ; - -$(PYBUDA_CSRC_BACKENDAPI_LIB): $(PYBUDA_CSRC_BACKENDAPI_OBJS) - @mkdir -p $(LIBDIR) - ar rcs $@ $^ - -$(OBJDIR)/pybuda/csrc/backend_api/%.o: pybuda/csrc/backend_api/%.cpp - @mkdir -p $(@D) - $(CXX) $(PYBUDA_CSRC_CFLAGS) $(CXXFLAGS) $(STATIC_LIB_FLAGS) $(PYBUDA_CSRC_BACKENDAPI_INCLUDES) -c -o $@ $< - diff --git a/pybuda/csrc/graph_lib/module.mk b/pybuda/csrc/graph_lib/module.mk deleted file mode 100644 index 9df49e78c..000000000 --- a/pybuda/csrc/graph_lib/module.mk +++ /dev/null @@ -1,31 +0,0 @@ -# Every variable in subdir must be prefixed with subdir (emulating a namespace) -PYBUDA_CSRC_GRAPH_LIB = $(LIBDIR)/libgraph_lib.a -PYBUDA_CSRC_GRAPH_LIB_SRCS = \ - pybuda/csrc/graph_lib/defines.cpp \ - pybuda/csrc/graph_lib/edge.cpp \ - pybuda/csrc/graph_lib/graph.cpp \ - pybuda/csrc/graph_lib/node.cpp \ - pybuda/csrc/graph_lib/node_types.cpp \ - pybuda/csrc/graph_lib/shape.cpp \ - pybuda/csrc/graph_lib/utils.cpp \ - pybuda/csrc/graph_lib/python_bindings.cpp - -PYBUDA_CSRC_GRAPH_LIB_INCLUDES = $(PYBUDA_CSRC_INCLUDES) - -PYBUDA_CSRC_GRAPH_LIB_OBJS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_GRAPH_LIB_SRCS:.cpp=.o)) -PYBUDA_CSRC_GRAPH_LIB_DEPS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_GRAPH_LIB_SRCS:.cpp=.d)) - --include $(PYBUDA_CSRC_GRAPH_LIB_DEPS) - -# Each module has a top level target as the entrypoint which must match the subdir name -pybuda/csrc/graph_lib: $(PYBUDA_CSRC_GRAPH_LIB) - -$(PYBUDA_CSRC_GRAPH_LIB): $(PYBUDA_CSRC_GRAPH_LIB_OBJS) - @mkdir -p $(LIBDIR) - ar rcs $@ $^ - -$(OBJDIR)/pybuda/csrc/graph_lib/%.o: pybuda/csrc/graph_lib/%.cpp $(PYTHON_ENV) - @mkdir -p $(@D) - $(CXX) $(PYBUDA_CSRC_CFLAGS) $(CXXFLAGS) $(STATIC_LIB_FLAGS) $(PYBUDA_CSRC_GRAPH_LIB_INCLUDES) -c -o $@ $< - -include pybuda/csrc/graph_lib/tests/module.mk diff --git a/pybuda/csrc/graph_lib/tests/module.mk b/pybuda/csrc/graph_lib/tests/module.mk deleted file mode 100644 index dbc28a111..000000000 --- a/pybuda/csrc/graph_lib/tests/module.mk +++ /dev/null @@ -1,22 +0,0 @@ -PYBUDA_CSRC_GRAPHLIB_TESTS = $(TESTDIR)/pybuda/csrc/graph_lib/tests/graphlib_unit_tests -PYBUDA_CSRC_GRAPHLIB_TESTS_SRCS = \ - pybuda/csrc/graph_lib/tests/test_graphlib_utils.cpp \ - pybuda/csrc/graph_lib/tests/test_graphlib.cpp - -PYBUDA_CSRC_GRAPHLIB_TESTS_INCLUDES = $(PYBUDA_CSRC_INCLUDES) -PYBUDA_CSRC_GRAPHLIB_TESTS_LDFLAGS = -lgtest -lgtest_main -lpthread -l$(PYTHON_VERSION) -lm - -PYBUDA_CSRC_GRAPHLIB_TESTS_OBJS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_GRAPHLIB_TESTS_SRCS:.cpp=.o)) -PYBUDA_CSRC_GRAPHLIB_TESTS_DEPS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_GRAPHLIB_TESTS_SRCS:.cpp=.d)) - --include $(PYBUDA_CSRC_GRAPHLIB_TESTS_DEPS) - -pybuda/csrc/graph_lib/tests: $(PYBUDA_CSRC_GRAPHLIB_TESTS) - -$(PYBUDA_CSRC_GRAPHLIB_TESTS): $(PYBUDA_CSRC_GRAPHLIB_TESTS_OBJS) $(PYBUDA_CSRC_LIB) - @mkdir -p $(@D) - $(CXX) $(PYBUDA_CSRC_CFLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) $(PYBUDA_CSRC_GRAPHLIB_TESTS_LDFLAGS) - -$(OBJDIR)/pybuda/csrc/graph_lib/tests/%.o: pybuda/csrc/graph_lib/tests/%.cpp - @mkdir -p $(@D) - $(CXX) $(PYBUDA_CSRC_CFLAGS) $(CXXFLAGS) $(PYBUDA_CSRC_GRAPHLIB_TESTS_INCLUDES) -c -o $@ $< diff --git a/pybuda/csrc/module.mk b/pybuda/csrc/module.mk deleted file mode 100644 index 4739f2d51..000000000 --- a/pybuda/csrc/module.mk +++ /dev/null @@ -1,62 +0,0 @@ -# Every variable in subdir must be prefixed with subdir (emulating a namespace) -PYBUDA_CSRC_INCLUDES = \ - -Ipybuda/csrc \ - -Ithird_party/json \ - -I/usr/include/$(PYTHON_VERSION) \ - -isystem $(PYTHON_ENV_ROOT)/lib/$(PYTHON_VERSION)/site-packages/torch/include \ - -isystem $(PYTHON_ENV_ROOT)/lib/$(PYTHON_VERSION)/site-packages/torch/include/torch/csrc/api/include \ - -I/opt/ttmlir-toolchain/include \ - -Ithird_party/tt-mlir/build/include \ - -Ithird_party/tt-mlir/runtime/include \ - -Ithird_party/tt-mlir/include - -PYBUDA_CSRC_WARNINGS ?= -Wall -Wextra -Wno-pragmas -Wno-unused-parameter -PYBUDA_CSRC_CFLAGS ?= $(CFLAGS_NO_WARN) $(PYBUDA_CSRC_WARNINGS) -DUTILS_LOGGER_PYTHON_OSTREAM_REDIRECT=1 -TORCH_LIB_DIR = $(PYTHON_ENV_ROOT)/lib/$(PYTHON_VERSION)/site-packages/torch/lib - -PYBUDA_CSRC_LIB = $(LIBDIR)/libpybuda_csrc.so -TTMLIR_TOOLCHAIN_DIR = /opt/ttmlir-toolchain -RUNTIME_LIB_DIR = third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib -MLIR_LIB_DIR = -L$(TTMLIR_TOOLCHAIN_DIR)/lib -Lthird_party/tt-mlir/build/lib -Lthird_party/tt-mlir/build/runtime/lib -MLIR_LIBS = -Wl,-rpath,$(TTMLIR_TOOLCHAIN_DIR)/lib -lLLVM -lMLIR -TT_MLIR_LIBS = -lMLIRTTDialect -lMLIRTTIRDialect -lMLIRTTNNDialect -lMLIRTTIRTransforms -lMLIRTTNNTransforms -lMLIRTTKernelDialect -lMLIRTTMetalDialect -lMLIRTTIRAnalysis -RUNTIME_LIBS = -lTTRuntime -lTTRuntimeTTNN -L$(RUNTIME_LIB_DIR) -Wl,-rpath,\$$ORIGIN/../../$(RUNTIME_LIB_DIR) -l:_ttnn.so -ltt_metal -ldevice -ltt_eager - -include pybuda/csrc/graph_lib/module.mk -include pybuda/csrc/shared_utils/module.mk -include pybuda/csrc/autograd/module.mk -include pybuda/csrc/reportify/module.mk -include pybuda/csrc/backend_api/module.mk -include pybuda/csrc/tt_torch_device/module.mk -include pybuda/csrc/runtime/module.mk - -PYBUDA_CSRC_LDFLAGS = -Wl,-rpath,\$$ORIGIN/../python_env/lib/$(PYTHON_VERSION)/site-packages/torch/lib -ltorch -ltorch_cpu -lc10 -ltorch_python $(PYTHON_LDFLAGS) -l$(PYTHON_VERSION) $(MLIR_LIB_DIR) $(MLIR_LIBS) $(TT_MLIR_LIBS) $(RUNTIME_LIBS) -lm -lz -lcurses -lxml2 -lflatbuffers - -PYBUDA_CSRC_SRCS = \ - pybuda/csrc/pybuda_bindings.cpp \ - pybuda/csrc/buda_passes.cpp \ - $(wildcard pybuda/csrc/passes/*.cpp) \ - pybuda/csrc/lower_to_buda/common.cpp - -PYBUDA_CSRC_OBJS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_SRCS:.cpp=.o)) -PYBUDA_CSRC_DEPS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_SRCS:.cpp=.d)) - -PYBUDA_THIRD_PARTY_DEPS = $(SUBMODULESDIR)/third_party/pybind11.checkout - --include $(PYBUDA_CSRC_DEPS) - -$(PYBUDA_CSRC_LIB): $(PYBUDA_CSRC_OBJS) $(PYBUDA_CSRC_GRAPH_LIB) $(PYBUDA_CSRC_AUTOGRAD) $(PYBUDA_CSRC_PATTERN_MATCHER_LIB) $(PYBUDA_CSRC_BALANCER_LIB) $(PYBUDA_CSRC_PLACER_LIB) $(PYBUDA_CSRC_SCHEDULER_LIB) $(PYBUDA_CSRC_REPORTIFY) $(PYBUDA_CSRC_BACKENDAPI_LIB) $(PYBUDA_CSRC_SHARED_UTILS_LIB) $(PYBUDA_CSRC_PERF_MODEL_LIB) $(PYBUDA_CSRC_TT_TORCH_DEVICE_LIB) $(PYBUDA_CSRC_RUNTIME_LIB) - @mkdir -p $(LIBDIR) - $(CXX) $(PYBUDA_CSRC_CFLAGS) $(CXXFLAGS) $(SHARED_LIB_FLAGS) -L$(TORCH_LIB_DIR) -o $@ $^ $(LDFLAGS) $(PYBUDA_CSRC_LDFLAGS) - -$(PYTHON_ENV_ROOT)/lib/$(PYTHON_VERSION)/site-packages/pybuda/_C.so: $(PYBUDA_CSRC_LIB) - @mkdir -p $(PYTHON_ENV_ROOT)/lib/$(PYTHON_VERSION)/site-packages/pybuda - cp $^ $@ - touch -r $^ $@ - ln -sf ../../$(PYTHON_ENV_ROOT)/lib/$(PYTHON_VERSION)/site-packages/pybuda/_C.so pybuda/pybuda/_C.so - -$(OBJDIR)/pybuda/csrc/%.o: pybuda/csrc/%.cpp $(PYTHON_ENV) $(PYBUDA_THIRD_PARTY_DEPS) - @mkdir -p $(@D) - $(CXX) $(PYBUDA_CSRC_CFLAGS) $(CXXFLAGS) $(SHARED_LIB_FLAGS) $(PYBUDA_CSRC_INCLUDES) -c -o $@ $< - -pybuda/csrc: $(PYBUDA_CSRC_LIB) ; diff --git a/pybuda/csrc/passes/tests/module.mk b/pybuda/csrc/passes/tests/module.mk deleted file mode 100644 index 80fa8fc5b..000000000 --- a/pybuda/csrc/passes/tests/module.mk +++ /dev/null @@ -1,23 +0,0 @@ -PYBUDA_CSRC_PASSES_TESTS = $(TESTDIR)/pybuda/csrc/passes/tests/passes_unit_tests -PYBUDA_CSRC_PASSES_TESTS_SRCS = \ - $(wildcard pybuda/csrc/passes/tests/*.cpp) - - -PYBUDA_CSRC_PASSES_TESTS_INCLUDES = -Ipybuda/csrc/graph_lib $(PYBUDA_CSRC_INCLUDES) -PYBUDA_CSRC_PASSES_TESTS_LDFLAGS = -lgtest -lgtest_main -lpthread -l$(PYTHON_VERSION) -lm - -PYBUDA_CSRC_PASSES_TESTS_OBJS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_PASSES_TESTS_SRCS:.cpp=.o)) -PYBUDA_CSRC_PASSES_TESTS_DEPS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_PASSES_TESTS_SRCS:.cpp=.d)) - --include $(PYBUDA_CSRC_PASSES_TESTS_DEPS) - -pybuda/csrc/passes/tests: $(PYBUDA_CSRC_PASSES_TESTS) - -# gcc + pybind causing segfault at the end of the tests -$(PYBUDA_CSRC_PASSES_TESTS): $(PYBUDA_CSRC_PASSES_TESTS_OBJS) $(PYBUDA_CSRC_LIB) - @mkdir -p $(@D) - $(CXX) $(PYBUDA_CSRC_CFLAGS) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) $(PYBUDA_CSRC_PASSES_TESTS_LDFLAGS) - -$(OBJDIR)/pybuda/csrc/passes/tests/%.o: pybuda/csrc/passes/tests/%.cpp - @mkdir -p $(@D) - $(CXX) $(PYBUDA_CSRC_CFLAGS) $(CXXFLAGS) $(PYBUDA_CSRC_PASSES_TESTS_INCLUDES) -c -o $@ $< diff --git a/pybuda/csrc/reportify/module.mk b/pybuda/csrc/reportify/module.mk deleted file mode 100644 index d481f9488..000000000 --- a/pybuda/csrc/reportify/module.mk +++ /dev/null @@ -1,23 +0,0 @@ -PYBUDA_CSRC_REPORTIFY = ${LIBDIR}/libreportify.a -PYBUDA_CSRC_REPORTIFY_SRCS = \ - pybuda/csrc/reportify/reportify.cpp \ - pybuda/csrc/reportify/paths.cpp \ - pybuda/csrc/reportify/to_json.cpp - -PYBUDA_CSRC_REPORTIFY_OBJS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_REPORTIFY_SRCS:.cpp=.o)) -PYBUDA_CSRC_REPORTIFY_DEPS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_REPORTIFY_SRCS:.cpp=.d)) - -PYBUDA_CSRC_REPORTIFY_INCLUDES = $(PYBUDA_CSRC_INCLUDES) - --include $(PYBUDA_CSRC_REPORTIFY_DEPS) - -pybuda/csrc/reportify: $(PYBUDA_CSRC_REPORTIFY) - -$(PYBUDA_CSRC_REPORTIFY): $(PYBUDA_CSRC_REPORTIFY_OBJS) - @mkdir -p $(LIBDIR) - ar rcs $@ $^ - -$(OBJDIR)/pybuda/csrc/reportify/%.o: pybuda/csrc/reportify/%.cpp - @mkdir -p $(@D) - $(CXX) $(PYBUDA_CSRC_CFLAGS) $(CXXFLAGS) $(STATIC_LIB_FLAGS) $(PYBUDA_CSRC_REPORTIFY_INCLUDES) -c -o $@ $< - diff --git a/pybuda/csrc/shared_utils/module.mk b/pybuda/csrc/shared_utils/module.mk deleted file mode 100644 index 6c021df47..000000000 --- a/pybuda/csrc/shared_utils/module.mk +++ /dev/null @@ -1,26 +0,0 @@ -# Every variable in subdir must be prefixed with subdir (emulating a namespace) - -PYBUDA_CSRC_SHARED_UTILS_LIB = $(LIBDIR)/libsharedutils.a -PYBUDA_CSRC_SHARED_UTILS_SRCS += \ - pybuda/csrc/shared_utils/placement_printer.cpp \ - pybuda/csrc/shared_utils/pretty_table.cpp \ - pybuda/csrc/shared_utils/sparse_matmul_utils.cpp \ - pybuda/csrc/shared_utils/string_extension.cpp - -PYBUDA_CSRC_SHARED_UTILS_INCLUDES = $(PYBUDA_CSRC_INCLUDES) - -PYBUDA_CSRC_SHARED_UTILS_OBJS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_SHARED_UTILS_SRCS:.cpp=.o)) -PYBUDA_CSRC_SHARED_UTILS_DEPS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_SHARED_UTILS_SRCS:.cpp=.d)) - --include $(PYBUDA_CSRC_SHARED_UTILS_DEPS) - -# Each module has a top level target as the entrypoint which must match the subdir name -pybuda/csrc/shared_utils: $(PYBUDA_CSRC_SHARED_UTILS_LIB) - -$(PYBUDA_CSRC_SHARED_UTILS_LIB): $(PYBUDA_CSRC_SHARED_UTILS_OBJS) - @mkdir -p $(LIBDIR) - ar rcs $@ $^ - -$(OBJDIR)/pybuda/csrc/shared_utils/%.o: pybuda/csrc/shared_utils/%.cpp - @mkdir -p $(@D) - $(CXX) $(PYBUDA_CSRC_CFLAGS) $(CXXFLAGS) $(STATIC_LIB_FLAGS) $(PYBUDA_CSRC_SHARED_UTILS_INCLUDES) -c -o $@ $< diff --git a/pybuda/csrc/tt_torch_device/module.mk b/pybuda/csrc/tt_torch_device/module.mk deleted file mode 100644 index 05caabad8..000000000 --- a/pybuda/csrc/tt_torch_device/module.mk +++ /dev/null @@ -1,22 +0,0 @@ -PYBUDA_CSRC_TT_TORCH_DEVICE_LIB = ${LIBDIR}/libtt_torch_device.a -PYBUDA_CSRC_TT_TORCH_DEVICE_SRCS = \ - pybuda/csrc/tt_torch_device/tt_device.cpp \ - pybuda/csrc/tt_torch_device/torch_device_impl.cpp \ - pybuda/csrc/tt_torch_device/python_bindings.cpp - -PYBUDA_CSRC_TT_TORCH_DEVICE_INCLUDES = $(PYBUDA_CSRC_INCLUDES) - -PYBUDA_CSRC_TT_TORCH_DEVICE_OBJS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_TT_TORCH_DEVICE_SRCS:.cpp=.o)) -PYBUDA_CSRC_TT_TORCH_DEVICE_DEPS = $(addprefix $(OBJDIR)/, $(PYBUDA_CSRC_TT_TORCH_DEVICE_SRCS:.cpp=.d)) - --include $(PYBUDA_CSRC_TT_TORCH_DEVICE_DEPS) - -pybuda/csrc/tt_torch_device: $(PYBUDA_CSRC_TT_TORCH_DEVICE_LIB); - -$(PYBUDA_CSRC_TT_TORCH_DEVICE_LIB): $(PYBUDA_CSRC_TT_TORCH_DEVICE_OBJS) - @mkdir -p $(LIBDIR) - ar rcs $@ $^ - -$(OBJDIR)/pybuda/csrc/tt_torch_device/%.o: pybuda/csrc/tt_torch_device/%.cpp $(PYTHON_ENV) - @mkdir -p $(@D) - $(CXX) $(PYBUDA_CSRC_CFLAGS) $(CXXFLAGS) $(SHARED_LIB_FLAGS) $(PYBUDA_CSRC_TT_TORCH_DEVICE_INCLUDES) -c -o $@ $< diff --git a/pybuda/module.mk b/pybuda/module.mk deleted file mode 100644 index 647dd59ff..000000000 --- a/pybuda/module.mk +++ /dev/null @@ -1,8 +0,0 @@ -include pybuda/csrc/module.mk - -$(PYTHON_ENV_ROOT)/lib/$(PYTHON_VERSION)/site-packages/pybuda.egg-link: $(PYTHON_ENV) $(PYTHON_ENV_ROOT)/lib/$(PYTHON_VERSION)/site-packages/pybuda/_C.so - bash -c "source $(PYTHON_ENV_ROOT)/bin/activate; cd pybuda; pip install -e ." - touch -r $(PYTHON_ENV_ROOT)/lib/$(PYTHON_VERSION)/site-packages/pybuda/_C.so $@ - -pybuda: pybuda/csrc $(PYTHON_ENV_ROOT)/lib/$(PYTHON_VERSION)/site-packages/pybuda.egg-link ; -