Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML][Pipelines] feat: support data binding expression inside entity runsettings #29559

Conversation

elliotzh
Copy link
Contributor

@elliotzh elliotzh commented Mar 24, 2023

Description

For now, data binding expression got some issues inside a run setting entity:

@dsl.pipeline
def my_pipeline(instance_count):
    node = component_func(component_in_number=1)
    # node.resource is a ResourceConfiguration object instead of a primitive value
    node.resources.instance_count = instance_count

Full list of similar runsettings:

  • Command
    • resources
    • queue_setting - do not support for now as it involved value mapping in _to_rest_object
    • limits
  • Parallel
    • resources
    • limits
  • Spark
    • resources
    • identity - do not support for now as the only field for identity is type and it has not been exposed to customers
    • entry - do not support for now as entry overwrite from node is forbidden for now
  • [internal] Command/Parallel/Distributed
    • resources
    • limits
  • [internal] Spark
    • the same as #Spark

Sample error msg:

Exception: Unable to deserialize response data. Data: ${{parent.inputs.instance_count}}, int, ValueError: invalid literal for int() with base 10: '${{parent.inputs.instance_count}}'.
Traceback (most recent call last):
  File "D:\conda_env\smile\lib\site-packages\msrest\serialization.py", line 1605, in deserialize_data
    return self.deserialize_basic(data, data_type)
  File "D:\conda_env\smile\lib\site-packages\msrest\serialization.py", line 1748, in deserialize_basic
    return eval(data_type)(attr)
ValueError: invalid literal for int() with base 10: '${{parent.inputs.instance_count}}'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "d:\project\azure-sdk-for-python\sdk\ml\azure-ai-ml\azure\ai\ml\entities\_job\job.py", line 309, in _from_rest_object
    return PipelineJob._load_from_rest(obj)
  File "d:\project\azure-sdk-for-python\sdk\ml\azure-ai-ml\azure\ai\ml\entities\_job\pipeline\pipeline_job.py", line 526, in _load_from_rest
    sub_nodes = PipelineComponent._resolve_sub_nodes(properties.jobs) if properties.jobs else {}
  File "d:\project\azure-sdk-for-python\sdk\ml\azure-ai-ml\azure\ai\ml\entities\_component\pipeline_component.py", line 359, in _resolve_sub_nodes
    sub_nodes[node_name] = pipeline_node_factory.load_from_rest_object(obj=node)
  File "d:\project\azure-sdk-for-python\sdk\ml\azure-ai-ml\azure\ai\ml\entities\_job\pipeline\_load_component.py", line 252, in load_from_rest_object
    return self.get_load_from_rest_object_func(_type)(obj, **kwargs)
  File "d:\project\azure-sdk-for-python\sdk\ml\azure-ai-ml\azure\ai\ml\entities\_builders\base_node.py", line 369, in _from_rest_object
    init_kwargs = instance._from_rest_object_to_init_params(obj)
  File "d:\project\azure-sdk-for-python\sdk\ml\azure-ai-ml\azure\ai\ml\_internal\entities\command.py", line 110, in _from_rest_object_to_init_params
    resources = RestJobResourceConfiguration.from_dict(obj["resources"])
  File "D:\conda_env\smile\lib\site-packages\msrest\serialization.py", line 349, in from_dict
    return deserializer(cls.__name__, data, content_type=content_type)
  File "D:\conda_env\smile\lib\site-packages\msrest\serialization.py", line 1368, in __call__
    return self._deserialize(target_obj, data)
  File "D:\conda_env\smile\lib\site-packages\msrest\serialization.py", line 1442, in _deserialize
    value = self.deserialize_data(raw_value, attr_desc['type'])
  File "D:\conda_env\smile\lib\site-packages\msrest\serialization.py", line 1629, in deserialize_data
    raise_with_traceback(DeserializationError, msg, err)
  File "D:\conda_env\smile\lib\site-packages\msrest\exceptions.py", line 51, in raise_with_traceback
    raise error.with_traceback(exc_traceback)
  File "D:\conda_env\smile\lib\site-packages\msrest\serialization.py", line 1605, in deserialize_data
    return self.deserialize_basic(data, data_type)
  File "D:\conda_env\smile\lib\site-packages\msrest\serialization.py", line 1748, in deserialize_basic
    return eval(data_type)(attr)
msrest.exceptions.DeserializationError: Unable to deserialize response data. Data: ${{parent.inputs.instance_count}}, int, ValueError: invalid literal for int() with base 10: '${{parent.inputs.instance_count}}'

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@ghost ghost added the Machine Learning label Mar 24, 2023
@elliotzh elliotzh changed the title fix: support data binding expression for resources.xxx [DO NOT MERGE] fix: support data binding expression for resources.xxx Mar 24, 2023
@wangchao1230 wangchao1230 added the ML-Pipelines AreaPath label Mar 24, 2023
@azure-sdk
Copy link
Collaborator

azure-sdk commented Mar 24, 2023

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-ai-ml

@wangchao1230 wangchao1230 enabled auto-merge (squash) March 24, 2023 03:12
@elliotzh elliotzh force-pushed the zhangxingzhi/support-data-binding-expression-in-resources branch from dcbf37c to e994794 Compare March 24, 2023 09:01
@elliotzh elliotzh changed the title [DO NOT MERGE] fix: support data binding expression for resources.xxx [ML][Pipelines] feat: support data binding expression inside entity runsettings Mar 24, 2023
@wangchao1230 wangchao1230 merged commit 98dd8ec into Azure:main Mar 27, 2023
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Mar 27, 2023
…into network_ga

* 'main' of https://github.com/Azure/azure-sdk-for-python: (63 commits)
  check only once whether artifact extension exists (Azure#29594)
  code and test (Azure#29530)
  fix: support data binding expression for resources.xxx (Azure#29559)
  code and test (Azure#29558)
  [ServiceBus] enable sovereign cloud testing (Azure#29202)
  [AutoRelease] t2-communication-2023-03-20-22792(can only be merged by SDK owner) (Azure#29453)
  [Identity] Allow configurable process timeouts (Azure#28290)
  Increment package version after release of azure-containerregistry (Azure#29582)
  Update optional (Azure#28435)
  [Monitor][Query] Add sample notebook for large queries (Azure#28148)
  Update CHANGELOG.md (Azure#29580)
  [ServiceBus] remove msrest (Azure#29324)
  Explicitly set PSNativeCommandArgumentPassing to Legacy for git push script (Azure#29554)
  [ML][Pipelines] Support queue settings in pipeline job (Azure#29209)
  add experimental decorator for datatransfer (Azure#29562)
  Featurestore/online store crud new pr (Azure#29546)
  switch tooling over to typespec (Azure#29501)
  set up base path for feature set in load function (Azure#29544)
  Address credential description in docstring (Azure#29549)
  [Monitor] Regen query and ingestion (Azure#29504)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants