Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakout morpheus_llm #1853

Merged
merged 23 commits into from
Aug 23, 2024
Merged

Conversation

AnuradhaKaruppiah
Copy link
Contributor

@AnuradhaKaruppiah AnuradhaKaruppiah commented Aug 19, 2024

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).

@AnuradhaKaruppiah AnuradhaKaruppiah requested review from a team as code owners August 19, 2024 20:34
Copy link

copy-pr-bot bot commented Aug 19, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@AnuradhaKaruppiah AnuradhaKaruppiah added non-breaking Non-breaking change improvement Improvement to existing functionality conda-build Enables running the conda-build step on a PR labels Aug 19, 2024
@AnuradhaKaruppiah
Copy link
Contributor Author

/ok to test

@AnuradhaKaruppiah AnuradhaKaruppiah added breaking Breaking change non-breaking Non-breaking change and removed non-breaking Non-breaking change breaking Breaking change labels Aug 19, 2024
@AnuradhaKaruppiah
Copy link
Contributor Author

/ok to test

Copy link
Contributor

@dagardner-nv dagardner-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just need to fix the documentation builds.

ci/scripts/github/docs.sh Show resolved Hide resolved
python/CMakeLists.txt Show resolved Hide resolved
@AnuradhaKaruppiah
Copy link
Contributor Author

/ok to test

@AnuradhaKaruppiah
Copy link
Contributor Author

/ok to test

@AnuradhaKaruppiah
Copy link
Contributor Author

@dagardner-nv Can you please take another look at the review. I have updated it -

  1. To include a build flag for morpheus_llm - commits 1, 2, 3

  2. Changed the include dir name to morpheus_llm to prevent namespace conflict when MORPHEUS_PYTHON_INPLACE_BUILD=OFF - commits 1, 2, 3

  3. Update the docs build for including morpheus_llm in the py_api.html and python/morpheus_llm/morpheus_llm/_lib while generating the C++ APIs - commit

Copy link
Contributor

@dagardner-nv dagardner-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one issue noted above re documentation builds.

docs/CMakeLists.txt Show resolved Hide resolved
@AnuradhaKaruppiah
Copy link
Contributor Author

/ok to test

1 similar comment
@AnuradhaKaruppiah
Copy link
Contributor Author

/ok to test

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Drop test_cuda.cu. That is a part of the morpheus tests.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
This workaround is needed for building morpheus_llm py bindings without
installing morpheus.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
morpheus is already specified via target_link_libraries ensuring it will
be built before morpheus_llm

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
This is needed to setup the namespace correctly when building with
MORPHEUS_PYTHON_INPLACE_BUILD=OFF

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
This is on by default

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
This may need to be fixed up

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
We may need to revisit this and split up the documentation

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Added a message in the main CMakelists.txt t check for this and fail the
build early. Sample output -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Runing CMake configure...
+ cmake -S . -B build -GNinja -DCMAKE_MESSAGE_CONTEXT_SHOW=ON
  -DMORPHEUS_USE_CLANG_TIDY=OFF -DMORPHEUS_PYTHON_INPLACE_BUILD=ON
-DMORPHEUS_PYTHON_PERFORM_INSTALL=ON -DMORPHEUS_USE_CCACHE=ON
-DMORPHEUS_USE_CONDA=ON -DMORPHEUS_SUPPORT_DOCA=OFF
-DMORPHEUS_BUILD_MORPHEUS_LLM=ON
-DCMAKE_AR=/home/ubuntu/miniforge3/envs/comp-llm/bin/x86_64-conda-linux-gnu-ar
-DCMAKE_CXX_COMPILER_AR=/home/ubuntu/miniforge3/envs/comp-llm/bin/x86_64-conda-linux-gnu-gcc-ar
-DCMAKE_C_COMPILER_AR=/home/ubuntu/miniforge3/envs/comp-llm/bin/x86_64-conda-linux-gnu-gcc-ar
-DCMAKE_RANLIB=/home/ubuntu/miniforge3/envs/comp-llm/bin/x86_64-conda-linux-gnu-ranlib
-DCMAKE_CXX_COMPILER_RANLIB=/home/ubuntu/miniforge3/envs/comp-llm/bin/x86_64-conda-linux-gnu-gcc-ranlib
-DCMAKE_C_COMPILER_RANLIB=/home/ubuntu/miniforge3/envs/comp-llm/bin/x86_64-conda-linux-gnu-gcc-ranlib
-DCMAKE_LINKER=/home/ubuntu/miniforge3/envs/comp-llm/bin/x86_64-conda-linux-gnu-ld
-DCMAKE_STRIP=/home/ubuntu/miniforge3/envs/comp-llm/bin/x86_64-conda-linux-gnu-strip
-DMORPHEUS_BUILD_DOCS=ON -DMORPHEUS_BUILD_MORPHEUS_LLM=OFF
CMake Error at CMakeLists.txt:51 (message):
  MORPHEUS_BUILD_MORPHEUS_LLM must be ON if MORPHEUS_BUILD_DOCS is ON
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

-- Configuring incomplete, errors occurred!

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
@AnuradhaKaruppiah
Copy link
Contributor Author

/ok to test

@AnuradhaKaruppiah
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 78c48d6 into nv-morpheus:branch-24.10 Aug 23, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conda-build Enables running the conda-build step on a PR improvement Improvement to existing functionality non-breaking Non-breaking change
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants