Skip to content

Add integration tests to run training jobs with sagemaker #81

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

Merged
merged 4 commits into from
Oct 5, 2018

Conversation

icywang86rui
Copy link
Contributor

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@icywang86rui icywang86rui requested a review from laurenyu October 3, 2018 22:09
test/conftest.py Outdated
@@ -36,6 +36,8 @@ def pytest_addoption(parser):
parser.addoption('--framework-version', default='1.10.0')
parser.addoption('--processor', default='cpu', choices=['gpu', 'cpu'])
parser.addoption('--py-version', default='3', choices=['2', '3'])
parser.addoption('--ecr-image', default=None)
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like this redundant with --docker-base-name and --tag - do we really need all of these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I can use tag for the functional tests and add --account-id instead of --ecr-image. That seems better.


@pytest.mark.skip_gpu
def test_mnist_cpu(sagemaker_session, ecr_image, instance_type):
instance_type = instance_type or 'ml.c4.xlarge'
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to have this defaulting behavior in the fixture definition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah. I can move it there.


@pytest.mark.skip_cpu
def test_mnist_gpu(sagemaker_session, ecr_image, instance_type):
_run_minist_training(sagemaker_session, ecr_image, instance_type)
Copy link
Contributor

Choose a reason for hiding this comment

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

is there still a need to have these separate? won't a test run just use the appropriate instance type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, you are right. I will merge it.

Copy link
Contributor

Choose a reason for hiding this comment

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

are you planning more tests that will use this _run_mnist_training function?


@pytest.mark.skip_cpu
def test_mnist_gpu(sagemaker_session, ecr_image, instance_type):
_run_minist_training(sagemaker_session, ecr_image, instance_type)
Copy link
Contributor

Choose a reason for hiding this comment

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

are you planning more tests that will use this _run_mnist_training function?

_run_minist_training(sagemaker_session, ecr_image, instance_type)


def _run_minist_training(sagemaker_session, ecr_image, instance_type):
Copy link
Contributor

Choose a reason for hiding this comment

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

s/minist/mnist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about just move this to the test but kept it because I plan to add distributed training tests later. And tests for creating endpoint and inference will be added too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually this function probably will need refactoring anyway. i will merge this in the test for now.

@icywang86rui icywang86rui merged commit 99eaf6b into aws:script-mode Oct 5, 2018
Elizaaaaa pushed a commit to Elizaaaaa/sagemaker-tensorflow-container that referenced this pull request Nov 4, 2019
* Add mnist sagemaker tests

* Use account-id instead of ecr-image

* Merge gpu and cpu sagemaker tests

* remove _run_mnist_training
Elizaaaaa pushed a commit to Elizaaaaa/sagemaker-tensorflow-container that referenced this pull request Nov 4, 2019
* Add mnist sagemaker tests

* Use account-id instead of ecr-image

* Merge gpu and cpu sagemaker tests

* remove _run_mnist_training
Elizaaaaa pushed a commit to Elizaaaaa/sagemaker-tensorflow-container that referenced this pull request Nov 4, 2019
* Add mnist sagemaker tests

* Use account-id instead of ecr-image

* Merge gpu and cpu sagemaker tests

* remove _run_mnist_training
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