def run(self, model: OliveModelHandler, output_model_path: str) -> OliveModelHandler:
        """Run the pass on the model at a specific point in the search space."""
        from olive.model import CompositeModelHandler, DistributedOnnxModelHandler

        if not self._initialized:
            self._initialize()
            self._initialized = True

        # Optimization pass still works on individual graphs.
        if isinstance(model, DistributedOnnxModelHandler):
            for rank in range(model.num_ranks):
                input_ranked_model = model.load_model(rank)
                ranked_output_path = Path(output_model_path).with_suffix("") / model.ranked_model_name(rank)
                self._run_for_config(input_ranked_model, self.config, str(ranked_output_path))

            # ranked model don't have their own model_attributes, they are just part of the distributed model
            # which has the model_attributes
            output_model = DistributedOnnxModelHandler(
                model_path=str(Path(output_model_path).with_suffix("")),
                model_name_pattern=model.model_name_pattern,
                num_ranks=model.num_ranks,
                inference_settings=model.inference_settings,
                model_attributes=model.model_attributes,
            )
        elif isinstance(model, CompositeModelHandler) and not self._accepts_composite_model:
            components = []
            component_names = []
            # all components will be saved in the same parent directory
            model_dir = Path(output_model_path).with_suffix("")
            model_dir.mkdir(parents=True, exist_ok=True)
            for component_name, component_model in model.get_model_components():
                component_output_path = model_dir / component_name
                output_model_component = self.run(component_model, str(component_output_path))
                components.append(output_model_component)
                component_names.append(component_name)
            output_model = CompositeModelHandler(components, component_names, model_path=model_dir)
        else:
            output_model = self._run_for_config(model, self.config, output_model_path)

        # assumption: the model attributes from passes, if any, are more important than
        # the input model attributes, we should not update/extend anymore outside of the pass run
        output_model.model_attributes = output_model.model_attributes or model.model_attributes
        # save and carry forward additional files into the the output model path
        Pass._carry_forward_additional_files(model, output_model)
        return output_model
Run the pass on the model at a specific point in the search space.
olive/passes/olive_pass.py