Skip to content

Commit 3ddb1be

Browse files
committed
Merge branch 'branch-25.02' of github.com:nv-morpheus/Morpheus into david-stubgen-2074
2 parents 2d20b8a + 5e1116d commit 3ddb1be

File tree

12 files changed

+73
-25
lines changed

12 files changed

+73
-25
lines changed

ci/conda/recipes/morpheus-libs/meta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ outputs:
6464
- cudf {{ rapids_version }}
6565
- cython 3.0.*
6666
- glog >=0.7.1,<0.8
67+
- indicators=2.3
6768
- libcudf {{ rapids_version }}
6869
- librdkafka >=1.9.2,<1.10.0a0
6970
- mrc {{ minor_version }}

ci/conda/recipes/morpheus/meta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ outputs:
6969
- cudf {{ rapids_version }}
7070
- cython 3.0.*
7171
- glog >=0.7.1,<0.8
72+
- indicators=2.3
7273
- libcudf {{ rapids_version }}
7374
- librdkafka >=1.9.2,<1.10.0a0
7475
- mrc {{ minor_version }}

conda/environments/all_cuda-125_arch-x86_64.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ dependencies:
5151
- grpcio-status
5252
- gtest=1.14
5353
- gxx=12.1
54+
- httpx>=0.23,<0.28
5455
- huggingface_hub=0.20.2
5556
- include-what-you-use=0.20
5657
- indicators=2.3
@@ -136,6 +137,7 @@ dependencies:
136137
- faiss-cpu
137138
- google-search-results==2.4
138139
- langchain-nvidia-ai-endpoints==0.0.11
140+
- langchain-openai==0.1.3
139141
- langchain==0.1.16
140142
- milvus==2.3.5
141143
- nemollm==0.3.5

conda/environments/examples_cuda-125_arch-x86_64.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dependencies:
2525
- feedparser=6.0
2626
- grpcio
2727
- grpcio-status
28+
- httpx>=0.23,<0.28
2829
- huggingface_hub=0.20.2
2930
- jsonpatch>=1.33
3031
- kfp
@@ -73,6 +74,7 @@ dependencies:
7374
- faiss-cpu
7475
- google-search-results==2.4
7576
- langchain-nvidia-ai-endpoints==0.0.11
77+
- langchain-openai==0.1.3
7678
- langchain==0.1.16
7779
- milvus==2.3.5
7880
- nemollm==0.3.5

dependencies.yaml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,14 @@ dependencies:
430430
common:
431431
- output_types: [requirements]
432432
packages:
433-
- faiss-cpu
434-
- google-search-results==2.4
435-
- langchain==0.1.16
436-
- langchain-nvidia-ai-endpoints==0.0.11
433+
- &faiss-cpu faiss-cpu
434+
- &google-search-results google-search-results==2.4
435+
- &langchain langchain==0.1.16
436+
- &langchain-nvidia-ai-endpoints langchain-nvidia-ai-endpoints==0.0.11
437+
- &langchain-openai langchain-openai==0.1.3
437438
- milvus==2.3.5 # update to match pymilvus when available
438439
- pymilvus==2.3.6
439-
- nemollm==0.3.5
440+
- &nemollm nemollm==0.3.5
440441

441442
example-dfp-prod:
442443
common:
@@ -487,6 +488,7 @@ dependencies:
487488
- &transformers transformers=4.36.2 # newer versions are incompatible with our pinned version of huggingface_hub
488489
- anyio>=3.7
489490
- arxiv=1.4
491+
- httpx>=0.23,<0.28 # work-around for https://github.com/openai/openai-python/issues/1915
490492
- huggingface_hub=0.20.2 # work-around for https://github.com/UKPLab/sentence-transformers/issues/1762
491493
- jsonpatch>=1.33
492494
- newspaper3k=0.2
@@ -499,11 +501,12 @@ dependencies:
499501
- requests-toolbelt=1.0 # Transitive dep needed by nemollm, specified here to ensure we get a compatible version
500502
- pip
501503
- pip:
502-
- langchain==0.1.16
503-
- langchain-nvidia-ai-endpoints==0.0.11
504-
- faiss-cpu
505-
- google-search-results==2.4
506-
- nemollm==0.3.5
504+
- *faiss-cpu
505+
- *google-search-results
506+
- *langchain
507+
- *langchain-nvidia-ai-endpoints
508+
- *langchain-openai
509+
- *nemollm
507510
- sentence-transformers==2.7 # using pip now instead of conda to avoid install of pytorch cpu
508511

509512
model-training-tuning:

docker/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ COPY . ./
185185

186186
RUN --mount=type=cache,id=workspace_cache,target=/workspace/.cache,sharing=locked \
187187
--mount=type=cache,id=conda_pkgs,target=/opt/conda/pkgs,sharing=locked \
188+
--mount=type=cache,id=pip_cache,target=/root/.cache/pip,sharing=locked \
188189
# Install git-lfs before running the build to avoid errors during conda build
189190
/opt/conda/bin/mamba install -y -n base -c conda-forge "git-lfs" &&\
190191
source activate base &&\
@@ -227,6 +228,7 @@ COPY ${MORPHEUS_ROOT_HOST}/conda/environments/dev_cuda-${CUDA_MAJOR_VER}${CUDA_M
227228

228229
# Update the morpheus environment
229230
RUN --mount=type=cache,id=conda_pkgs,target=/opt/conda/pkgs,sharing=locked \
231+
--mount=type=cache,id=pip_cache,target=/root/.cache/pip,sharing=locked \
230232
# Temp add channel_alias to get around conda 404 errors
231233
conda config --env --set channel_alias ${CONDA_CHANNEL_ALIAS} &&\
232234
/opt/conda/bin/conda env update --solver=libmamba -n morpheus --file conda/environments/dev.yaml &&\
@@ -263,6 +265,7 @@ COPY . ./
263265

264266
RUN --mount=type=cache,id=workspace_cache,target=/workspace/.cache,sharing=locked \
265267
--mount=type=cache,id=conda_pkgs,target=/opt/conda/pkgs,sharing=locked \
268+
--mount=type=cache,id=pip_cache,target=/root/.cache/pip,sharing=locked \
266269
# Install git-lfs before running the build to avoid errors during conda build
267270
/opt/conda/bin/mamba install -y -n base -c conda-forge "git-lfs" &&\
268271
source activate base &&\
@@ -285,6 +288,7 @@ COPY . ./
285288
RUN --mount=type=cache,id=workspace_cache,target=/workspace/.cache,sharing=locked \
286289
--mount=type=bind,from=conda_bld_morpheus,source=/opt/conda/conda-bld,target=/opt/conda/conda-bld \
287290
--mount=type=cache,id=conda_pkgs,target=/opt/conda/pkgs,sharing=locked \
291+
--mount=type=cache,id=pip_cache,target=/root/.cache/pip,sharing=locked \
288292
source activate morpheus &&\
289293
CONDA_ALWAYS_YES=true /opt/conda/bin/mamba install -n morpheus \
290294
-c local \
@@ -314,6 +318,7 @@ COPY "${MORPHEUS_ROOT_HOST}/conda/environments/runtime_cuda-${CUDA_MAJOR_VER}${C
314318
# Mount Morpheus conda package build in `conda_bld_morpheus`
315319
RUN --mount=type=bind,from=conda_bld_morpheus,source=/opt/conda/conda-bld,target=/opt/conda/conda-bld \
316320
--mount=type=cache,id=conda_pkgs,target=/opt/conda/pkgs,sharing=locked \
321+
--mount=type=cache,id=pip_cache,target=/root/.cache/pip,sharing=locked \
317322
# CVE-2018-20225 for the base pip, not the env one
318323
# conda will ignore the request to remove pip
319324
python -m pip uninstall -y pip && \

examples/llm/agents/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from langchain.agents import initialize_agent
1919
from langchain.agents import load_tools
2020
from langchain.agents.agent import AgentExecutor
21-
from langchain.llms.openai import OpenAI
21+
from langchain_openai import OpenAI
2222

2323
from morpheus.config import Config
2424
from morpheus.pipeline.linear_pipeline import LinearPipeline

python/morpheus/morpheus/_lib/cudf_helpers.pyx

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
import itertools
17+
1618
import cudf
19+
from cudf.core.column import ColumnBase
1720
from cudf.core.dtypes import StructDtype
1821

1922
from libcpp.string cimport string
@@ -26,8 +29,6 @@ from pylibcudf.libcudf.table.table_view cimport table_view
2629
from pylibcudf.libcudf.types cimport size_type
2730

2831
from cudf._lib.column cimport Column
29-
from cudf._lib.utils cimport data_from_unique_ptr
30-
from cudf._lib.utils cimport table_view_from_table
3132

3233
##### THE FOLLOWING CODE IS COPIED FROM CUDF AND SHOULD BE REMOVED WHEN UPDATING TO cudf>=24.12 #####
3334
# see https://github.com/rapidsai/cudf/pull/17193 for details
@@ -39,6 +40,7 @@ cimport pylibcudf.libcudf.copying as cpp_copying
3940
from pylibcudf.libcudf.column.column_view cimport column_view
4041
from libcpp.memory cimport make_unique, unique_ptr
4142
from pylibcudf.libcudf.scalar.scalar cimport scalar
43+
from pylibcudf cimport Table as plc_Table
4244
from cudf._lib.scalar cimport DeviceScalar
4345

4446
# imports needed for from_column_view_with_fix
@@ -289,8 +291,35 @@ cdef public api:
289291
index_names = schema_infos[0:index_col_count] if index_col_count > 0 else None
290292
column_names = schema_infos[index_col_count:]
291293

292-
data, index = data_from_unique_ptr(move(table.tbl), column_names=column_names, index_names=index_names)
294+
plc_table = plc_Table.from_libcudf(move(table.tbl))
293295

296+
if index_names is None:
297+
index = None
298+
data = {
299+
col_name: ColumnBase.from_pylibcudf(col)
300+
for col_name, col in zip(
301+
column_names, plc_table.columns()
302+
)
303+
}
304+
else:
305+
result_columns = [
306+
ColumnBase.from_pylibcudf(col)
307+
for col in plc_table.columns()
308+
]
309+
index = cudf.Index._from_data(
310+
dict(
311+
zip(
312+
index_names,
313+
result_columns[: len(index_names)],
314+
)
315+
)
316+
)
317+
data = dict(
318+
zip(
319+
column_names,
320+
result_columns[len(index_names) :],
321+
)
322+
)
294323
df = cudf.DataFrame._from_data(data, index)
295324

296325
# Update the struct field names after the DataFrame is created
@@ -356,7 +385,13 @@ cdef public api:
356385

357386
cdef vector[string] temp_col_names = get_column_names(table, True)
358387

359-
cdef table_view input_table_view = table_view_from_table(table, ignore_index=False)
388+
cdef plc_Table plc_table = plc_Table(
389+
[
390+
col.to_pylibcudf(mode="read")
391+
for col in itertools.chain(table.index._columns, table._columns)
392+
]
393+
)
394+
cdef table_view input_table_view = plc_table.view()
360395
cdef vector[string] index_names
361396
cdef vector[string] column_names
362397

python/morpheus_llm/morpheus_llm/requirements_morpheus_llm.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
faiss-cpu
55
google-search-results==2.4
66
langchain-nvidia-ai-endpoints==0.0.11
7+
langchain-openai==0.1.3
78
langchain==0.1.16
89
milvus==2.3.5
910
nemollm==0.3.5

tests/_utils/llm.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,11 @@ def mk_mock_openai_response(messages: list[str]) -> mock.MagicMock:
8989
response = mock.MagicMock()
9090

9191
response.choices = [_mk_mock_choice(message) for message in messages]
92-
response.dict.return_value = {
93-
"choices": [{
94-
'message': {
95-
'role': 'assistant', 'content': message
96-
}
97-
} for message in messages]
98-
}
92+
93+
response_dict = {"choices": [{'message': {'role': 'assistant', 'content': message}} for message in messages]}
94+
95+
response.dict.return_value = response_dict
96+
response.model_dump.return_value = response_dict
9997

10098
return response
10199

0 commit comments

Comments
 (0)