Skip to content

Commit

Permalink
Merge branch 'branch-23.11' into david-test-gil-tls-362
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Sep 11, 2023
2 parents 7b39722 + 5747320 commit 3210a04
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 35 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ option(MRC_BUILD_PYTHON "Enable building the python bindings for MRC" ON)
option(MRC_BUILD_TESTS "Whether or not to build MRC tests" ON)
option(MRC_ENABLE_CODECOV "Enable gcov code coverage" OFF)
option(MRC_ENABLE_DEBUG_INFO "Enable printing debug information" OFF)
option(MRC_PYTHON_INPLACE_BUILD "Whether or not to copy built python modules back to the source tree for debug purposes." OFF)
option(MRC_USE_CCACHE "Enable caching compilation results with ccache" OFF)
option(MRC_USE_CLANG_TIDY "Enable running clang-tidy as part of the build process" OFF)
option(MRC_USE_CONDA "Enables finding dependencies via conda. All dependencies must be installed first in the conda
Expand Down
16 changes: 8 additions & 8 deletions ci/conda/environments/clang_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ name: mrc
channels:
- conda-forge
dependencies:
- clang=15
- clang-tools=15
- clangdev=15
- clangxx=15
- libclang=15
- libclang-cpp=15
- llvmdev=15
- include-what-you-use=0.19
- clang=16
- clang-tools=16
- clangdev=16
- clangxx=16
- libclang=16
- libclang-cpp=16
- llvmdev=16
- include-what-you-use
4 changes: 2 additions & 2 deletions ci/conda/environments/dev_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies:
- autoconf>=2.69
- bash-completion
- benchmark=1.6.0
- boost-cpp=1.82
- boost-cpp=1.74
- ccache
- cmake=3.24
- cuda-toolkit # Version comes from the channel above
Expand All @@ -46,7 +46,7 @@ dependencies:
- isort
- jinja2=3.0
- lcov=1.15
- libhwloc=2.9.2
- libhwloc=2.5
- libprotobuf=3.21
- librmm=23.06
- libtool
Expand Down
5 changes: 4 additions & 1 deletion ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ function sed_runner() {

# .gitmodules
git submodule set-branch -b branch-${NEXT_SHORT_TAG} morpheus_utils
git submodule update --remote
if [[ "$(git diff --name-only | grep .gitmodules)" != "" ]]; then
# Only update the submodules if setting the branch changed .gitmodules
git submodule update --remote
fi

# Root CMakeLists.txt
sed_runner 's/'"VERSION ${CURRENT_FULL_VERSION}.*"'/'"VERSION ${NEXT_FULL_VERSION}"'/g' CMakeLists.txt
Expand Down
60 changes: 60 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Dependency list for https://github.com/rapidsai/dependency-file-generator
files:
all:
output: conda
matrix:
cuda: ["11.8"]
arch: [x86_64]
includes:
- empty
- build_cpp
- cudatoolkit

channels:
- rapidsai
- nvidia/label/cuda-11.8.0
- nvidia
- rapidsai-nightly
- conda-forge

dependencies:

empty:
common:
- output_types: [conda]
packages:
- cxx-compiler

build_cpp:
common:
- output_types: [conda]
packages:
- boost-cpp=1.82
- ccache
- cmake=3.24
- cuda-nvcc
- cxx-compiler
- glog=0.6
- gxx=11.2
- libgrpc=1.54.0
- libhwloc=2.9.2
- librmm=23.06
- ninja=1.10
- ucx=1.14
- nlohmann_json=3.9
- gtest=1.13
- scikit-build>=0.17
- pybind11-stubgen=0.10
- python=3.10
cudatoolkit:
specific:
- output_types: [conda]
matrices:
- matrix:
cuda: "11.8"
packages:
- cuda-cudart-dev=11.8
- cuda-nvrtc-dev=11.8
- cuda-version=11.8
- cuda-nvml-dev=11.8
- cuda-tools=11.8
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,33 @@ Lets look at a more complex example:
value_count = 0
value_sum = 0

def node_fn(src: mrc.Observable, dst: mrc.Subscriber):
def update_obj(x: MyCustomClass):
nonlocal value_count
nonlocal value_sum
def update_obj(x: MyCustomClass):
nonlocal value_count
nonlocal value_sum

# Alter the value property of the class
x.value = x.value * 2
# Alter the value property of the class
x.value = x.value * 2

# Update the sum values
value_count += 1
value_sum += x.value
# Update the sum values
value_count += 1
value_sum += x.value

return x
return x

def on_completed():
def on_completed():

# Prevent divide by 0. Just in case
if (value_count <= 0):
return
# Prevent divide by 0. Just in case
if (value_count <= 0):
return

return MyCustomClass(value_sum / value_count, "Mean")

src.pipe(
ops.filter(lambda x: x.value % 2 == 0),
ops.map(update_obj),
ops.on_completed(on_completed)
).subscribe(dst)
return MyCustomClass(value_sum / value_count, "Mean")

# Make an intermediate node
node = seg.make_node_full("node", node_fn)
node = seg.make_node("node",
ops.filter(lambda x: x.value % 2 == 0),
ops.map(update_obj),
ops.on_completed(on_completed)
)
```

In this example, we are using 3 different operators: `filter`, `map`, and `on_completed`:
Expand All @@ -66,7 +63,7 @@ In this example, we are using 3 different operators: `filter`, `map`, and `on_co
- The `map` operator can transform the incoming value and return a new value
- In our example, we are doubling the `value` property and recording the total count and total sum of this property
- The `on_completed` function is only called once when there are no more messages to process. You can optionally return a value which will be passed on to the rest of the pipeline.
- In our example, we are calculating the average from the sum and count values and emitting a new obect with the value set to the mean
- In our example, we are calculating the average from the sum and count values and emitting a new object with the value set to the mean

In combination, these operators perform a higher level functionality to modify the stream, record some information, and finally print an analysis of all emitted values. Let's see it in practice.

Expand Down
3 changes: 2 additions & 1 deletion python/mrc/_pymrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ target_link_libraries(pymrc
PUBLIC
${PROJECT_NAME}::libmrc
${Python_LIBRARIES}
prometheus-cpp::core
pybind11::pybind11
PRIVATE
prometheus-cpp::core
)

target_include_directories(pymrc
Expand Down

0 comments on commit 3210a04

Please sign in to comment.