[PNE-7018] Add new evaluations API and deprecate PEWs.#997
Conversation
19220c1 to
d074bba
Compare
|
|
||
| class PredictorEvaluationExecution(Resource['PredictorEvaluationExecution'], Execution): | ||
| """The execution of a PredictorEvaluationWorkflow. | ||
| """[DEPRECATED] The execution of a PredictorEvaluationWorkflow. |
There was a problem hiding this comment.
Since the PredictorEvaluationExecutionCollection is already going to emit a deprecation warning on any operation, and it's the only way a PredictorEvaluationExecution is created, it feels like overkill to decorate this class with @deprecated as well. Hence the docstring update without the decorator.
| class PredictorEvaluationWorkflow(Resource['PredictorEvaluationWorkflow'], | ||
| Workflow, AIResourceMetadata): | ||
| """A workflow that evaluations a predictor. | ||
| """[DEPRECATED] A workflow that evaluates a predictor. |
There was a problem hiding this comment.
See PredictorEvaluationExecution.
|
|
||
| def list_all(self, *, per_page: int = 20) -> Iterable[DesignSpace]: | ||
| """List the most recent version of all design spaces.""" | ||
| """List all design spaces.""" |
There was a problem hiding this comment.
Just fixing some unclear wording that slipped by for a while.
| predictor_id=predictor_id, | ||
| predictor_version=predictor_version) | ||
|
|
||
| def list(self, |
There was a problem hiding this comment.
Our pattern has generally been that list returns all non-archived assets, and we use more specific names for other filters.
| def default(self, | ||
| *, | ||
| predictor_id: Union[UUID, str], | ||
| predictor_version: Union[int, str] = LATEST_PRED_VER |
There was a problem hiding this comment.
The predictor version defaults to latest for consistency with trigger, which requires a trained predictor.
PEWs no longer need to be a customer facing asset type. Their only function is to allow reusing the same set of evaluators with different predictors, which A) doesn't often work due to mismatched responses, and B) isn't particularly helpful. As such, we can move users on to a cleaner, easier to use workflow, where predictor evaluation is kicked off directly against predictor, and you can start one using the default evaluators with a single call. The PredictorEvaluation API and associated objects are similar to the existing PEW and PEW execution APIs/objects, but are stand-alone. This ensures we can easily make a clean break when the deprecation cycle completes, and also provides an opportunity to ensure the interfaces are as clean and simple as possible.
Attach a deprecation warning to the PEW and PEW Execution collections and their associated operations. The associated response objects (PredictorEvaluationWorkflow and PredictorEvaluationExecution) are also deprecated, but as they're only produced by the collections, their docstring notes their deprecation rather than an emitted message, to avoid inundating the user.
d074bba to
70dde8f
Compare
There was a problem hiding this comment.
I debated whether to change this filename to predictor_evaluations.rst, but left it for now to avoid any broken links coming into it.
kroenlein
left a comment
There was a problem hiding this comment.
Confused about one thing, but nothing blocking here. Good work.
| evaluation_id=str(self.uid) | ||
| ) | ||
|
|
||
| @lru_cache() |
There was a problem hiding this comment.
Was this exceptionally slow or called a large number of times? Seems like maybe an unnecessary optimization.
There was a problem hiding this comment.
Fair question, but I'm not sure. This is just copied from the PredictorEvaluationExecution class, so I decided to keep it as is.
jspeerless
left a comment
There was a problem hiding this comment.
All in all looks great! Added a couple points about documentation, but one issue has been around for a while.
| Workflows employ reusable modules in order to execute. | ||
| There are three different types of modules, and these are discussed in greater detail below. | ||
| Currently, there are two workflows on the AI Engine: the :doc:`DesignWorkflow <design_workflows>` and the :doc:`PredictorEvaluation <predictor_evaluation_workflows>`. | ||
| There are two different types of modules, and these are discussed in greater detail below. |
There was a problem hiding this comment.
We might want to re-think this page at a later date - introducing the idea of workflows seems odd given that there really is only 1. But, given this is the deprecation PR and we still have PEW collateral in the "workflows" directory under informatics, I think we should take a look at re-factoring this part of the documentation for v4.0
| result = self.session.post_resource(path, json=payload, version=self._api_version) | ||
| return PredictorEvaluatorsResponse.build(result).evaluators | ||
|
|
||
| def default(self, |
There was a problem hiding this comment.
Do we have any more documentation on this method elsewhere? I think we have methods for inferring the ignore_when_grouping field from the model config that are not 100% clear to me. For example, we implemented this change where we populate Latent Variables automatically.
There was a problem hiding this comment.
To be clear, if we can confirm the behavior, we should document it here since users don't have access to our internal documentation.
There was a problem hiding this comment.
Not that I'm aware of. It sounds like something we should pull together for the 4.0 release, though. Especially since ignore_when_grouping gets so many questions.
PEWs no longer need to be a customer facing asset type. Their only function is to allow reusing the same set of evaluators with different predictors, which A) doesn't often work due to mismatched responses, and B) isn't particularly helpful. As such, we can move users on to a cleaner, easier to use workflow, where predictor evaluation is kicked off directly against predictor, and you can start one using the default evaluators with a single call.
The PredictorEvaluation API and associated objects are similar to the existing PEW and PEW execution APIs/objects, but are stand-alone. This ensures we can easily make a clean break when the deprecation cycle completes, and also provides an opportunity to ensure the interfaces are as clean and simple as possible.
This also attaches a deprecation warning to the PEW and PEW Execution collections and their associated operations. The associated response objects (
PredictorEvaluationWorkflowandPredictorEvaluationExecution) are also deprecated, but as they're only produced by the collections, their docstring notes their deprecation rather than an emitted message, to avoid inundating the user.PR Type:
Adherence to team decisions