[sdk] Set experiment in model_version run #532
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR clean up the example notebook and fixes the local pyfunc and remote pyfunc clashes
Running the local pyfunc and then deploying to remote MLP raises exception in Merlin sdk
This happen due to the local pyfunc setting an mlflow experiment
And the current sdk assume there is no active experiments prior to running
merlin.new_model_version().start()
and mlflow will use thedefault experiment
. However after running the local pyfunc, the experiment is set which leads to this exception from the mlflow clientAs
_active_experiment_id is not None and _active_experiment_id != active_run_obj.info.experiment_id
Since the mlflow experiment and run is created remotely during
new_model_version()
, the experiment can be set and match.Modifications
Add
set_experiment
to already created experiment and run beforeset_model
insdk/merlin/model.py
Remove duplicated blocks in the note book and add a section to
mlflow.end_run()
before running remoteTests
Tested with the sample notebook
Checklist
Release Notes