-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
chore: Updating Pytorch-Launcher component to work with pipelines v2 #11273
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @Fiona-Waters. Thanks for your PR. I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off by: Fiona-Waters [email protected] Signed-off-by: Fiona Waters <[email protected]>
Signed-off-by: Fiona-Waters [email protected] Signed-off-by: Fiona Waters <[email protected]>
@terrytangyuan maybe you could help with the training-operator related error I am getting here. Any advice would be really appreciated. Thank you. |
Can you print out |
Sure. Running it quickly locally it looks like this:
I can try to log it out when running on KinD later today. |
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.openapi_types = self.swagger_types | ||
# self.openapi_types = self.swagger_types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved to importing KubeflowOrgV1PyTorchJob from kubeflow.training and this does not have a swagger_types attribute. With the previous from kubeflow.pytorchjob import V1PyTorchJob
there was an error around using floats and ints within the numpy config file.
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed these functions altogether as they are no longer required.
This is what the serialized job looks like. Kind is present.
|
… operator Signed-off-by: Fiona-Waters [email protected] Signed-off-by: Fiona Waters <[email protected]>
@HumairAK would really appreciate if you could review this if/when you have time, please. |
@@ -1,4 +1,6 @@ | |||
pyyaml | |||
kubernetes | |||
kubeflow-pytorchjob | |||
kubeflow.training |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there minimal required version?
version=args.version, | ||
client=api_client | ||
) | ||
#config.load_kube_config() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be needed?
|
||
# container component description setting inputs and implementation | ||
@dsl.container_component | ||
def pytorch_job_launcher( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd imagine code like would be inside the /src directory instead of sample.py file but I am not familiar enough with KFP codebase to support that.
# Patch PyTorchJob APIs to align with k8s usage | ||
class V1PyTorchJob(V1PyTorchJob_original): | ||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.openapi_types = self.swagger_types | ||
|
||
|
||
class V1PyTorchJobSpec(V1PyTorchJobSpec_original): | ||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
self.openapi_types = self.swagger_types | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these no longer needed? Will this change break existing usage?
Thank you for your work on this! I left some comments. |
Description of your changes:
This PR will resolve kubeflow/training-operator#2068
I have updated the pytorch launcher component to use v2 constructs.
I have also updated the pytorch launcher component to use kubeflow training-operator TrainingClient.
Checklist: