Skip to content

Conversation

@nadiaya
Copy link
Contributor

@nadiaya nadiaya commented Apr 20, 2018

Adding sagemaker integration tests

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

Copy link

@andremoeller andremoeller left a comment

Choose a reason for hiding this comment

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

LGTM, just a few things to check though

predictor = pytorch.deploy(initial_instance_count=1, instance_type=instance_type)

batch_size = 100
data = np.zeros(shape=(batch_size, 1, 28, 28))

Choose a reason for hiding this comment

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

You might need dtype='float32' if you're planning on using NPY (or else these will be deserialized as float64)

Copy link
Contributor Author

Choose a reason for hiding this comment

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



@pytest.fixture(name='ecr_image', scope='session')
def fixture_ecr_image(docker_registry, docker_base_name, tag):

Choose a reason for hiding this comment

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

this will run sagemaker integ tests with repo sagemaker-pytorch, right? but i think integ tests push to preprod-pytorch. i'm not sure if this will run against the image pushed after local tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's a good point!

model_gpu_dir = os.path.join(mnist_path, 'model_gpu')
model_gpu_1d_dir = os.path.join(model_gpu_dir, '1d')

ENTRYPOINT = ["python", "-m", "pytorch_container.start"]

Choose a reason for hiding this comment

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

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 guess it is not, I just never really thought about it since we were planning to switch to the proper local mode.


@pytest.fixture(scope='session')
def docker_base_name(request):
@pytest.fixture(scope='session', name='docker_base_name')

Choose a reason for hiding this comment

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

Just asking: why is this new way preferred?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To avoid pylint's warning about "Shadows name from outer scope".

http://blog.pytest.org/2016/whats-new-in-pytest-30/ Fixture name parameter:
"This solves the problem where the function argument shadows the argument name, which annoys pylint and might cause bugs if one forgets to pull a fixture into a test function."

@nadiaya nadiaya merged commit 109f7e2 into master Apr 21, 2018
@nadiaya nadiaya deleted the ny-integ-tests branch May 3, 2018 02:59
carljeske pushed a commit to carljeske/sagemaker-pytorch-training-toolkit that referenced this pull request Jul 5, 2023
pytorch 1.3.1 changes
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