question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Evaluator behavior when no thresholds configured

See original GitHub issue

System information

  • Have I specified the code to reproduce the issue (Yes, No): No
  • Environment in which the code is executed: Kubeflow
  • TensorFlow version: 2.5
  • TFX Version: 1.2.1
  • Python version: 3.7

Describe the current behavior

When running evaluator with an eval config that does not include any thresholds, the entire code path of producing a model blessing is skipped. The model is seemingly neither blessed nor not blessed. Nothing is written to the URI pointed to by the model blessing artifact.

Describe the expected behavior

In the case that there are no thresholds configured, I believe the model has vacuously satisfied the 0 thresholds and should be blessed. Even if we disagree on the default behavior:

  1. this should be documented in evaluator.md (there is no documentation anywhere in TF* that specifies the behavior of the blessing w/r/t different possibilities for thresholds)
  2. the model blessing artifact should be created with either true or false value

Standalone code to reproduce the issue

running evaluator with this eval_config leads to no blessing. adding in a threshold for the examplecount metric leads to the blessing being computed

tfma.EvalConfig(
      model_specs=[
        tfma.ModelSpec(
          signature_name="serving_default",
          label_key="label",
        )
      ],
      metrics_specs=[
        tfma.MetricsSpec(
          metrics=[
            tfma.MetricConfig(
              class_name="ExampleCount",
          ]
        )
      ],
      slicing_specs=[
        tfma.SlicingSpec(),
      ],

Name of your Organization (Optional) Twitter

Other info / logs

The only indication that this is happening is the one line below: “no threshold configured, will not validate model”

INFO:absl:Evaluation complete. Results written to PATH/TO/ARTIFACT.
INFO:absl:No threshold configured, will not validate model.
INFO:absl:Cleaning up stateless execution info.
INFO:absl:Execution 203969 succeeded.
INFO:absl:Cleaning up stateful execution info.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jiyongjung0commented, Aug 17, 2022

Thank you for the report! This seems like a intended implementation https://github.com/tensorflow/tfx/blob/49c24a6cd61054ea3e63ee7decb60099f5580739/tfx/components/evaluator/executor.py#L154-L158 But I agree with you that more documentation about the behavior would be better.

It is also unfortunate that tfx doesn’t support “optional” output, so there is no way NOT to produce the blessing output for now.

@mdreves Hi, Mike. Do you have anything to add about the behavior?

0reactions
genehwungcommented, Sep 9, 2022

Regardless of how it is conceived, the evaluator already does have the role as “pure evaluator” plus model validator because it produces the blessing. So my question still stands about whether a model that has been “purely evaluated” is blessed or not blessed.

There might be some information misleading, the evaluator have the role as evaluator, only optionally the role of model validator, not plus. Ideally, there shouldn’t be any blessing artifact when used as a pure evaluator, that might be a bug or feature request for TFX.

Another angle to look at this is: whether to bless or unbless a model without threshold is ambiguous. Blessing by default might be desired, but can be dangerous since a user might forget to set any threshold and a bad model is pushed by accident. Unblessing is safer, but it leads to a no-op, since the model won’t be pushed anyway. And again, this makes the multi-evaluators + model validators blessing reasoning unnecessarily complicated as mentioned in the previous reply.

I am curious how, in your case, the evaluators blessing result is used, or why it is causing issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Evaluator behavior when no thresholds configured issue ...
When running evaluator with an eval config that does not include any thresholds, the entire code path of producing a model blessing is...
Read more >
threshold-monitoring-and-threshold-limiter-behavior - TechDocs
Threshold evaluations will not resume, even if you restart the Data Aggregator. ... Threshold evaluation operations are longer than the configured maximum ...
Read more >
Threshold - IBM
Static thresholding is user-defined static values at specific intervals, which analyze data and generate events when a violation occurs for anomaly detection.
Read more >
S-PMSI trigger thresholds
If BW threshold no longer applies or the receiver PEs exceed receiver PE delete threshold, the S-PMSI is torn down and (C-S, C-G)...
Read more >
Configure Monitors - Datadog Docs
min, If all points in the evaluation window for your query cross the threshold, then an alert is triggered. It adds the min()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found