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

Update TimeSeries stage to also work with Production DFP #1121

Merged
merged 17 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
remove timeseries from cli
  • Loading branch information
efajardo-nv committed Aug 9, 2023
commit 15078fbe025a9c0eb3d074a2e46353cdd69b83e3
1 change: 0 additions & 1 deletion morpheus/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,6 @@ def post_pipeline(ctx: click.Context, *args, **kwargs):
add_command("preprocess", "morpheus.stages.preprocess.preprocess_fil_stage.PreprocessFILStage", modes=FIL_ONLY)
add_command("preprocess", "morpheus.stages.preprocess.preprocess_nlp_stage.PreprocessNLPStage", modes=NLP_ONLY)
add_command("serialize", "morpheus.stages.postprocess.serialize_stage.SerializeStage", modes=ALL)
add_command("timeseries", "morpheus.stages.postprocess.timeseries_stage.TimeSeriesStage", modes=AE_ONLY)
add_command("to-file", "morpheus.stages.output.write_to_file_stage.WriteToFileStage", modes=ALL)
add_command("to-kafka", "morpheus.stages.output.write_to_kafka_stage.WriteToKafkaStage", modes=ALL)
add_command("train-ae", "morpheus.stages.preprocess.train_ae_stage.TrainAEStage", modes=AE_ONLY)
Expand Down
1 change: 0 additions & 1 deletion morpheus/stages/postprocess/timeseries_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ def _calc_timeseries(self, x: MultiResponseMessage, is_complete: bool):
return output_messages


@register_stage("timeseries", modes=[PipelineModes.AE])
class TimeSeriesStage(SinglePortStage):
"""
Perform time series anomaly detection and add prediction.
Expand Down
30 changes: 4 additions & 26 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
from morpheus.stages.postprocess.filter_detections_stage import FilterDetectionsStage
from morpheus.stages.postprocess.ml_flow_drift_stage import MLFlowDriftStage
from morpheus.stages.postprocess.serialize_stage import SerializeStage
from morpheus.stages.postprocess.timeseries_stage import TimeSeriesStage
from morpheus.stages.postprocess.validation_stage import ValidationStage
from morpheus.stages.preprocess.deserialize_stage import DeserializeStage
from morpheus.stages.preprocess.drop_null_stage import DropNullStage
Expand Down Expand Up @@ -175,11 +174,7 @@ def test_pipeline_ae(self, config, callback_values):
'47',
'preprocess',
'inf-pytorch',
'add-scores',
'timeseries',
'--resolution=1m',
'--zscore_threshold=8.0',
'--hot_start'
'add-scores'
] + MONITOR_ARGS + VALIDATE_ARGS + ['serialize'] + TO_FILE_ARGS)

obj = {}
Expand Down Expand Up @@ -209,8 +204,7 @@ def test_pipeline_ae(self, config, callback_values):

stages = callback_values['stages']
# Verify the stages are as we expect them, if there is a size-mismatch python will raise a Value error
[cloud_trail, train_ae, process_ae, auto_enc, add_scores, time_series, monitor, validation, serialize,
to_file] = stages
[cloud_trail, train_ae, process_ae, auto_enc, add_scores, monitor, validation, serialize, to_file] = stages

assert isinstance(cloud_trail, CloudTrailSourceStage)
assert cloud_trail._watcher._input_glob == "input_glob*.csv"
Expand All @@ -223,11 +217,6 @@ def test_pipeline_ae(self, config, callback_values):
assert isinstance(auto_enc, AutoEncoderInferenceStage)
assert isinstance(add_scores, AddScoresStage)

assert isinstance(time_series, TimeSeriesStage)
assert time_series._resolution == '1m'
assert time_series._zscore_threshold == 8.0
assert time_series._hot_start

assert isinstance(monitor, MonitorStage)
assert monitor._mc._description == 'Unittest'
assert monitor._mc._smoothing == 0.001
Expand Down Expand Up @@ -269,8 +258,7 @@ def test_pipeline_ae_all(self, callback_values):
'preprocess',
'inf-pytorch',
'add-scores'
] + INF_TRITON_ARGS + ['timeseries', '--resolution=1m', '--zscore_threshold=8.0', '--hot_start'] +
MONITOR_ARGS + VALIDATE_ARGS + ['serialize'] + TO_FILE_ARGS + TO_KAFKA_ARGS)
] + INF_TRITON_ARGS + MONITOR_ARGS + VALIDATE_ARGS + ['serialize'] + TO_FILE_ARGS + TO_KAFKA_ARGS)

runner = CliRunner()
result = runner.invoke(commands.cli, args)
Expand All @@ -289,7 +277,6 @@ def test_pipeline_ae_all(self, callback_values):
auto_enc,
add_scores,
triton_inf,
time_series,
monitor,
validation,
serialize,
Expand Down Expand Up @@ -317,11 +304,6 @@ def test_pipeline_ae_all(self, callback_values):
assert triton_inf._kwargs['server_url'] == 'test:123'
assert triton_inf._kwargs['force_convert_inputs']

assert isinstance(time_series, TimeSeriesStage)
assert time_series._resolution == '1m'
assert time_series._zscore_threshold == 8.0
assert time_series._hot_start

assert isinstance(monitor, MonitorStage)
assert monitor._mc._description == 'Unittest'
assert monitor._mc._smoothing == 0.001
Expand Down Expand Up @@ -1059,11 +1041,7 @@ def test_pipeline_ae_relative_path_precedence(self, config: Config, tmp_path: st
'47',
'preprocess',
'inf-pytorch',
'add-scores',
'timeseries',
'--resolution=1m',
'--zscore_threshold=8.0',
'--hot_start'
'add-scores'
] + MONITOR_ARGS + VALIDATE_ARGS + ['serialize'] + TO_FILE_ARGS)

obj = {}
Expand Down