Skip to content

Update coach version for to 0.11.1 tensorflow. #684

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 7 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CHANGELOG
* bug-fix: pass accelerator_type in ``deploy`` for REST API TFS ``Model``
* doc-fix: move content from tf/README.rst into sphynx project
* doc-fix: Improve new developer experience in README
* feature: Add support for Coach 0.11.1 for Tensorflow

1.18.3.post1
============
Expand Down
4 changes: 2 additions & 2 deletions src/sagemaker/rl/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SageMaker Reinforcement Learning Estimators

With Reinforcement Learning (RL) Estimators, you can train reinforcement learning models on Amazon SageMaker.

Supported versions of Coach: ``0.10.1`` with TensorFlow, ``0.11.0`` with TensorFlow or MXNet.
Supported versions of Coach: ``0.11.1``, ``0.10.1`` with TensorFlow, ``0.11.0`` with TensorFlow or MXNet.
For more information about Coach, see https://github.com/NervanaSystems/coach

Supported versions of Ray: ``0.5.3`` with TensorFlow.
Expand Down Expand Up @@ -42,7 +42,7 @@ You can then create an ``RLEstimator`` with keyword arguments to point to this s

rl_estimator = RLEstimator(entry_point='coach-train.py',
toolkit=RLToolkit.COACH,
toolkit_version='0.11.0',
toolkit_version='0.11.1',
framework=RLFramework.TENSORFLOW,
role='SageMakerRole',
train_instance_type='ml.p3.2xlarge',
Expand Down
8 changes: 6 additions & 2 deletions src/sagemaker/rl/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@
'tensorflow': '1.11',
'mxnet': '1.3'
},
'0.11.1': {
'tensorflow': '1.12',
},
'0.11': {
'tensorflow': '1.11',
'tensorflow': '1.12',
'mxnet': '1.3'
}
},
Expand Down Expand Up @@ -69,7 +72,8 @@ class RLFramework(enum.Enum):
class RLEstimator(Framework):
"""Handle end-to-end training and deployment of custom RLEstimator code."""

COACH_LATEST_VERSION = '0.11.0'
COACH_LATEST_VERSION_TF = '0.11.1'
COACH_LATEST_VERSION_MXNET = '0.11.0'
RAY_LATEST_VERSION = '0.5.3'

def __init__(self, entry_point, toolkit=None, toolkit_version=None, framework=None,
Expand Down
17 changes: 12 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ def pytest_addoption(parser):
parser.addoption('--mxnet-full-version', action='store', default=MXNet.LATEST_VERSION)
parser.addoption('--ei-mxnet-full-version', action='store', default=MXNet.LATEST_VERSION)
parser.addoption('--pytorch-full-version', action='store', default=PyTorch.LATEST_VERSION)
parser.addoption('--rl-coach-full-version', action='store',
default=RLEstimator.COACH_LATEST_VERSION)
parser.addoption('--rl-coach-mxnet-full-version', action='store',
default=RLEstimator.COACH_LATEST_VERSION_MXNET)
parser.addoption('--rl-coach-tf-full-version', action='store',
default=RLEstimator.COACH_LATEST_VERSION_TF)
parser.addoption('--rl-ray-full-version', action='store',
default=RLEstimator.RAY_LATEST_VERSION)
parser.addoption('--sklearn-full-version', action='store', default=SKLEARN_VERSION)
Expand Down Expand Up @@ -128,7 +130,7 @@ def tf_version(request):
return request.param


@pytest.fixture(scope='module', params=['0.10.1', '0.10.1', '0.11', '0.11.0'])
@pytest.fixture(scope='module', params=['0.10.1', '0.10.1', '0.11', '0.11.0', '0.11.1'])
def rl_coach_tf_version(request):
return request.param

Expand Down Expand Up @@ -164,8 +166,13 @@ def pytorch_full_version(request):


@pytest.fixture(scope='module')
def rl_coach_full_version(request):
return request.config.getoption('--rl-coach-full-version')
def rl_coach_mxnet_full_version(request):
return request.config.getoption('--rl-coach-mxnet-full-version')


@pytest.fixture(scope='module')
def rl_coach_tf_full_version(request):
return request.config.getoption('--rl-coach-tf-full-version')


@pytest.fixture(scope='module')
Expand Down
8 changes: 4 additions & 4 deletions tests/integ/test_rl.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

@pytest.mark.canary_quick
@pytest.mark.skipif(PYTHON_VERSION != 'py3', reason="RL images supports only Python 3.")
def test_coach_mxnet(sagemaker_session, rl_coach_full_version):
estimator = _test_coach(sagemaker_session, RLFramework.MXNET, rl_coach_full_version)
def test_coach_mxnet(sagemaker_session, rl_coach_mxnet_full_version):
estimator = _test_coach(sagemaker_session, RLFramework.MXNET, rl_coach_mxnet_full_version)

with timeout(minutes=15):
estimator.fit(wait='False')
Expand All @@ -50,8 +50,8 @@ def test_coach_mxnet(sagemaker_session, rl_coach_full_version):


@pytest.mark.skipif(PYTHON_VERSION != 'py3', reason="RL images supports only Python 3.")
def test_coach_tf(sagemaker_session, rl_coach_full_version):
estimator = _test_coach(sagemaker_session, RLFramework.TENSORFLOW, rl_coach_full_version)
def test_coach_tf(sagemaker_session, rl_coach_tf_full_version):
estimator = _test_coach(sagemaker_session, RLFramework.TENSORFLOW, rl_coach_tf_full_version)

with timeout(minutes=15):
estimator.fit()
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_rl.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _get_full_gpu_image_uri(toolkit, toolkit_version, framework):


def _rl_estimator(sagemaker_session, toolkit=RLToolkit.COACH,
toolkit_version=RLEstimator.COACH_LATEST_VERSION, framework=RLFramework.MXNET,
toolkit_version=RLEstimator.COACH_LATEST_VERSION_MXNET, framework=RLFramework.MXNET,
train_instance_type=None, base_job_name=None, **kwargs):
return RLEstimator(entry_point=SCRIPT_PATH,
toolkit=toolkit,
Expand Down Expand Up @@ -466,7 +466,7 @@ def test_wrong_framework_format(sagemaker_session):
def test_wrong_toolkit_format(sagemaker_session):
with pytest.raises(ValueError) as e:
RLEstimator(toolkit='coach', framework=RLFramework.TENSORFLOW,
toolkit_version=RLEstimator.COACH_LATEST_VERSION,
toolkit_version=RLEstimator.COACH_LATEST_VERSION_TF,
entry_point=SCRIPT_PATH, role=ROLE, sagemaker_session=sagemaker_session,
train_instance_count=INSTANCE_COUNT, train_instance_type=INSTANCE_TYPE,
framework_version=None)
Expand Down