HyperFrustration HyperdriveStep: widget doesn't help debug at all
I've wasted 3 days unnecessarily debugging, because I've come to rely so much on the widget for monitoring progress. Besides me identifying the problem, I'm also sharing the process by which I uncovered and solved my own problem. I really appreciate the AML team, but I believe there has to be a better user experience for this (and other things). This is my 3rd three-day bang-head-against-keyboard until it works experience with the SDK in as many months. I also spent a good chunk of time writing this up
TL;DR.
- a PipelineRun that includes a Hyperdrive step will create a HyperdriveStep run which creates a Hyperdrive Run which then creates Estimator runs as children.
- The above makes finding the logs for debugging HyperdriveStep very tricky and it isn't written down anywhere. the Hyperdrive pipeline notebook creates a pipeline with literally one step
- The UX was unhelpful in the following ways:
- the Jupyter widget provides the PipelineStepRun object instead of the actual HyperdriveRun that PipelineStepRun creates.
- The portal Experiment view for default columns obfuscates what is actually happening.
- Maybe there's a need for debugging strategy guide? (e.g. look in
80_driver_log.txtof the HyperdriveStep's HyperdriveRun's child runs) All the notebooks are all straightforward, how about diagnosis techniques to really uncover what is going on when the code isn't working?
My full UX
I was trying to port to HyperdriveStep using my HyperdriveRun code. All the other steps of the pipeline would run without issue, but then the PipelineRun would cancel.

Then I click on the Hyperdrive step itself to find out more and see this"

Huh, that's not helpful at all, I was expecting like the Widget when you send a Hyperdrive run

so I click on the link to see the run in the Azure portal to go check out the logs.

Wow, more unhelpful still. At this point I consider it to be a bug in the service, and proceed to spend 2 full workdays days tinkering to try and get the HyperdriveStep to run, to no avail.
Finally I go to the portal and start digging around and see that each time I submit a PipelineRun, two parent runs are created. Then I decide to:
- customize the columns
- remove the default filter that excludes child runs
to see this:

NOW we're getting somewhere. I click on a child run of the HyperdriveRun created by the PipelineRun and finally there is a 80_driver_log.txt I can look at to get valuable information.
all args: Namespace(backfill=True, boosting_type='dart', colsample_bytree=0.5, drop_rate=0.1, is_unbalance=True, iter='test', learning_rate=0.09, max_bin=145, min_child_samples=100, n_estimators=500, num_leaves=9, objective='binary', subsample=0.5, tag='friday')
model args: {'boosting_type': 'dart', 'is_unbalance': True, 'drop_rate': 0.1, 'objective': 'binary', 'learning_rate': 0.09, 'n_estimators': 500, 'num_leaves': 9, 'min_child_samples': 100, 'colsample_bytree': 0.5, 'subsample': 0.5, 'max_bin': 145}
cwd: /mnt/batch/tasks/shared/LS_root/jobs/avadevitsmlsvc/azureml/attrition_pipe_anders_1553893016886_3/mounts/azureml_project_share/azureml/attrition_pipe_anders_1553893016886_3
dir of cwd ['.amlignore', 'aml_config', 'anono.ipynb', 'assets', 'azureml-logs', 'azureml-setup', 'batch_scoring.py', 'get_data.py', 'join.py', 'munge.bat', 'munge_absence.py', 'munge_headcount.py', 'munge_leaver.py', 'munge_productivity.py', 'munge_promo.py', 'munge_roster.py', 'munge_time.py', 'munge_travel.py', 'optimize_roll.ipynb', 'optimize_roll_mon.ipynb', 'outputs', 'test.json', 'train.py', 'train_test.py', 'train_test2.py', 'Untitled4.ipynb', 'visualize.py', '__init__.py', '__pycache__']
The experiment failed. Finalizing run...
Logging experiment finalizing status in history service
Cleaning up all outstanding Run operations, waiting 300.0 seconds
1 items cleaning up...
Cleanup took 0.10079526901245117 seconds
Traceback (most recent call last):
File "azureml-setup/context_manager_injector.py", line 161, in <module>
execute_with_context(cm_objects, options.invocation)
File "azureml-setup/context_manager_injector.py", line 90, in execute_with_context
runpy.run_path(sys.argv[0], globals(), run_name="__main__")
File "/azureml-envs/azureml_2e164768cafa8a117d6ceb2f5ad291b7/lib/python3.6/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/azureml-envs/azureml_2e164768cafa8a117d6ceb2f5ad291b7/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/azureml-envs/azureml_2e164768cafa8a117d6ceb2f5ad291b7/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "train.py", line 116, in <module>
data = joblib.load('data.pkl')
File "/azureml-envs/azureml_2e164768cafa8a117d6ceb2f5ad291b7/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 590, in load
with open(filename, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'data.pkl'
Sorry that your experience was not the best. As I mentioned in the other thread, we have some work planned in near future to improve the experience of running Hyperdrive jobs in pipelines, including the ability to see hyperdrive run (correct one!) in widget, getting best run as output etc.