Fix pipeline traversal when mapping a model to structure paths - #2800
Open
LeSingh1 wants to merge 1 commit into
Open
Fix pipeline traversal when mapping a model to structure paths#2800LeSingh1 wants to merge 1 commit into
LeSingh1 wants to merge 1 commit into
Conversation
map_model_spec_to_path read the sub-models off the wrong field, zipped a single iterable, passed an unknown keyword to itself and returned inside the loop, so it raised AttributeError for any pipeline model. The sub-model names are also optional in the spec, where the framework falls back to naming them by position, so the paths have to use the same fallback to line up with the ones built from the loaded model structure. map_model_structure_to_path returned inside its loop too, and appended to the shared default argument.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
MLModelBenchmarker.benchmark_operation_execution()raisesAttributeError: namesfor any pipeline model, becausemap_model_spec_to_path's pipeline branch:model_spec.names.model_spec.modelsinstead ofmodel_spec.pipeline.names/.modelszip()with one iterable, then unpacks two valuesmodel_structure=to itself, which only takesmodel_spec=map_model_structure_to_pathhas the last problem too, and also appends to its shared defaultcomponentsargument.Fixing only those still reports nothing, because the paths from the two functions have to be equal to be joined. The spec leaves
pipeline.namesunset (ct.utils.make_pipelinedoes not populate it) while the framework names sub-models by position, so the spec side now uses the samemodel<i>fallback. Verified both spellings against a compute plan retrieved from a real pipeline: with names unset and with names set, all 11 operations across both sub-models are now reported; onmainboth raise.Added a parametrized test covering both.