Skip to content

Commit

Permalink
Breakout morpheus_llm (#1853)
Browse files Browse the repository at this point in the history
This PR breaks out the LLM source code into -
1. A separate subdirectory - python/morpheus_llm
2. Compiled as a separate shared lib -
   libmorpheus_llm.so
   |_ llm/__init__.cpython-310-x86_64-linux-gnu.so
3. And setup as a separate python package 
   a. morpheus_llm - all llm modules are now in this namespace
   b. with the following distribution - 
      ./build/python/morpheus_llm/dist/morpheus_llm-24.10.0a0+46.g125a6be9.dirty-py3-none-any.whl

To build and install all components in a dev env you can use these steps (steps also updated in contributing.md) -
1. ./scripts/compile_all.sh
2. pip install -e python/morpheus
3. pip install -e python/morpheus_llm

Items of note -
To ensure right order of build-n-install morpheus_llm has dependencies on the following targets -
1. cudf_helpers
2. morpheus
3. all "py_morpheus" targets
Ref: python/morpheus_llm/morpheus_llm/_lib/cmake/libmorpheus_llm.cmake

Pending (major) items -
1. Need to breakout llm related build/conda environment requirements from the base morpheus requirements
2. Need to breakout llm python tests (cpp tests have been moved as a part of this commit).

Authors:
  - Anuradha Karuppiah (https://github.com/AnuradhaKaruppiah)

Approvers:
  - David Gardner (https://github.com/dagardner-nv)

URL: #1853
  • Loading branch information
AnuradhaKaruppiah authored Aug 23, 2024
1 parent 5a83666 commit 78c48d6
Show file tree
Hide file tree
Showing 130 changed files with 1,499 additions and 357 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ option(BUILD_SHARED_LIBS "Default value for whether or not to build shared or st
option(MORPHEUS_BUILD_BENCHMARKS "Whether or not to build benchmarks" OFF)
option(MORPHEUS_BUILD_DOCS "Enable building of API documentation" OFF)
option(MORPHEUS_BUILD_EXAMPLES "Whether or not to build examples" OFF)
option(MORPHEUS_BUILD_MORPHEUS_LLM "Whether or not to build morpheus_llm" OFF)
option(MORPHEUS_BUILD_TESTS "Whether or not to build tests" OFF)
option(MORPHEUS_ENABLE_DEBUG_INFO "Enable printing debug information" OFF)
option(MORPHEUS_PYTHON_BUILD_STUBS "Whether or not to generated .pyi stub files for C++ Python modules. Disable to avoid requiring loading the NVIDIA GPU Driver during build" ON)
Expand All @@ -46,6 +47,10 @@ if(MORPHEUS_USE_IWYU AND MORPHEUS_USE_CCACHE)
message(FATAL_ERROR "MORPHEUS_USE_IWYU and MORPHEUS_USE_CCACHE cannot be set simultaneously")
endif()

if (MORPHEUS_BUILD_DOCS AND NOT MORPHEUS_BUILD_MORPHEUS_LLM)
message(FATAL_ERROR "MORPHEUS_BUILD_MORPHEUS_LLM must be ON if MORPHEUS_BUILD_DOCS is ON")
endif()

# MRC CMake path and module extensions
set(MORPHEUS_CMAKE_MODULE_PATH_EXTENSIONS
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
Expand Down
1 change: 1 addition & 0 deletions ci/conda/recipes/morpheus/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ outputs:
- MORPHEUS_CACHE_DIR
- MORPHEUS_PYTHON_BUILD_STUBS
- MORPHEUS_SUPPORT_DOCA
- MORPHEUS_BUILD_MORPHEUS_LLM
- PARALLEL_LEVEL
run_exports:
- {{ pin_subpackage("morpheus", max_pin="x.x") }}
Expand Down
6 changes: 6 additions & 0 deletions ci/conda/recipes/morpheus/morpheus_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

# Need to ensure this value is set before checking it in the if block
MORPHEUS_SUPPORT_DOCA=${MORPHEUS_SUPPORT_DOCA:-OFF}
MORPHEUS_BUILD_MORPHEUS_LLM=${MORPHEUS_BUILD_MORPHEUS_LLM:-OFF}

# This will store all of the cmake args. Make sure to prepend args to allow
# incoming values to overwrite them
Expand All @@ -44,6 +45,10 @@ if [[ ${MORPHEUS_SUPPORT_DOCA} == @(TRUE|ON) ]]; then
echo "MORPHEUS_SUPPORT_DOCA is ON. Setting CMAKE_CUDA_ARCHITECTURES to supported values: '${CMAKE_CUDA_ARCHITECTURES}'"
fi

if [[ ${MORPHEUS_BUILD_MORPHEUS_LLM} == @(TRUE|ON) ]]; then
CMAKE_ARGS="-DMORPHEUS_BUILD_MORPHEUS_LLM=ON ${CMAKE_ARGS}"
fi

CMAKE_ARGS="-DCMAKE_MESSAGE_CONTEXT_SHOW=ON ${CMAKE_ARGS}"
CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=$PREFIX ${CMAKE_ARGS}"
CMAKE_ARGS="-DCMAKE_INSTALL_LIBDIR=lib ${CMAKE_ARGS}"
Expand Down Expand Up @@ -94,3 +99,4 @@ cmake --build ${BUILD_DIR} -j${PARALLEL_LEVEL:-$(nproc)} --target install

# Install just the python wheel components
${PYTHON} -m pip install -vv ${BUILD_DIR}/python/morpheus/dist/*.whl
${PYTHON} -m pip install -vv ${BUILD_DIR}/python/morpheus_llm/dist/*.whl
1 change: 1 addition & 0 deletions ci/conda/recipes/run_conda_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export MORPHEUS_PYTHON_BUILD_STUBS=${MORPHEUS_PYTHON_BUILD_STUBS:-"ON"}
export MORPHEUS_CACHE_DIR=${MORPHEUS_CACHE_DIR:-"${MORPHEUS_ROOT}/.cache"}
export PARALLEL_LEVEL=${PARALLEL_LEVEL:-$(nproc)}
export MORPHEUS_SUPPORT_DOCA=${MORPHEUS_SUPPORT_DOCA:-OFF}
export MORPHEUS_BUILD_MORPHEUS_LLM=${MORPHEUS_BUILD_MORPHEUS_LLM:-ON}

# Set CONDA_CHANNEL_ALIAS to mimic the conda config channel_alias property during the build
CONDA_CHANNEL_ALIAS=${CONDA_CHANNEL_ALIAS:-""}
Expand Down
1 change: 1 addition & 0 deletions ci/runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ RUN rapids-dependency-file-generator \
rm -rf /tmp/conda

ENV MORPHEUS_SUPPORT_DOCA=ON
ENV MORPHEUS_BUILD_MORPHEUS_LLM=ON

COPY ./.devcontainer/docker/optional_deps/doca.sh /tmp/doca/

Expand Down
6 changes: 4 additions & 2 deletions ci/scripts/github/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ cmake --build ${BUILD_DIR} --parallel ${PARALLEL_LEVEL}
log_sccache_stats

rapids-logger "Archiving results"
tar cfj "${WORKSPACE_TMP}/wheel.tar.bz" ${BUILD_DIR}/python/morpheus/dist
tar cfj "${WORKSPACE_TMP}/wheel.tar.bz" ${BUILD_DIR}/python/morpheus/dist ${BUILD_DIR}/python/morpheus_llm/dist

MORPHEUS_LIBS=($(find ${MORPHEUS_ROOT}/${BUILD_DIR}/python/morpheus/morpheus/_lib -name "*.so" -exec realpath --relative-to ${MORPHEUS_ROOT} {} \;) \
$(find ${MORPHEUS_ROOT}/${BUILD_DIR}/python/morpheus_llm/morpheus_llm/_lib -name "*.so" -exec realpath --relative-to ${MORPHEUS_ROOT} {} \;) \
$(find ${MORPHEUS_ROOT}/examples -name "*.so" -exec realpath --relative-to ${MORPHEUS_ROOT} {} \;))
tar cfj "${WORKSPACE_TMP}/morhpeus_libs.tar.bz" "${MORPHEUS_LIBS[@]}"

CPP_TESTS=($(find ${MORPHEUS_ROOT}/${BUILD_DIR}/python/morpheus/morpheus/_lib/tests -name "*.x" -exec realpath --relative-to ${MORPHEUS_ROOT} {} \;))
CPP_TESTS=($(find ${MORPHEUS_ROOT}/${BUILD_DIR}/python/morpheus/morpheus/_lib/tests -name "*.x" -exec realpath --relative-to ${MORPHEUS_ROOT} {} \;) \
$(find ${MORPHEUS_ROOT}/${BUILD_DIR}/python/morpheus_llm/morpheus_llm/_lib/tests -name "*.x" -exec realpath --relative-to ${MORPHEUS_ROOT} {} \;))
tar cfj "${WORKSPACE_TMP}/cpp_tests.tar.bz" "${CPP_TESTS[@]}"

rapids-logger "Pushing results to ${DISPLAY_ARTIFACT_URL}"
Expand Down
1 change: 1 addition & 0 deletions ci/scripts/github/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ log_sccache_stats

rapids-logger "Installing Morpheus"
pip install ./python/morpheus
pip install ./python/morpheus_llm

rapids-logger "Checking copyright headers"
python ${MORPHEUS_ROOT}/ci/scripts/copyright.py --verify-apache-v2 --git-diff-commits ${CHANGE_TARGET} ${GIT_COMMIT}
Expand Down
1 change: 1 addition & 0 deletions ci/scripts/github/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ _FLAGS+=("-DMORPHEUS_PYTHON_BUILD_STUBS=ON")
_FLAGS+=("-DMORPHEUS_BUILD_BENCHMARKS=ON")
_FLAGS+=("-DMORPHEUS_BUILD_EXAMPLES=ON")
_FLAGS+=("-DMORPHEUS_BUILD_TESTS=ON")
_FLAGS+=("-DMORPHEUS_BUILD_MORPHEUS_LLM=ON")
if [[ "${LOCAL_CI}" == "" ]]; then
_FLAGS+=("-DCCACHE_PROGRAM_PATH=$(which sccache)")
fi
Expand Down
1 change: 1 addition & 0 deletions ci/scripts/github/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ download_artifact "wheel.tar.bz"
tar xf "${WORKSPACE_TMP}/wheel.tar.bz"

pip install ${MORPHEUS_ROOT}/${BUILD_DIR}/python/morpheus/dist/*.whl
pip install ${MORPHEUS_ROOT}/${BUILD_DIR}/python/morpheus_llm/dist/*.whl

rapids-logger "Pulling LFS assets"
cd ${MORPHEUS_ROOT}
Expand Down
21 changes: 12 additions & 9 deletions docker/build_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ FROM_IMAGE=${FROM_IMAGE:-"nvidia/cuda"}
LINUX_DISTRO=${LINUX_DISTRO:-ubuntu}
LINUX_VER=${LINUX_VER:-22.04}
MORPHEUS_SUPPORT_DOCA=${MORPHEUS_SUPPORT_DOCA:-"OFF"}
MORPHEUS_BUILD_MORPHEUS_LLM=${MORPHEUS_BUILD_MORPHEUS_LLM:-"ON"}
PYTHON_VER=${PYTHON_VER:-3.10}

# Determine the relative path from $PWD to $MORPHEUS_ROOT
Expand All @@ -51,6 +52,7 @@ DOCKER_ARGS="${DOCKER_ARGS} --build-arg LINUX_DISTRO=${LINUX_DISTRO}"
DOCKER_ARGS="${DOCKER_ARGS} --build-arg LINUX_VER=${LINUX_VER}"
DOCKER_ARGS="${DOCKER_ARGS} --build-arg MORPHEUS_ROOT_HOST=${MORPHEUS_ROOT_HOST}"
DOCKER_ARGS="${DOCKER_ARGS} --build-arg MORPHEUS_SUPPORT_DOCA=${MORPHEUS_SUPPORT_DOCA}"
DOCKER_ARGS="${DOCKER_ARGS} --build-arg MORPHEUS_BUILD_MORPHEUS_LLM=${MORPHEUS_BUILD_MORPHEUS_LLM}"
DOCKER_ARGS="${DOCKER_ARGS} --build-arg PYTHON_VER=${PYTHON_VER}"
DOCKER_ARGS="${DOCKER_ARGS} --network=host"

Expand All @@ -61,15 +63,16 @@ DOCKER_ARGS="${DOCKER_ARGS} ${DOCKER_EXTRA_ARGS}"
export DOCKER_BUILDKIT=1

echo "Building morpheus:${DOCKER_TAG} with args..."
echo " CUDA_MAJOR_VER : ${CUDA_MAJOR_VER}"
echo " CUDA_MINOR_VER : ${CUDA_MINOR_VER}"
echo " CUDA_REV_VER : ${CUDA_REV_VER}"
echo " FROM_IMAGE : ${FROM_IMAGE}"
echo " LINUX_DISTRO : ${LINUX_DISTRO}"
echo " LINUX_VER : ${LINUX_VER}"
echo " MORPHEUS_ROOT_HOST : ${MORPHEUS_ROOT_HOST}"
echo " MORPHEUS_SUPPORT_DOCA: ${MORPHEUS_SUPPORT_DOCA}"
echo " PYTHON_VER : ${PYTHON_VER}"
echo " CUDA_MAJOR_VER : ${CUDA_MAJOR_VER}"
echo " CUDA_MINOR_VER : ${CUDA_MINOR_VER}"
echo " CUDA_REV_VER : ${CUDA_REV_VER}"
echo " FROM_IMAGE : ${FROM_IMAGE}"
echo " LINUX_DISTRO : ${LINUX_DISTRO}"
echo " LINUX_VER : ${LINUX_VER}"
echo " MORPHEUS_ROOT_HOST : ${MORPHEUS_ROOT_HOST}"
echo " MORPHEUS_SUPPORT_DOCA : ${MORPHEUS_SUPPORT_DOCA}"
echo " MORPHEUS_BUILD_MORPHEUS_LLM: ${MORPHEUS_BUILD_MORPHEUS_LLM}"
echo " PYTHON_VER : ${PYTHON_VER}"

echo ""
echo " COMMAND: docker build ${DOCKER_ARGS} -f ${SCRIPT_DIR}/Dockerfile ."
Expand Down
1 change: 1 addition & 0 deletions docker/run_container_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ x="\033[0m"
pushd ${SCRIPT_DIR} &> /dev/null

MORPHEUS_SUPPORT_DOCA=${MORPHEUS_SUPPORT_DOCA:-OFF}
MORPHEUS_BUILD_MORPHEUS_LLM=${MORPHEUS_BUILD_MORPHEUS_LLM:-ON}

DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME:-"nvcr.io/nvidia/morpheus/morpheus"}
DOCKER_IMAGE_TAG=${DOCKER_IMAGE_TAG:-"$(git describe --tags --abbrev=0)-runtime"}
Expand Down
4 changes: 2 additions & 2 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ add_custom_target(${PROJECT_NAME}_docs
BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR} ${SPHINX_EXECUTABLE} ${SPHINX_HTML_ARGS} ${SPHINX_SOURCE} ${SPHINX_BUILD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating documentation with Sphinx"
DEPENDS morpheus-package-outputs
DEPENDS morpheus-package-outputs morpheus_llm-package-outputs
)

add_custom_target(${PROJECT_NAME}_docs_linkcheck
COMMAND
BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR} ${SPHINX_EXECUTABLE} ${SPHINX_LINKCHECK_ARGS} ${SPHINX_SOURCE} ${SPHINX_LINKCHECK_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Checking documentation links with Sphinx"
DEPENDS morpheus-package-outputs
DEPENDS morpheus-package-outputs morpheus_llm-package-outputs
)

list(POP_BACK CMAKE_MESSAGE_CONTEXT)
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
FILE_PATTERNS = *.c *.cc *.cpp *.h *.hpp *.cu *.cuh *.md
HAVE_DOT = YES
HIDE_UNDOC_MEMBERS = NO
INPUT = ../../python/morpheus/morpheus/_lib
INPUT = ../../python/morpheus/morpheus/_lib ../../python/morpheus_llm/morpheus_llm/_lib
INTERACTIVE_SVG = YES
SOURCE_BROWSER = YES
ENABLE_PREPROCESSING = YES
Expand Down
1 change: 1 addition & 0 deletions docs/source/developer_guide/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ git submodule update --init --recursive
1. Install Morpheus
```bash
pip install -e ${MORPHEUS_ROOT}/python/morpheus
pip install -e ${MORPHEUS_ROOT}/python/morpheus_llm
```
Once Morpheus has been built, it can be installed into the current virtual environment.
1. Test the build (Note: some tests will be skipped)\
Expand Down
1 change: 1 addition & 0 deletions docs/source/py_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ Python API
:recursive:

morpheus
morpheus_llm
10 changes: 5 additions & 5 deletions examples/llm/agents/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
from langchain.llms.openai import OpenAI

from morpheus.config import Config
from morpheus.llm import LLMEngine
from morpheus.llm.nodes.extracter_node import ExtracterNode
from morpheus.llm.nodes.langchain_agent_node import LangChainAgentNode
from morpheus.llm.task_handlers.simple_task_handler import SimpleTaskHandler
from morpheus.messages import ControlMessage
from morpheus.pipeline.linear_pipeline import LinearPipeline
from morpheus.stages.general.monitor_stage import MonitorStage
from morpheus.stages.llm.llm_engine_stage import LLMEngineStage
from morpheus.stages.output.in_memory_sink_stage import InMemorySinkStage
from morpheus.stages.preprocess.deserialize_stage import DeserializeStage
from morpheus_llm.llm import LLMEngine
from morpheus_llm.llm.nodes.extracter_node import ExtracterNode
from morpheus_llm.llm.nodes.langchain_agent_node import LangChainAgentNode
from morpheus_llm.llm.task_handlers.simple_task_handler import SimpleTaskHandler
from morpheus_llm.stages.llm.llm_engine_stage import LLMEngineStage

logger = logging.getLogger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions examples/llm/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
import pymilvus
from langchain.embeddings import HuggingFaceEmbeddings # pylint: disable=no-name-in-module

from morpheus.llm.services.llm_service import LLMService
from morpheus.llm.services.nemo_llm_service import NeMoLLMService
from morpheus.llm.services.openai_chat_service import OpenAIChatService
from morpheus.service.vdb.milvus_client import DATA_TYPE_MAP
from morpheus.service.vdb.milvus_vector_db_service import MilvusVectorDBService
from morpheus.service.vdb.utils import VectorDBServiceFactory
from morpheus_llm.llm.services.llm_service import LLMService
from morpheus_llm.llm.services.nemo_llm_service import NeMoLLMService
from morpheus_llm.llm.services.openai_chat_service import OpenAIChatService

logger = logging.getLogger(__name__)

Expand Down
18 changes: 9 additions & 9 deletions examples/llm/completion/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
from morpheus.config import Config
from morpheus.config import PipelineModes
from morpheus.io.deserializers import read_file_to_df
from morpheus.llm import LLMEngine
from morpheus.llm.nodes.extracter_node import ExtracterNode
from morpheus.llm.nodes.llm_generate_node import LLMGenerateNode
from morpheus.llm.nodes.prompt_template_node import PromptTemplateNode
from morpheus.llm.services.llm_service import LLMService
from morpheus.llm.services.nemo_llm_service import NeMoLLMService
from morpheus.llm.services.openai_chat_service import OpenAIChatService
from morpheus.llm.task_handlers.simple_task_handler import SimpleTaskHandler
from morpheus.messages import ControlMessage
from morpheus.pipeline.linear_pipeline import LinearPipeline
from morpheus.stages.general.monitor_stage import MonitorStage
from morpheus.stages.input.in_memory_source_stage import InMemorySourceStage
from morpheus.stages.llm.llm_engine_stage import LLMEngineStage
from morpheus.stages.output.in_memory_sink_stage import InMemorySinkStage
from morpheus.stages.preprocess.deserialize_stage import DeserializeStage
from morpheus.utils.concat_df import concat_dataframes
from morpheus_llm.llm import LLMEngine
from morpheus_llm.llm.nodes.extracter_node import ExtracterNode
from morpheus_llm.llm.nodes.llm_generate_node import LLMGenerateNode
from morpheus_llm.llm.nodes.prompt_template_node import PromptTemplateNode
from morpheus_llm.llm.services.llm_service import LLMService
from morpheus_llm.llm.services.nemo_llm_service import NeMoLLMService
from morpheus_llm.llm.services.openai_chat_service import OpenAIChatService
from morpheus_llm.llm.task_handlers.simple_task_handler import SimpleTaskHandler
from morpheus_llm.stages.llm.llm_engine_stage import LLMEngineStage

logger = logging.getLogger(__name__)

Expand Down
10 changes: 5 additions & 5 deletions examples/llm/rag/standalone_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@

from morpheus.config import Config
from morpheus.config import PipelineModes
from morpheus.llm import LLMEngine
from morpheus.llm.nodes.extracter_node import ExtracterNode
from morpheus.llm.nodes.rag_node import RAGNode
from morpheus.llm.task_handlers.simple_task_handler import SimpleTaskHandler
from morpheus.messages import ControlMessage
from morpheus.pipeline.linear_pipeline import LinearPipeline
from morpheus.stages.general.monitor_stage import MonitorStage
from morpheus.stages.input.in_memory_source_stage import InMemorySourceStage
from morpheus.stages.llm.llm_engine_stage import LLMEngineStage
from morpheus.stages.output.in_memory_sink_stage import InMemorySinkStage
from morpheus.stages.preprocess.deserialize_stage import DeserializeStage
from morpheus.utils.concat_df import concat_dataframes
from morpheus_llm.llm import LLMEngine
from morpheus_llm.llm.nodes.extracter_node import ExtracterNode
from morpheus_llm.llm.nodes.rag_node import RAGNode
from morpheus_llm.llm.task_handlers.simple_task_handler import SimpleTaskHandler
from morpheus_llm.stages.llm.llm_engine_stage import LLMEngineStage

from ..common.utils import build_huggingface_embeddings
from ..common.utils import build_llm_service
Expand Down
4 changes: 4 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ list(APPEND CMAKE_MESSAGE_CONTEXT "python")

add_subdirectory(morpheus)

if (MORPHEUS_BUILD_MORPHEUS_LLM)
add_subdirectory(morpheus_llm)
endif()

list(POP_BACK CMAKE_MESSAGE_CONTEXT)
9 changes: 6 additions & 3 deletions python/morpheus/morpheus/_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ morpheus_add_cython_library(
cudf_helpers_target
)

set_property(GLOBAL PROPERTY cudf_helpers_target_property "${cudf_helpers_target}")

execute_process(
COMMAND "${Python_EXECUTABLE}" -c "import pyarrow; print(pyarrow.get_include())"
OUTPUT_VARIABLE PYARROW_INCLUDE_DIR
Expand Down Expand Up @@ -72,18 +74,19 @@ morpheus_utils_python_package_set_default_link_targets(morpheus)

# #----------morpheus._lib.common---------
morpheus_add_pybind11_module(common SOURCE_FILES common/module.cpp)
set_property(GLOBAL APPEND PROPERTY py_morpheus_target_property morpheus._lib.common)

#----------morpheus._lib.stages---------
morpheus_add_pybind11_module(stages SOURCE_FILES stages/module.cpp)

#----------morpheus._lib.llm---------
add_subdirectory(llm)
set_property(GLOBAL APPEND PROPERTY py_morpheus_target_property morpheus._lib.stages)

#----------morpheus._lib.messages---------
morpheus_add_pybind11_module(messages SOURCE_FILES messages/module.cpp)
set_property(GLOBAL APPEND PROPERTY py_morpheus_target_property morpheus._lib.messages)

#----------morpheus._lib.modules---------
morpheus_add_pybind11_module(modules SOURCE_FILES modules/module.cpp)
set_property(GLOBAL APPEND PROPERTY py_morpheus_target_property morpheus._lib.modules)

#----------morpheus._lib.doca---------
if(MORPHEUS_SUPPORT_DOCA)
Expand Down
2 changes: 0 additions & 2 deletions python/morpheus/morpheus/_lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
# limitations under the License.

from . import common
from . import llm
from . import messages
from . import modules
from . import stages

__all__ = [
"common",
"llm",
"messages",
"modules",
"stages",
Expand Down
8 changes: 0 additions & 8 deletions python/morpheus/morpheus/_lib/cmake/libmorpheus.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ add_library(morpheus
src/io/loaders/payload.cpp
src/io/loaders/rest.cpp
src/io/serializers.cpp
src/llm/input_map.cpp
src/llm/llm_context.cpp
src/llm/llm_engine.cpp
src/llm/llm_node_runner.cpp
src/llm/llm_node.cpp
src/llm/llm_task_handler_runner.cpp
src/llm/llm_task.cpp
src/llm/utils.cpp
src/messages/control.cpp
src/messages/memory/inference_memory_fil.cpp
src/messages/memory/inference_memory_nlp.cpp
Expand Down
12 changes: 0 additions & 12 deletions python/morpheus/morpheus/_lib/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,6 @@ add_morpheus_test(
test_file_in_out.cpp
)

add_morpheus_test(
NAME llm
FILES
llm/test_llm_context.cpp
llm/test_llm_engine.cpp
llm/test_llm_node.cpp
llm/test_llm_node_runner.cpp
llm/test_llm_task.cpp
llm/test_llm_task_handler_runner.cpp
llm/test_utils.cpp
)

add_morpheus_test(
NAME matx_util
FILES
Expand Down
Loading

0 comments on commit 78c48d6

Please sign in to comment.