Skip to content

Conversation

johnbensnyder
Copy link

@johnbensnyder johnbensnyder commented Apr 5, 2021

Issue #, if available:

Issue #10

Description of changes:

Adds --environment option to set LINUX_GPU_CONTAINER when build involves compiling Cuda operations.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

@jaipreet-s jaipreet-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be great if we can add an example on how to use this and the compute_type parameter in the README's Usage section as well https://github.com/aws-samples/sagemaker-studio-image-build-cli#usage

self.domain_id, self.user_profile_name = self._get_studio_metadata()
self.repo_name = None
self.compute_type = compute_type or "BUILD_GENERAL1_SMALL"
self.environment = environment or "LINUX_CONTAINER"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This default is being specified in multiple places - in the argument parsing and here. From what I can tell, the environment param should always be non-null when we get to this point, so we can remove this or check.

Comment on lines 23 to 24
if self.environment=="LINUX_GPU_CONTAINER" and self.compute_type=="BUILD_GENERAL1_SMALL":
self.compute_type="BUILD_GENERAL1_LARGE"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Why is this required?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUILD_GENERAL1_LARGE will automatically switch to a GPU instance if LINUX_GPU_CONTAINER is set. Small or medium will not.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. In that case, I recommend we make this explicit - Fail if the user is requested GPU and Small or Medium, because these are incompatible configuration options

@johnbensnyder
Copy link
Author

Sorry for the long delay. I've updated the changes so --compute-type now has to be manually changed by the user for GPU instances.

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.

2 participants