Skip to content

Fix pipeline traversal when mapping a model to structure paths - #2800

Open
LeSingh1 wants to merge 1 commit into
apple:mainfrom
LeSingh1:pipeline-structure-path
Open

Fix pipeline traversal when mapping a model to structure paths#2800
LeSingh1 wants to merge 1 commit into
apple:mainfrom
LeSingh1:pipeline-structure-path

Conversation

@LeSingh1

@LeSingh1 LeSingh1 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

MLModelBenchmarker.benchmark_operation_execution() raises AttributeError: names for any pipeline model, because map_model_spec_to_path's pipeline branch:

  • reads model_spec.names.model_spec.models instead of model_spec.pipeline.names / .models
  • calls zip() with one iterable, then unpacks two values
  • passes model_structure= to itself, which only takes model_spec=
  • returns inside the loop, so only the first sub-model would be visited

map_model_structure_to_path has the last problem too, and also appends to its shared default components argument.

Fixing only those still reports nothing, because the paths from the two functions have to be equal to be joined. The spec leaves pipeline.names unset (ct.utils.make_pipeline does not populate it) while the framework names sub-models by position, so the spec side now uses the same model<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; on main both raise.

Added a parametrized test covering both.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant