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

Deprecate ResponseMemoryProbs & MultiResponseProbsMessage #711

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
cdfdcfc
Expose constructors for TensorMemory, InferenceMemory and ResponseMem…
dagardner-nv Jan 20, 2023
4b353ec
Remove un-needed print statement
dagardner-nv Jan 20, 2023
ca9f5a2
Update tests
dagardner-nv Jan 20, 2023
e2022bc
add a tensors property
dagardner-nv Jan 20, 2023
8d5dfaf
Merge branch 'branch-23.01' into david-constructors-604
dagardner-nv Jan 23, 2023
47788b0
Merge branch 'branch-23.01' into david-constructors-604
dagardner-nv Jan 26, 2023
ae0f480
Merge branch 'branch-23.01' into david-constructors-604
dagardner-nv Jan 26, 2023
26cb7bf
Use a type alias
dagardner-nv Jan 27, 2023
00815f6
WIP
dagardner-nv Jan 27, 2023
5e84e64
Merge branch 'branch-23.01' into david-constructors-604
dagardner-nv Jan 27, 2023
f9a317c
Fix bad copy-paste
dagardner-nv Jan 28, 2023
91f58ca
Set docstring on property method
dagardner-nv Jan 28, 2023
6d85a52
Move cupy_to_tensors and tensors_to_cupy to CupyUtil
dagardner-nv Jan 28, 2023
648ca0a
wip - not working
dagardner-nv Jan 28, 2023
158e7e7
wip
dagardner-nv Jan 28, 2023
7341d02
Fix constructor args
dagardner-nv Jan 30, 2023
392eb44
tests wip
dagardner-nv Jan 30, 2023
e3c7f41
Merge branch 'branch-23.01' into david-constructors-604
dagardner-nv Jan 30, 2023
952cfeb
wip
dagardner-nv Jan 30, 2023
ac6f381
Merge branch 'branch-23.01' into david-constructors-604
dagardner-nv Jan 30, 2023
b443ac0
Finish tests
dagardner-nv Jan 30, 2023
9a6d1cd
Ensure popen is defined
dagardner-nv Jan 30, 2023
87b63c3
Move tensor_map_t
dagardner-nv Jan 30, 2023
f64c895
wip
dagardner-nv Jan 30, 2023
7fc1c71
Use typedef
dagardner-nv Jan 30, 2023
db2bb9f
Remove unused namespace alias
dagardner-nv Jan 30, 2023
e3ae25d
Merge branch 'branch-23.03' into david-constructors-604
dagardner-nv Jan 31, 2023
5111825
Merge branch 'branch-23.03' into david-constructors-604
dagardner-nv Feb 1, 2023
65872e7
Merge branch 'branch-23.03' into david-constructors-604
dagardner-nv Feb 7, 2023
75a9e4e
Merge branch 'branch-23.03' into david-constructors-604
dagardner-nv Feb 8, 2023
d428e16
Replace the tensor property with explicit get_tensors and set_tensors…
dagardner-nv Feb 8, 2023
98c02e9
Exclude tensors from the repr
dagardner-nv Feb 8, 2023
fc58151
Exclude tensors from generated eq and hash
dagardner-nv Feb 8, 2023
e12fb17
Actually return the attr :)
dagardner-nv Feb 8, 2023
90d1c3d
Merge branch 'branch-23.03' into david-constructors-604
dagardner-nv Feb 13, 2023
3749c45
Add & adopt get_tensor and set_tensor methods
dagardner-nv Feb 13, 2023
c4ba089
wip
dagardner-nv Feb 14, 2023
bce1ec3
wip
dagardner-nv Feb 14, 2023
24b62f8
Interface proxy classes for TensorMemory subclasses now inherit from …
dagardner-nv Feb 14, 2023
cfb6cb9
Make get_input, set_input, get_output & set_output methods actual cla…
dagardner-nv Feb 14, 2023
aac60f9
Add py::args to bindings
dagardner-nv Feb 14, 2023
6e12412
Merge branch 'branch-23.03' into david-constructors-604
dagardner-nv Feb 14, 2023
def8a98
Rempove debug print statements
dagardner-nv Feb 14, 2023
a6e63ee
Merge branch 'david-constructors-604' of github.com:dagardner-nv/Morp…
dagardner-nv Feb 14, 2023
1a784f9
Add util function for logging deprecated message classes, and unittes…
dagardner-nv Feb 14, 2023
1482be1
fix
dagardner-nv Feb 14, 2023
9c1f997
Deprecate ResponseMemory and MultiResponseProbsMessage, MultiResponse…
dagardner-nv Feb 14, 2023
13bcbf3
wip
dagardner-nv Feb 14, 2023
14a6b0c
WIP AddClass and AddScores now accept the output name as a constructo…
dagardner-nv Feb 15, 2023
76e55ae
WIP
dagardner-nv Feb 15, 2023
b8dd5b0
Replace MultiResponseProbsMessage from abp_nvsmi_detection example ou…
dagardner-nv Feb 15, 2023
a8904dc
Replace MultiResponseProbsMessage from nlp_si_detection example output
dagardner-nv Feb 15, 2023
59f9837
Replace MultiResponseProbsMessage from rca example output
dagardner-nv Feb 15, 2023
35275e7
WIP
dagardner-nv Feb 15, 2023
1543220
Merge branch 'branch-23.03' into david-deprecate-response-probs
dagardner-nv Feb 15, 2023
5f7cba3
Merge branch 'branch-23.03' into david-constructors-604
dagardner-nv Feb 15, 2023
08783ea
Merge branch 'branch-23.03' into david-deprecate-response-probs
dagardner-nv Feb 16, 2023
86ec93a
Merge branch 'branch-23.03' into david-constructors-604
dagardner-nv Feb 16, 2023
0bdeefb
Testing removing some pybind includes to see if IWYU flags it.
mdemoret-nv Feb 22, 2023
8766858
Merge branch 'branch-23.03' into david-deprecate-response-probs
dagardner-nv Feb 22, 2023
2591b70
Merge branch 'branch-23.03' into david-constructors-604
dagardner-nv Feb 22, 2023
c40b7e9
Merge branch 'branch-23.03' into david-deprecate-response-probs
dagardner-nv Feb 22, 2023
a90e4c5
Fix tensor_map_t got moved
dagardner-nv Feb 22, 2023
59c03cb
Fix bug where tensors was static
dagardner-nv Feb 24, 2023
2e993cd
Set default value for tensors to none
dagardner-nv Feb 24, 2023
c70d3bf
Remove out of date dataclass
dagardner-nv Feb 24, 2023
94bbe6b
Remove get_tensor_object
dagardner-nv Feb 24, 2023
e1c0823
Merge branch 'branch-23.03' into david-constructors-604
dagardner-nv Feb 24, 2023
b9eb78a
Fix missed merge conflict
dagardner-nv Feb 24, 2023
8380a83
Check tensor lengths match the count, use moves for tensor objects
dagardner-nv Feb 24, 2023
64265e0
Ensure tensor lengths match the count
dagardner-nv Feb 24, 2023
e96f8c2
Fix tests
dagardner-nv Feb 25, 2023
c68b0f7
Add type hints
dagardner-nv Feb 25, 2023
408f67b
Merge branch 'branch-23.03' into david-constructors-604
dagardner-nv Feb 28, 2023
56d46c4
Add type hint
dagardner-nv Feb 28, 2023
ddd4da7
Remove optional num_selected_rows arg, it wasn't needed
dagardner-nv Feb 28, 2023
14d8d47
Fix bad copy/paste docstring
dagardner-nv Feb 28, 2023
47efc93
Move tensor memory classes to their own modules
dagardner-nv Feb 28, 2023
8c91579
First pass at python MultiTensorMessage class
dagardner-nv Feb 28, 2023
2b773bb
wip
dagardner-nv Feb 28, 2023
b31b02f
wip
dagardner-nv Feb 28, 2023
d04685b
wip
dagardner-nv Feb 28, 2023
0e3dc97
wip
dagardner-nv Feb 28, 2023
6e0c263
Edge connectors
dagardner-nv Feb 28, 2023
eaaaeb0
bindings for MultiTensorMessage
dagardner-nv Feb 28, 2023
8333577
wip
dagardner-nv Feb 28, 2023
fc41741
cleanups
dagardner-nv Feb 28, 2023
0522823
cleanups
dagardner-nv Feb 28, 2023
8c748e7
Insert license
dagardner-nv Feb 28, 2023
5a3cebb
IWYU fixes
dagardner-nv Feb 28, 2023
3635018
Formatting
dagardner-nv Feb 28, 2023
d9a3ef6
Merge branch 'david-constructors-604' into david-deprecate-response-p…
dagardner-nv Mar 1, 2023
3c5ead2
Fix merge error
dagardner-nv Mar 1, 2023
2f8b011
Save the response output to a local variable to avoid fetching it ins…
dagardner-nv Mar 1, 2023
905ab46
Fix tests
dagardner-nv Mar 1, 2023
79f117f
IWYU
dagardner-nv Mar 1, 2023
0481361
Merge branch 'branch-23.03' into david-deprecate-response-probs [no ci]
dagardner-nv Mar 7, 2023
54e467c
Fix merge error [no ci]
dagardner-nv Mar 7, 2023
d7c3b74
Fix merge error [no ci]
dagardner-nv Mar 7, 2023
94fc8eb
Fix tests [no ci]
dagardner-nv Mar 7, 2023
915d35c
Merge branch 'branch-23.03' into david-deprecate-response-probs
dagardner-nv Mar 7, 2023
5ae09e8
Merge branch 'branch-23.03' into david-deprecate-response-probs
dagardner-nv Mar 8, 2023
9e46542
Merge branch 'branch-23.03' into david-deprecate-response-probs
mdemoret-nv Mar 17, 2023
24979b9
Merge branch 'branch-23.03' into david-deprecate-response-probs
mdemoret-nv Mar 17, 2023
a838d0b
Almost all tests are passing
mdemoret-nv Mar 20, 2023
2a47ed9
Merge branch 'branch-23.03' into david-deprecate-response-probs
mdemoret-nv Mar 20, 2023
5e01e65
Cleanup and documentation
mdemoret-nv Mar 20, 2023
7b7f895
Fixing typo
mdemoret-nv Mar 20, 2023
d11aaec
Fixing failing tests
mdemoret-nv Mar 20, 2023
e1bd57b
IWYU fixes
mdemoret-nv Mar 20, 2023
80dde3a
Creating a base C++ class for AddScores and AddClassification
mdemoret-nv Mar 20, 2023
b8c1a0d
Adding ignore for MRC warnings
mdemoret-nv Mar 21, 2023
775b583
Fixing broken tests by removing
mdemoret-nv Mar 21, 2023
b6fe24b
IWYU fixes
mdemoret-nv Mar 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/abp_nvsmi_detection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ Added stage: <deserialize-1; DeserializeStage()>
Added stage: <preprocess-fil-2; PreprocessFILStage()>
└─ morpheus.MultiMessage -> morpheus.MultiInferenceFILMessage
Added stage: <inference-3; TritonInferenceStage(model_name=abp-nvsmi-xgb, server_url=localhost:8000, force_convert_inputs=False, use_shared_memory=False)>
└─ morpheus.MultiInferenceFILMessage -> morpheus.MultiResponseProbsMessage
└─ morpheus.MultiInferenceFILMessage -> morpheus.MultiResponseMessage
Added stage: <monitor-4; MonitorStage(description=Inference Rate, smoothing=0.001, unit=inf, delayed_start=False, determine_count_fn=None)>
└─ morpheus.MultiResponseProbsMessage -> morpheus.MultiResponseProbsMessage
└─ morpheus.MultiResponseMessage -> morpheus.MultiResponseMessage
Added stage: <add-class-5; AddClassificationsStage(threshold=0.5, labels=[], prefix=)>
└─ morpheus.MultiResponseProbsMessage -> morpheus.MultiResponseProbsMessage
└─ morpheus.MultiResponseMessage -> morpheus.MultiResponseMessage
Added stage: <serialize-6; SerializeStage(include=['mining'], exclude=['^ID$', '^_ts_'], fixed_columns=True)>
└─ morpheus.MultiResponseProbsMessage -> morpheus.MessageMeta
└─ morpheus.MultiResponseMessage -> morpheus.MessageMeta
Added stage: <to-file-7; WriteToFileStage(filename=detections.jsonlines, overwrite=True, file_type=FileTypes.Auto)>
└─ morpheus.MessageMeta -> morpheus.MessageMeta
====Building Pipeline Complete!====
Expand Down
2 changes: 1 addition & 1 deletion examples/digital_fingerprinting/starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ The `PreprocessAEStage` is responsible for creating a Morpheus message that cont

**Postprocessing stage** - The DFP pipeline uses the `AddScoresStage` for postprocessing to add anomaly scores and zscores from previous inference stage with matching labels.

**Serialize stage** - `SerializeStage` is used to convert `MultiResponseProbsMessage` from previous stage to a `MessageMeta` to make it suitable for output (i.e. write to file or Kafka).
**Serialize stage** - `SerializeStage` is used to convert `MultiResponseMessage` from previous stage to a `MessageMeta` to make it suitable for output (i.e. write to file or Kafka).

**Write stage** - `WriteToFileStage` writes input data with inference results to an output file path.

Expand Down
8 changes: 4 additions & 4 deletions examples/nlp_si_detection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ Added stage: <deserialize-1; DeserializeStage()>
Added stage: <preprocess-nlp-2; PreprocessNLPStage(vocab_hash_file=/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/data/bert-base-uncased-hash.txt, truncation=True, do_lower_case=True, add_special_tokens=False, stride=-1)>
└─ morpheus.MultiMessage -> morpheus.MultiInferenceNLPMessage
Added stage: <inference-3; TritonInferenceStage(model_name=sid-minibert-onnx, server_url=localhost:8000, force_convert_inputs=True, use_shared_memory=False)>
└─ morpheus.MultiInferenceNLPMessage -> morpheus.MultiResponseProbsMessage
└─ morpheus.MultiInferenceNLPMessage -> morpheus.MultiResponseMessage
Added stage: <monitor-4; MonitorStage(description=Inference Rate, smoothing=0.001, unit=inf, delayed_start=False, determine_count_fn=None)>
└─ morpheus.MultiResponseProbsMessage -> morpheus.MultiResponseProbsMessage
└─ morpheus.MultiResponseMessage -> morpheus.MultiResponseMessage
Added stage: <add-class-5; AddClassificationsStage(threshold=0.5, labels=[], prefix=)>
└─ morpheus.MultiResponseProbsMessage -> morpheus.MultiResponseProbsMessage
└─ morpheus.MultiResponseMessage -> morpheus.MultiResponseMessage
Added stage: <serialize-6; SerializeStage(include=[], exclude=['^_ts_'], fixed_columns=True)>
└─ morpheus.MultiResponseProbsMessage -> morpheus.MessageMeta
└─ morpheus.MultiResponseMessage -> morpheus.MessageMeta
Added stage: <to-file-7; WriteToFileStage(filename=detections.jsonlines, overwrite=True, file_type=FileTypes.Auto)>
└─ morpheus.MessageMeta -> morpheus.MessageMeta
====Building Pipeline Complete!====
Expand Down
8 changes: 4 additions & 4 deletions examples/root_cause_analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ Added stage: <deserialize-1; DeserializeStage()>
Added stage: <preprocess-nlp-2; PreprocessNLPStage(vocab_hash_file=/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/data/bert-base-uncased-hash.txt, truncation=True, do_lower_case=True, add_special_tokens=False, stride=-1, column=log)>
└─ morpheus.MultiMessage -> morpheus.MultiInferenceNLPMessage
Added stage: <inference-3; TritonInferenceStage(model_name=root-cause-binary-onnx, server_url=localhost:8001, force_convert_inputs=True, use_shared_memory=False)>
└─ morpheus.MultiInferenceNLPMessage -> morpheus.MultiResponseProbsMessage
└─ morpheus.MultiInferenceNLPMessage -> morpheus.MultiResponseMessage
Added stage: <monitor-4; MonitorStage(description=Inference rate, smoothing=0.001, unit=inf, delayed_start=False, determine_count_fn=None)>
└─ morpheus.MultiResponseProbsMessage -> morpheus.MultiResponseProbsMessage
└─ morpheus.MultiResponseMessage -> morpheus.MultiResponseMessage
Added stage: <add-scores-5; AddScoresStage(labels=('is_root_cause',), prefix=)>
└─ morpheus.MultiResponseProbsMessage -> morpheus.MultiResponseProbsMessage
└─ morpheus.MultiResponseMessage -> morpheus.MultiResponseMessage
Added stage: <serialize-6; SerializeStage(include=(), exclude=('^ts_',), fixed_columns=True)>
└─ morpheus.MultiResponseProbsMessage -> morpheus.MessageMeta
└─ morpheus.MultiResponseMessage -> morpheus.MessageMeta
Added stage: <to-file-7; WriteToFileStage(filename=./root-cause-binary-output.jsonlines, overwrite=True, file_type=FileTypes.Auto, include_index_col=True)>
└─ morpheus.MessageMeta -> morpheus.MessageMeta
Inference rate[Complete]: 473 inf [00:01, 340.43 inf/s]
Expand Down
13 changes: 7 additions & 6 deletions morpheus/_lib/cmake/libraries/morpheus.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,29 @@ add_library(morpheus
# Keep these sorted!
${MORPHEUS_LIB_ROOT}/src/io/deserializers.cpp
${MORPHEUS_LIB_ROOT}/src/io/serializers.cpp
${MORPHEUS_LIB_ROOT}/src/messages/memory/inference_memory.cpp
${MORPHEUS_LIB_ROOT}/src/messages/memory/inference_memory_fil.cpp
${MORPHEUS_LIB_ROOT}/src/messages/memory/inference_memory_nlp.cpp
${MORPHEUS_LIB_ROOT}/src/messages/memory/response_memory.cpp
${MORPHEUS_LIB_ROOT}/src/messages/memory/inference_memory.cpp
${MORPHEUS_LIB_ROOT}/src/messages/memory/response_memory_probs.cpp
${MORPHEUS_LIB_ROOT}/src/messages/memory/response_memory.cpp
${MORPHEUS_LIB_ROOT}/src/messages/memory/tensor_memory.cpp
${MORPHEUS_LIB_ROOT}/src/messages/meta.cpp
${MORPHEUS_LIB_ROOT}/src/messages/multi.cpp
${MORPHEUS_LIB_ROOT}/src/messages/multi_inference.cpp
${MORPHEUS_LIB_ROOT}/src/messages/multi_inference_fil.cpp
${MORPHEUS_LIB_ROOT}/src/messages/multi_inference_nlp.cpp
${MORPHEUS_LIB_ROOT}/src/messages/multi_response.cpp
${MORPHEUS_LIB_ROOT}/src/messages/multi_inference.cpp
${MORPHEUS_LIB_ROOT}/src/messages/multi_response_probs.cpp
${MORPHEUS_LIB_ROOT}/src/messages/multi_response.cpp
${MORPHEUS_LIB_ROOT}/src/messages/multi_tensor.cpp
${MORPHEUS_LIB_ROOT}/src/messages/multi.cpp
${MORPHEUS_LIB_ROOT}/src/objects/fiber_queue.cpp
${MORPHEUS_LIB_ROOT}/src/objects/file_types.cpp
${MORPHEUS_LIB_ROOT}/src/objects/mutable_table_ctx_mgr.cpp
${MORPHEUS_LIB_ROOT}/src/objects/wrapped_tensor.cpp
${MORPHEUS_LIB_ROOT}/src/objects/python_data_table.cpp
${MORPHEUS_LIB_ROOT}/src/objects/rmm_tensor.cpp
${MORPHEUS_LIB_ROOT}/src/objects/tensor.cpp
${MORPHEUS_LIB_ROOT}/src/objects/wrapped_tensor.cpp
${MORPHEUS_LIB_ROOT}/src/stages/add_classification.cpp
${MORPHEUS_LIB_ROOT}/src/stages/add_scores_stage_base.cpp
${MORPHEUS_LIB_ROOT}/src/stages/add_scores.cpp
${MORPHEUS_LIB_ROOT}/src/stages/deserialize.cpp
${MORPHEUS_LIB_ROOT}/src/stages/file_source.cpp
Expand Down
37 changes: 27 additions & 10 deletions morpheus/_lib/include/morpheus/messages/memory/tensor_memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class TensorMemory
virtual ~TensorMemory() = default;

TensorIndex count{0};
TensorMap tensors;

/**
* @brief Verify whether the specified tensor name is present in the tensor memory
Expand All @@ -74,15 +73,6 @@ class TensorMemory
*/
bool has_tensor(const std::string& name) const;

/**
* @brief Copy tensor ranges
*
* @param ranges
* @param num_selected_rows
* @return TensorMap
*/
TensorMap copy_tensor_ranges(const std::vector<RangeType>& ranges, TensorIndex num_selected_rows) const;

/**
* @brief Get the tensor object identified by `name`
*
Expand Down Expand Up @@ -110,6 +100,13 @@ class TensorMemory
*/
void set_tensor(const std::string& name, TensorObject&& tensor);

/**
* @brief Get a reference to the internal tensors map
*
* @return const TensorMap&
*/
const TensorMap& get_tensors() const;

/**
* @brief Set the tensors object
*
Expand All @@ -118,6 +115,15 @@ class TensorMemory
*/
void set_tensors(TensorMap&& tensors);

/**
* @brief Copy tensor ranges
*
* @param ranges
* @param num_selected_rows
* @return TensorMap
*/
TensorMap copy_tensor_ranges(const std::vector<RangeType>& ranges, TensorIndex num_selected_rows) const;

protected:
/**
* @brief Checks if the number of rows in `tensor` matches `count`
Expand All @@ -142,6 +148,9 @@ class TensorMemory
* @throws std::runtime_error If no tensor matching `name` exists
*/
void verify_tensor_exists(const std::string& name) const;

private:
TensorMap m_tensors;
};

/****** TensorMemoryInterfaceProxy *************************/
Expand All @@ -168,6 +177,14 @@ struct TensorMemoryInterfaceProxy
*/
static TensorIndex get_count(TensorMemory& self);

/**
* @brief Returns a list of the current tensor names
*
* @param self
* @return std::vector<std::string>
*/
static std::vector<std::string> tensor_names_getter(TensorMemory& self);

/**
* @brief Returns true if a tensor with the requested name exists in the tensors object
*
Expand Down
20 changes: 12 additions & 8 deletions morpheus/_lib/include/morpheus/messages/multi_inference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#pragma once

#include "morpheus/messages/memory/inference_memory.hpp"
#include "morpheus/messages/memory/tensor_memory.hpp"
#include "morpheus/messages/meta.hpp"
#include "morpheus/messages/multi.hpp"
#include "morpheus/messages/multi_tensor.hpp"
Expand Down Expand Up @@ -60,13 +60,15 @@ class MultiInferenceMessage : public DerivedMultiMessage<MultiInferenceMessage,
* @param memory Holds the generic tensor data in cupy arrays that will be used for inference stages
* @param offset Message offset in inference memory instance
* @param count Message count in inference memory instance
* @param id_tensor_name Name of the tensor that correlates tensor rows to message IDs
*/
MultiInferenceMessage(std::shared_ptr<MessageMeta> meta,
TensorIndex mess_offset = 0,
TensorIndex mess_count = -1,
std::shared_ptr<InferenceMemory> memory = nullptr,
TensorIndex offset = 0,
TensorIndex count = -1);
TensorIndex mess_offset = 0,
TensorIndex mess_count = -1,
std::shared_ptr<TensorMemory> memory = nullptr,
TensorIndex offset = 0,
TensorIndex count = -1,
std::string id_tensor_name = "seq_ids");

/**
* @brief Returns the input tensor for the given `name`.
Expand Down Expand Up @@ -108,14 +110,16 @@ struct MultiInferenceMessageInterfaceProxy : public MultiTensorMessageInterfaceP
* @param memory Holds the generic tensor data in cupy arrays that will be used for inference stages
* @param offset Message offset in inference memory instance
* @param count Message count in inference memory instance
* @param id_tensor_name Name of the tensor that correlates tensor rows to message IDs
* @return std::shared_ptr<MultiInferenceMessage>
*/
static std::shared_ptr<MultiInferenceMessage> init(std::shared_ptr<MessageMeta> meta,
TensorIndex mess_offset,
TensorIndex mess_count,
std::shared_ptr<InferenceMemory> memory,
std::shared_ptr<TensorMemory> memory,
TensorIndex offset,
TensorIndex count);
TensorIndex count,
std::string id_tensor_name);
};
#pragma GCC visibility pop
/** @} */ // end of group
Expand Down
23 changes: 14 additions & 9 deletions morpheus/_lib/include/morpheus/messages/multi_inference_fil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

#pragma once

#include "morpheus/messages/memory/inference_memory.hpp" // for InferenceMemory
#include "morpheus/messages/meta.hpp" // for MessageMeta
#include "morpheus/messages/memory/tensor_memory.hpp"
#include "morpheus/messages/meta.hpp" // for MessageMeta
#include "morpheus/messages/multi.hpp"
#include "morpheus/messages/multi_inference.hpp"
#include "morpheus/objects/tensor_object.hpp"
Expand All @@ -27,6 +27,7 @@
#include <pybind11/pytypes.h> // for object

#include <memory>
#include <string>

namespace morpheus {
/****** Component public implementations *******************/
Expand Down Expand Up @@ -57,13 +58,15 @@ class MultiInferenceFILMessage : public DerivedMultiMessage<MultiInferenceFILMes
* @param memory Holds the generic tensor data in cupy arrays that will be used for inference stages
* @param offset Message offset in inference memory object
* @param count Message count in inference memory object
* @param id_tensor_name Name of the tensor that correlates tensor rows to message IDs
*/
MultiInferenceFILMessage(std::shared_ptr<MessageMeta> meta,
TensorIndex mess_offset = 0,
TensorIndex mess_count = -1,
std::shared_ptr<morpheus::InferenceMemory> memory = nullptr,
TensorIndex offset = 0,
TensorIndex count = -1);
TensorIndex mess_offset = 0,
TensorIndex mess_count = -1,
std::shared_ptr<TensorMemory> memory = nullptr,
TensorIndex offset = 0,
TensorIndex count = -1,
std::string id_tensor_name = "seq_ids");

/**
* @brief Returns the 'input__0' tensor, throws a `std::runtime_error` if it does not exist
Expand Down Expand Up @@ -114,14 +117,16 @@ struct MultiInferenceFILMessageInterfaceProxy : public MultiInferenceMessageInte
* @param memory Holds the generic tensor data in cupy arrays that will be used for inference stages
* @param offset Message offset in inference memory object
* @param count Message count in inference memory object
* @param id_tensor_name Name of the tensor that correlates tensor rows to message IDs
* @return std::shared_ptr<MultiInferenceFILMessage>
*/
static std::shared_ptr<MultiInferenceFILMessage> init(std::shared_ptr<MessageMeta> meta,
TensorIndex mess_offset,
TensorIndex mess_count,
std::shared_ptr<InferenceMemory> memory,
std::shared_ptr<TensorMemory> memory,
TensorIndex offset,
TensorIndex count);
TensorIndex count,
std::string id_tensor_name);

/**
* @brief Get 'input__0' tensor as a python object
Expand Down
23 changes: 14 additions & 9 deletions morpheus/_lib/include/morpheus/messages/multi_inference_nlp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

#pragma once

#include "morpheus/messages/memory/inference_memory.hpp" // for InferenceMemory
#include "morpheus/messages/meta.hpp" // for MessageMeta
#include "morpheus/messages/memory/tensor_memory.hpp"
#include "morpheus/messages/meta.hpp" // for MessageMeta
#include "morpheus/messages/multi.hpp"
#include "morpheus/messages/multi_inference.hpp"
#include "morpheus/objects/tensor_object.hpp"
Expand All @@ -27,6 +27,7 @@
#include <pybind11/pytypes.h> // for object

#include <memory>
#include <string>

namespace morpheus {
/****** Component public implementations *******************/
Expand Down Expand Up @@ -57,13 +58,15 @@ class MultiInferenceNLPMessage : public DerivedMultiMessage<MultiInferenceNLPMes
* @param memory Holds the generic tensor data in cupy arrays that will be used for inference stages
* @param offset Message offset in inference memory object
* @param count Message count in inference memory object
* @param id_tensor_name Name of the tensor that correlates tensor rows to message IDs
*/
MultiInferenceNLPMessage(std::shared_ptr<MessageMeta> meta,
TensorIndex mess_offset = 0,
TensorIndex mess_count = -1,
std::shared_ptr<InferenceMemory> memory = nullptr,
TensorIndex offset = 0,
TensorIndex count = -1);
TensorIndex mess_offset = 0,
TensorIndex mess_count = -1,
std::shared_ptr<TensorMemory> memory = nullptr,
TensorIndex offset = 0,
TensorIndex count = -1,
std::string id_tensor_name = "seq_ids");

/**
* @brief Returns the 'input_ids' tensor, throws a `std::runtime_error` if it does not exist.
Expand Down Expand Up @@ -130,14 +133,16 @@ struct MultiInferenceNLPMessageInterfaceProxy : public MultiInferenceMessageInte
* @param memory Holds the generic tensor data in cupy arrays that will be used for inference stages
* @param offset Message offset in inference memory object
* @param count Message count in inference memory object
* @param id_tensor_name Name of the tensor that correlates tensor rows to message IDs
* @return std::shared_ptr<MultiInferenceNLPMessage>
*/
static std::shared_ptr<MultiInferenceNLPMessage> init(std::shared_ptr<MessageMeta> meta,
TensorIndex mess_offset,
TensorIndex mess_count,
std::shared_ptr<InferenceMemory> memory,
std::shared_ptr<TensorMemory> memory,
TensorIndex offset,
TensorIndex count);
TensorIndex count,
std::string id_tensor_name);

/**
* @brief Get 'input_ids' tensor as a python object
Expand Down
Loading