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

local k8s compute instance type via SDK #262

Open
amahab opened this issue Nov 1, 2022 · 3 comments
Open

local k8s compute instance type via SDK #262

amahab opened this issue Nov 1, 2022 · 3 comments

Comments

@amahab
Copy link

amahab commented Nov 1, 2022

I’m evaluating the Azure ML on Azur Arc enabled K8s.

Able to specify target compute instance type created in k8s via CLI v2 job yaml file - https://github.com/Azure/AML-Kubernetes/blob/master/examples/training/simple-train-cli/job.yml

The local k8s compute instance types are created as per this link - https://learn.microsoft.com/en-us/azure/machine-learning/how-to-manage-kubernetes-instance-types

Is there a python SDK method to specify instance type for target compute k8s cluster? I could not find examples or SDK documentation to achieve that.

Thanks!

@jiaochenlu
Copy link
Collaborator

jiaochenlu commented Nov 3, 2022

@amahab
Here is the SDK example of using Kubernnetes compute for training jobs. If you want to specify a custom instance type to your job, just add the "instance_type" parameter and specify the value to it, for example:

src = ScriptRunConfig(source_directory=script_folder,
   script='train.py',
   arguments=args,
   compute_target=amlarc_compute,
   instance_type=my_instance,
   environment=env)

@amahab
Copy link
Author

amahab commented Nov 7, 2022

@jiaochenlu

I'm running this notebook, Specified instance_type parameter as you mention above. Getting unexpected argument error.

TypeError: init() got an unexpected keyword argument 'instance_type'

@jiaochenlu
Copy link
Collaborator

jiaochenlu commented Nov 8, 2022

@amahab
Sorry my bad.
The notebook I provided earlier is the example regarding to SDK v1, and you should specify instance type as following code:

src = ScriptRunConfig(source_directory=script_folder,
    script='train.py',
    arguments=args,
    compute_target=amlarc_compute,
    instance_type=my_instance,
    environment=env)
src.run_config.kubernetescompute.instance_type = "<your-instance-type-name>"

But currently we have SDK v2 which is already GA, more example reagrding to SDK v2 you can find here, to use Kubernetes compute and specify instance type with SDK v2 for training job, please follow the example I provided before.

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

No branches or pull requests

2 participants