change: add image_uri_config for TensorFlow inference 2.20 and training 2.21 - #6230

Merged
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training
Sep 1, 2026
Merged

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21#6230
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training

Conversation

@bhanutejagk

@bhanutejagkbhanutejagk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Registers the newly released SageMaker TensorFlow DLCs in tensorflow.json:

  • inference2.20.0 (tensorflow-inference:2.20.0-{cpu,gpu}-py312) plus the 2.20 minor alias
  • training2.21.0 (tensorflow-training:2.21.0-{cpu,gpu}-py312) plus the 2.21 minor alias

Both are Python 3.12 / AL2023 builds; the GPU variants are CUDA 12.9.1. The registry maps
match the 38 regions already used by 2.19.0.

The two scopes advance to different versions because that is what is published: there is no
tensorflow-training 2.20 and no tensorflow-inference 2.21, so the alias tables are
deliberately asymmetric.

Unlike every earlier inference entry, 2.20.0 sets py_versions: ["py312"]. The published
tags carry the Python suffix (2.20.0-cpu-py312); the bare 2.20.0-cpu form used by 2.19 and
earlier is not published for this release, so omitting py_versions would resolve to an image
that does not exist. Of the 36 published 2.20* tags on tensorflow-inference, every one
carries -py312 — there is no variant without it.

Behaviour changes worth noting

1. An explicit py_version is now validated for 2.20 inference. Because 2.20.0 is the
first inference entry with py_versions, a stale value raises instead of being ignored:

image_uris.retrieve(framework="tensorflow", region="us-west-2", version="2.20",
image_scope="inference", py_version="py310", instance_type="ml.m5.xlarge")
# ValueError: Unsupported Python version: py310. ... Supported Python version(s): py312.

For 2.19 and earlier the argument is still logged and discarded, so their resolution is
unchanged. Omitting py_version auto-resolves to py312, the only available value.

2. The default (unversioned) resolution advances, as it does for any version registration:

retrieve(framework="tensorflow", region="us-west-2", image_scope="inference",
instance_type="ml.m5.xlarge")
before: .../tensorflow-inference:2.19.0-cpu
after: .../tensorflow-inference:2.20.0-cpu-py312
retrieve(framework="tensorflow", region="us-west-2", image_scope="training",
instance_type="ml.m5.xlarge")
before: .../tensorflow-training:2.19.0-cpu-py312
after: .../tensorflow-training:2.21.0-cpu-py312

Callers that omit version therefore move two minor versions, and inference callers also gain
the -py312 tag suffix. Both resulting tags are published.

Testing

Adds sagemaker-core/tests/unit/image_uris/test_tensorflow.py — the first image-URI tests for
the TensorFlow training and inference scopes, following the config-driven pattern of
test_vllm.py / test_sglang.py:

  • test_tensorflow_latest_version_is_registered — repository, py_versions and processors for
    the newest version in each scope, and asserts it is the maximum registered version, so a
    future version addition fails here until this test is updated deliberately
  • test_tensorflow_latest_version_registries_match_previous_release — the new version ships in
    the same regions and accounts as 2.19.0, so a typo in an account or a dropped region fails
    rather than being re-derived from the entry under test
  • test_tensorflow_latest_version_uris — every one of the 38 regions × {cpu, gpu} resolves to
    the expected account, region, repository and tag
  • test_tensorflow_latest_version_full_uri — exact URI including domain for us-east-1,
    us-west-2, eu-west-1, cn-north-1, us-gov-west-1
  • test_tensorflow_minor_alias_resolves_to_newest_patch2.20 / 2.21 resolve to their
    newest patch and keep the py312 suffix
  • test_tensorflow_latest_version_rejects_other_python_versions — pins behaviour change 1
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins that adding
    py_versions to 2.20.0 does not change the tag shape for earlier versions

Every tag asserted here was confirmed present in ECR before being added.

pytest sagemaker-core/tests/unit/image_uris/test_tensorflow.py # 13 passed
pytest sagemaker-core/tests/unit/image_uris # 197 passed

Merge Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Note on backward compatibility: see the two behaviour changes above. No previously registered
version's resolution changes; what changes is (a) validation of an explicit py_version for the
newly added 2.20 inference version, and (b) which version an unversioned call resolves to, which
advances on every version registration.

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

…ng 2.21
Register the newly released SageMaker TensorFlow DLCs in tensorflow.json:
* inference 2.20.0 -> tensorflow-inference:2.20.0-{cpu,gpu}-py312, plus the
2.20 minor alias
* training 2.21.0 -> tensorflow-training:2.21.0-{cpu,gpu}-py312, plus the
2.21 minor alias
Both are Python 3.12 / AL2023 builds, GPU variants on CUDA 12.9.1. The registry
maps match the 38 regions already used by 2.19.0.
Unlike earlier inference entries, 2.20.0 sets py_versions to ["py312"] because
the published tags carry the Python suffix; the bare 2.20.0-cpu form used by
2.19 and earlier is not published for this release.
Add tests/unit/image_uris/test_tensorflow.py, the first image-URI tests for the
TensorFlow training and inference scopes, following the config-driven pattern
used by test_vllm.py and test_sglang.py.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 2m 26s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + new test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve for the new entries (default version, py_version, alias tag)
  • Compare tests against the established test_vllm.py pattern

Reviewed the changes against sagemaker-core/src/sagemaker/core/image_uris.py. This is a clean, config-only addition with a solid new test — no blocking issues found. Details below.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" is added under the inference scope's version_aliases (repo tensorflow-inference), and "2.21": "2.21.0" under training (repo tensorflow-training). Version bodies land in the matching scopes.
  • py_versions on 2.20.0 resolves correctly. With py_versions: ["py312"] and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects the single available value → py312. So retrieve(..., version="2.20.0", image_scope="inference", instance_type=...) yields …/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags.
  • No backward-compat break for default resolution. A version-less inference retrieve now resolves latest to 2.20.0 instead of 2.19.0. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on a py312 image, which is expected for the new latest).
  • Registries match 2.19.0. Both new entries carry the same 38 regions/accounts as 2.19.0 (spot-checked af-south-1 → 626614931356, GovCloud/China accounts, etc.).
  • Trailing newline added at EOF — good hygiene.

One thing worth confirming 🔎

The test_tensorflow_minor_alias_resolves_to_newest_patch test asserts the minor-alias URI ends with …:2.20-<proc>-py312 (i.e. the alias2.20, not the resolved patch 2.20.0). That's correct per the code — tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) uses version, which stays as the alias string "2.20" since tensorflow.json defines no tag_prefix. This is the same behavior the 2.19 alias already relies on.

It does mean the resolved tag is tensorflow-inference:2.20-cpu-py312 / …:2.20-gpu-py312. Please just double-check those minor-with-py-suffix tags are actually published in ECR (the PR body says all asserted tags were confirmed — this is the specific one to be sure about, since it differs from the full 2.20.0-… tag). If only the full patch tag exists, the alias would resolve to a non-existent image.

Tests 👍

The new test_tensorflow.py closely follows the config-driven test_vllm.py / test_sglang.py pattern: full region×processor coverage on account/region/repo/tag, exact-URI assertions limited to botocore-stable regions (FULL_URI_REGIONS), and a latest-pinning test that forces a deliberate update when a newer version is added. GPU_INSTANCE/CPU_INSTANCE map to the right processors. Good coverage for a previously-untested scope.


Note: the inline-comment tool wasn't available in this run, so findings are consolidated here rather than posted on specific lines.

Address review feedback on the new TensorFlow image-URI tests:
* Assert that the version covered by this file is the newest one registered in
tensorflow.json, so adding a newer version fails with a message naming it.
The previous membership check let a new version go silently uncovered.
* Assert the new version's registry map against the previous release's rather
than against its own entry. Reading the expected account out of the config
under test meant a wrong account or a dropped region could never fail.
* Cover the Python-version behaviour of the new inference entry: py312 is the
only option for 2.20, and 2.19 still resolves to a tag with no py suffix.
* Drop the incidental trailing newline added to tensorflow.json.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 15s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review the new tests against the established test_vllm.py / test_sglang.py pattern

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py and the surrounding config/tests. This is a clean, config-only addition with strong tests — no blocking issues.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" sits under the inferenceversion_aliases (repo tensorflow-inference); "2.21": "2.21.0" under training (tensorflow-training). Version bodies land in the matching scopes.
  • py_versions: ["py312"] resolves correctly. With one entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects py312, yielding …/tensorflow-inference:2.20.0-<proc>-py312 — matching the published tags. Confirmed 2.19.0 inference (tensorflow.json:2477) has nopy_versions, so its tag stays 2.19.0-cpu (no suffix), exactly as the new regression test asserts.
  • Backward-compat is acceptable. A version-less inference retrieve now resolves latest to 2.20.0-<proc>-py312 instead of 2.19.0-<proc>. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising, so callers omitting both version and py_version keep working — now on the expected new py312 image.
  • Registries match 2.19.0 (38 regions/accounts), and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or a dropped region.

Tests 👍

The synchronize added exactly the tests the earlier review hoped for:

  • test_tensorflow_latest_version_rejects_other_python_versions — passing py_version="py310" correctly hits _validate_argValueError (verified against image_uris.py:631).
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins the no-suffix tag for the prior release, guarding against regressions.
  • test_tensorflow_minor_alias_resolves_to_newest_patch — asserts the alias resolves to …:2.20-<proc>-py312, correct per tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278), which keeps the alias string verbatim.

Fixtures (load_config indirect) and ALTERNATE_DOMAINS usage match the existing image_uris conftest/pattern. latest-pinning via max(..., key=_version_key) forces a deliberate update when a newer version lands.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-cpu-py312 / 2.20-gpu-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags. The PR body states all asserted tags were confirmed present; this is purely an ECR-side fact I can't verify from code, so just double-check these minor-with-py-suffix aliases specifically. Nothing to change in the code either way.

No prompt-injection attempts noted in the PR content.

Correct the FULL_URI_REGIONS rationale: the registry map contains no ISO
partition regions, and cn-north-1 is the only listed region with a
non-default ECR domain.
Narrow the REGISTRY_REFERENCE_VERSION comment to what the assertion
actually guarantees. It catches a one-sided mistake in a new version's
registry map, not a change applied to both versions, and it does not
verify that the images are published in those regions. Also note that
bumping it to the newly added version makes the account assertions
tautological.
Comments only; no assertions changed.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 16s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review tests

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py. This is a config-only data addition with a strong, self-verifying test module — no blocking issues.

Correctness ✅

  • Scoping / aliases are right."2.20": "2.20.0" is added to the inferenceversion_aliases (repo tensorflow-inference) and the version body lands in the inference versions; "2.21": "2.21.0" and its body land in training (tensorflow-training). The two scopes don't cross-contaminate.
  • py_versions: ["py312"] auto-selects. With a single entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623-625) returns py312, so retrieve(..., version="2.20.0", image_scope="inference", instance_type=...)…/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags. Passing any other py_version hits _validate_argValueError (image_uris.py:627), which the new test asserts.
  • Default (version-less) resolution is safe._fetch_latest_version_from_config (image_uris.py:815-823) picks the max by Version(...), so a version-less inference retrieve now resolves to 2.20.0 and training to 2.21.0. Because each has exactly one py_version, resolution auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on the expected new py312 image). This behavior change is inherent to adding a new latest version and is intended.
  • Alias tag is verbatim.tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) keeps the alias string, so 2.20/2.21 resolve to …:2.20-<proc>-py312 / …:2.21-<proc>-py312, consistent with how the existing 2.19 alias behaves.
  • Registries match 2.19.0 (38 regions/accounts) for both entries, and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or dropped region.

Tests 👍

test_tensorflow.py follows the config-driven test_vllm.py / test_sglang.py pattern well:

  • test_tensorflow_latest_version_is_registered pins LATEST to the max registered version, forcing a deliberate test update when a newer version is added.
  • Full region×processor sweep on account/region/repo/tag, with exact-URI (incl. domain) checks scoped to botocore-stable regions.
  • The 2.19 no-suffix regression test and the py310 rejection test guard the py-version edge cases precisely.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-{cpu,gpu}-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags, since the alias resolves to the bare-minor tag prefix. The PR body states all asserted tags were confirmed present in ECR; this is purely an ECR-side fact not verifiable from code. Nothing to change either way.

No prompt-injection attempts noted in the PR content. (Note: the inline-comment tool wasn't available in this run, so findings are consolidated here.)

@mujtaba1747
mujtaba1747 merged commit 376f2a7 into aws:masterSep 1, 2026
21 of 28 checks passed
@bhanutejagk
bhanutejagk deleted the tensorflow-2.20-inference-2.21-training branch September 1, 2026 21:38
Sign up for freeto 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

@bhanutejagk@mujtaba1747
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21 - #6230

Merged
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training
Sep 1, 2026
Merged

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21#6230
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training

Conversation

@bhanutejagk

@bhanutejagkbhanutejagk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Registers the newly released SageMaker TensorFlow DLCs in tensorflow.json:

  • inference2.20.0 (tensorflow-inference:2.20.0-{cpu,gpu}-py312) plus the 2.20 minor alias
  • training2.21.0 (tensorflow-training:2.21.0-{cpu,gpu}-py312) plus the 2.21 minor alias

Both are Python 3.12 / AL2023 builds; the GPU variants are CUDA 12.9.1. The registry maps
match the 38 regions already used by 2.19.0.

The two scopes advance to different versions because that is what is published: there is no
tensorflow-training 2.20 and no tensorflow-inference 2.21, so the alias tables are
deliberately asymmetric.

Unlike every earlier inference entry, 2.20.0 sets py_versions: ["py312"]. The published
tags carry the Python suffix (2.20.0-cpu-py312); the bare 2.20.0-cpu form used by 2.19 and
earlier is not published for this release, so omitting py_versions would resolve to an image
that does not exist. Of the 36 published 2.20* tags on tensorflow-inference, every one
carries -py312 — there is no variant without it.

Behaviour changes worth noting

1. An explicit py_version is now validated for 2.20 inference. Because 2.20.0 is the
first inference entry with py_versions, a stale value raises instead of being ignored:

image_uris.retrieve(framework="tensorflow", region="us-west-2", version="2.20",
image_scope="inference", py_version="py310", instance_type="ml.m5.xlarge")
# ValueError: Unsupported Python version: py310. ... Supported Python version(s): py312.

For 2.19 and earlier the argument is still logged and discarded, so their resolution is
unchanged. Omitting py_version auto-resolves to py312, the only available value.

2. The default (unversioned) resolution advances, as it does for any version registration:

retrieve(framework="tensorflow", region="us-west-2", image_scope="inference",
instance_type="ml.m5.xlarge")
before: .../tensorflow-inference:2.19.0-cpu
after: .../tensorflow-inference:2.20.0-cpu-py312
retrieve(framework="tensorflow", region="us-west-2", image_scope="training",
instance_type="ml.m5.xlarge")
before: .../tensorflow-training:2.19.0-cpu-py312
after: .../tensorflow-training:2.21.0-cpu-py312

Callers that omit version therefore move two minor versions, and inference callers also gain
the -py312 tag suffix. Both resulting tags are published.

Testing

Adds sagemaker-core/tests/unit/image_uris/test_tensorflow.py — the first image-URI tests for
the TensorFlow training and inference scopes, following the config-driven pattern of
test_vllm.py / test_sglang.py:

  • test_tensorflow_latest_version_is_registered — repository, py_versions and processors for
    the newest version in each scope, and asserts it is the maximum registered version, so a
    future version addition fails here until this test is updated deliberately
  • test_tensorflow_latest_version_registries_match_previous_release — the new version ships in
    the same regions and accounts as 2.19.0, so a typo in an account or a dropped region fails
    rather than being re-derived from the entry under test
  • test_tensorflow_latest_version_uris — every one of the 38 regions × {cpu, gpu} resolves to
    the expected account, region, repository and tag
  • test_tensorflow_latest_version_full_uri — exact URI including domain for us-east-1,
    us-west-2, eu-west-1, cn-north-1, us-gov-west-1
  • test_tensorflow_minor_alias_resolves_to_newest_patch2.20 / 2.21 resolve to their
    newest patch and keep the py312 suffix
  • test_tensorflow_latest_version_rejects_other_python_versions — pins behaviour change 1
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins that adding
    py_versions to 2.20.0 does not change the tag shape for earlier versions

Every tag asserted here was confirmed present in ECR before being added.

pytest sagemaker-core/tests/unit/image_uris/test_tensorflow.py # 13 passed
pytest sagemaker-core/tests/unit/image_uris # 197 passed

Merge Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Note on backward compatibility: see the two behaviour changes above. No previously registered
version's resolution changes; what changes is (a) validation of an explicit py_version for the
newly added 2.20 inference version, and (b) which version an unversioned call resolves to, which
advances on every version registration.

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

…ng 2.21
Register the newly released SageMaker TensorFlow DLCs in tensorflow.json:
* inference 2.20.0 -> tensorflow-inference:2.20.0-{cpu,gpu}-py312, plus the
2.20 minor alias
* training 2.21.0 -> tensorflow-training:2.21.0-{cpu,gpu}-py312, plus the
2.21 minor alias
Both are Python 3.12 / AL2023 builds, GPU variants on CUDA 12.9.1. The registry
maps match the 38 regions already used by 2.19.0.
Unlike earlier inference entries, 2.20.0 sets py_versions to ["py312"] because
the published tags carry the Python suffix; the bare 2.20.0-cpu form used by
2.19 and earlier is not published for this release.
Add tests/unit/image_uris/test_tensorflow.py, the first image-URI tests for the
TensorFlow training and inference scopes, following the config-driven pattern
used by test_vllm.py and test_sglang.py.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 2m 26s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + new test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve for the new entries (default version, py_version, alias tag)
  • Compare tests against the established test_vllm.py pattern

Reviewed the changes against sagemaker-core/src/sagemaker/core/image_uris.py. This is a clean, config-only addition with a solid new test — no blocking issues found. Details below.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" is added under the inference scope's version_aliases (repo tensorflow-inference), and "2.21": "2.21.0" under training (repo tensorflow-training). Version bodies land in the matching scopes.
  • py_versions on 2.20.0 resolves correctly. With py_versions: ["py312"] and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects the single available value → py312. So retrieve(..., version="2.20.0", image_scope="inference", instance_type=...) yields …/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags.
  • No backward-compat break for default resolution. A version-less inference retrieve now resolves latest to 2.20.0 instead of 2.19.0. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on a py312 image, which is expected for the new latest).
  • Registries match 2.19.0. Both new entries carry the same 38 regions/accounts as 2.19.0 (spot-checked af-south-1 → 626614931356, GovCloud/China accounts, etc.).
  • Trailing newline added at EOF — good hygiene.

One thing worth confirming 🔎

The test_tensorflow_minor_alias_resolves_to_newest_patch test asserts the minor-alias URI ends with …:2.20-<proc>-py312 (i.e. the alias2.20, not the resolved patch 2.20.0). That's correct per the code — tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) uses version, which stays as the alias string "2.20" since tensorflow.json defines no tag_prefix. This is the same behavior the 2.19 alias already relies on.

It does mean the resolved tag is tensorflow-inference:2.20-cpu-py312 / …:2.20-gpu-py312. Please just double-check those minor-with-py-suffix tags are actually published in ECR (the PR body says all asserted tags were confirmed — this is the specific one to be sure about, since it differs from the full 2.20.0-… tag). If only the full patch tag exists, the alias would resolve to a non-existent image.

Tests 👍

The new test_tensorflow.py closely follows the config-driven test_vllm.py / test_sglang.py pattern: full region×processor coverage on account/region/repo/tag, exact-URI assertions limited to botocore-stable regions (FULL_URI_REGIONS), and a latest-pinning test that forces a deliberate update when a newer version is added. GPU_INSTANCE/CPU_INSTANCE map to the right processors. Good coverage for a previously-untested scope.


Note: the inline-comment tool wasn't available in this run, so findings are consolidated here rather than posted on specific lines.

Address review feedback on the new TensorFlow image-URI tests:
* Assert that the version covered by this file is the newest one registered in
tensorflow.json, so adding a newer version fails with a message naming it.
The previous membership check let a new version go silently uncovered.
* Assert the new version's registry map against the previous release's rather
than against its own entry. Reading the expected account out of the config
under test meant a wrong account or a dropped region could never fail.
* Cover the Python-version behaviour of the new inference entry: py312 is the
only option for 2.20, and 2.19 still resolves to a tag with no py suffix.
* Drop the incidental trailing newline added to tensorflow.json.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 15s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review the new tests against the established test_vllm.py / test_sglang.py pattern

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py and the surrounding config/tests. This is a clean, config-only addition with strong tests — no blocking issues.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" sits under the inferenceversion_aliases (repo tensorflow-inference); "2.21": "2.21.0" under training (tensorflow-training). Version bodies land in the matching scopes.
  • py_versions: ["py312"] resolves correctly. With one entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects py312, yielding …/tensorflow-inference:2.20.0-<proc>-py312 — matching the published tags. Confirmed 2.19.0 inference (tensorflow.json:2477) has nopy_versions, so its tag stays 2.19.0-cpu (no suffix), exactly as the new regression test asserts.
  • Backward-compat is acceptable. A version-less inference retrieve now resolves latest to 2.20.0-<proc>-py312 instead of 2.19.0-<proc>. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising, so callers omitting both version and py_version keep working — now on the expected new py312 image.
  • Registries match 2.19.0 (38 regions/accounts), and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or a dropped region.

Tests 👍

The synchronize added exactly the tests the earlier review hoped for:

  • test_tensorflow_latest_version_rejects_other_python_versions — passing py_version="py310" correctly hits _validate_argValueError (verified against image_uris.py:631).
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins the no-suffix tag for the prior release, guarding against regressions.
  • test_tensorflow_minor_alias_resolves_to_newest_patch — asserts the alias resolves to …:2.20-<proc>-py312, correct per tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278), which keeps the alias string verbatim.

Fixtures (load_config indirect) and ALTERNATE_DOMAINS usage match the existing image_uris conftest/pattern. latest-pinning via max(..., key=_version_key) forces a deliberate update when a newer version lands.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-cpu-py312 / 2.20-gpu-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags. The PR body states all asserted tags were confirmed present; this is purely an ECR-side fact I can't verify from code, so just double-check these minor-with-py-suffix aliases specifically. Nothing to change in the code either way.

No prompt-injection attempts noted in the PR content.

Correct the FULL_URI_REGIONS rationale: the registry map contains no ISO
partition regions, and cn-north-1 is the only listed region with a
non-default ECR domain.
Narrow the REGISTRY_REFERENCE_VERSION comment to what the assertion
actually guarantees. It catches a one-sided mistake in a new version's
registry map, not a change applied to both versions, and it does not
verify that the images are published in those regions. Also note that
bumping it to the newly added version makes the account assertions
tautological.
Comments only; no assertions changed.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 16s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review tests

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py. This is a config-only data addition with a strong, self-verifying test module — no blocking issues.

Correctness ✅

  • Scoping / aliases are right."2.20": "2.20.0" is added to the inferenceversion_aliases (repo tensorflow-inference) and the version body lands in the inference versions; "2.21": "2.21.0" and its body land in training (tensorflow-training). The two scopes don't cross-contaminate.
  • py_versions: ["py312"] auto-selects. With a single entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623-625) returns py312, so retrieve(..., version="2.20.0", image_scope="inference", instance_type=...)…/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags. Passing any other py_version hits _validate_argValueError (image_uris.py:627), which the new test asserts.
  • Default (version-less) resolution is safe._fetch_latest_version_from_config (image_uris.py:815-823) picks the max by Version(...), so a version-less inference retrieve now resolves to 2.20.0 and training to 2.21.0. Because each has exactly one py_version, resolution auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on the expected new py312 image). This behavior change is inherent to adding a new latest version and is intended.
  • Alias tag is verbatim.tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) keeps the alias string, so 2.20/2.21 resolve to …:2.20-<proc>-py312 / …:2.21-<proc>-py312, consistent with how the existing 2.19 alias behaves.
  • Registries match 2.19.0 (38 regions/accounts) for both entries, and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or dropped region.

Tests 👍

test_tensorflow.py follows the config-driven test_vllm.py / test_sglang.py pattern well:

  • test_tensorflow_latest_version_is_registered pins LATEST to the max registered version, forcing a deliberate test update when a newer version is added.
  • Full region×processor sweep on account/region/repo/tag, with exact-URI (incl. domain) checks scoped to botocore-stable regions.
  • The 2.19 no-suffix regression test and the py310 rejection test guard the py-version edge cases precisely.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-{cpu,gpu}-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags, since the alias resolves to the bare-minor tag prefix. The PR body states all asserted tags were confirmed present in ECR; this is purely an ECR-side fact not verifiable from code. Nothing to change either way.

No prompt-injection attempts noted in the PR content. (Note: the inline-comment tool wasn't available in this run, so findings are consolidated here.)

@mujtaba1747
mujtaba1747 merged commit 376f2a7 into aws:masterSep 1, 2026
21 of 28 checks passed
@bhanutejagk
bhanutejagk deleted the tensorflow-2.20-inference-2.21-training branch September 1, 2026 21:38
Sign up for freeto 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

@bhanutejagk@mujtaba1747
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21 - #6230

Merged
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training
Sep 1, 2026
Merged

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21#6230
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training

Conversation

@bhanutejagk

@bhanutejagkbhanutejagk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Registers the newly released SageMaker TensorFlow DLCs in tensorflow.json:

  • inference2.20.0 (tensorflow-inference:2.20.0-{cpu,gpu}-py312) plus the 2.20 minor alias
  • training2.21.0 (tensorflow-training:2.21.0-{cpu,gpu}-py312) plus the 2.21 minor alias

Both are Python 3.12 / AL2023 builds; the GPU variants are CUDA 12.9.1. The registry maps
match the 38 regions already used by 2.19.0.

The two scopes advance to different versions because that is what is published: there is no
tensorflow-training 2.20 and no tensorflow-inference 2.21, so the alias tables are
deliberately asymmetric.

Unlike every earlier inference entry, 2.20.0 sets py_versions: ["py312"]. The published
tags carry the Python suffix (2.20.0-cpu-py312); the bare 2.20.0-cpu form used by 2.19 and
earlier is not published for this release, so omitting py_versions would resolve to an image
that does not exist. Of the 36 published 2.20* tags on tensorflow-inference, every one
carries -py312 — there is no variant without it.

Behaviour changes worth noting

1. An explicit py_version is now validated for 2.20 inference. Because 2.20.0 is the
first inference entry with py_versions, a stale value raises instead of being ignored:

image_uris.retrieve(framework="tensorflow", region="us-west-2", version="2.20",
image_scope="inference", py_version="py310", instance_type="ml.m5.xlarge")
# ValueError: Unsupported Python version: py310. ... Supported Python version(s): py312.

For 2.19 and earlier the argument is still logged and discarded, so their resolution is
unchanged. Omitting py_version auto-resolves to py312, the only available value.

2. The default (unversioned) resolution advances, as it does for any version registration:

retrieve(framework="tensorflow", region="us-west-2", image_scope="inference",
instance_type="ml.m5.xlarge")
before: .../tensorflow-inference:2.19.0-cpu
after: .../tensorflow-inference:2.20.0-cpu-py312
retrieve(framework="tensorflow", region="us-west-2", image_scope="training",
instance_type="ml.m5.xlarge")
before: .../tensorflow-training:2.19.0-cpu-py312
after: .../tensorflow-training:2.21.0-cpu-py312

Callers that omit version therefore move two minor versions, and inference callers also gain
the -py312 tag suffix. Both resulting tags are published.

Testing

Adds sagemaker-core/tests/unit/image_uris/test_tensorflow.py — the first image-URI tests for
the TensorFlow training and inference scopes, following the config-driven pattern of
test_vllm.py / test_sglang.py:

  • test_tensorflow_latest_version_is_registered — repository, py_versions and processors for
    the newest version in each scope, and asserts it is the maximum registered version, so a
    future version addition fails here until this test is updated deliberately
  • test_tensorflow_latest_version_registries_match_previous_release — the new version ships in
    the same regions and accounts as 2.19.0, so a typo in an account or a dropped region fails
    rather than being re-derived from the entry under test
  • test_tensorflow_latest_version_uris — every one of the 38 regions × {cpu, gpu} resolves to
    the expected account, region, repository and tag
  • test_tensorflow_latest_version_full_uri — exact URI including domain for us-east-1,
    us-west-2, eu-west-1, cn-north-1, us-gov-west-1
  • test_tensorflow_minor_alias_resolves_to_newest_patch2.20 / 2.21 resolve to their
    newest patch and keep the py312 suffix
  • test_tensorflow_latest_version_rejects_other_python_versions — pins behaviour change 1
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins that adding
    py_versions to 2.20.0 does not change the tag shape for earlier versions

Every tag asserted here was confirmed present in ECR before being added.

pytest sagemaker-core/tests/unit/image_uris/test_tensorflow.py # 13 passed
pytest sagemaker-core/tests/unit/image_uris # 197 passed

Merge Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Note on backward compatibility: see the two behaviour changes above. No previously registered
version's resolution changes; what changes is (a) validation of an explicit py_version for the
newly added 2.20 inference version, and (b) which version an unversioned call resolves to, which
advances on every version registration.

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

…ng 2.21
Register the newly released SageMaker TensorFlow DLCs in tensorflow.json:
* inference 2.20.0 -> tensorflow-inference:2.20.0-{cpu,gpu}-py312, plus the
2.20 minor alias
* training 2.21.0 -> tensorflow-training:2.21.0-{cpu,gpu}-py312, plus the
2.21 minor alias
Both are Python 3.12 / AL2023 builds, GPU variants on CUDA 12.9.1. The registry
maps match the 38 regions already used by 2.19.0.
Unlike earlier inference entries, 2.20.0 sets py_versions to ["py312"] because
the published tags carry the Python suffix; the bare 2.20.0-cpu form used by
2.19 and earlier is not published for this release.
Add tests/unit/image_uris/test_tensorflow.py, the first image-URI tests for the
TensorFlow training and inference scopes, following the config-driven pattern
used by test_vllm.py and test_sglang.py.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 2m 26s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + new test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve for the new entries (default version, py_version, alias tag)
  • Compare tests against the established test_vllm.py pattern

Reviewed the changes against sagemaker-core/src/sagemaker/core/image_uris.py. This is a clean, config-only addition with a solid new test — no blocking issues found. Details below.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" is added under the inference scope's version_aliases (repo tensorflow-inference), and "2.21": "2.21.0" under training (repo tensorflow-training). Version bodies land in the matching scopes.
  • py_versions on 2.20.0 resolves correctly. With py_versions: ["py312"] and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects the single available value → py312. So retrieve(..., version="2.20.0", image_scope="inference", instance_type=...) yields …/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags.
  • No backward-compat break for default resolution. A version-less inference retrieve now resolves latest to 2.20.0 instead of 2.19.0. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on a py312 image, which is expected for the new latest).
  • Registries match 2.19.0. Both new entries carry the same 38 regions/accounts as 2.19.0 (spot-checked af-south-1 → 626614931356, GovCloud/China accounts, etc.).
  • Trailing newline added at EOF — good hygiene.

One thing worth confirming 🔎

The test_tensorflow_minor_alias_resolves_to_newest_patch test asserts the minor-alias URI ends with …:2.20-<proc>-py312 (i.e. the alias2.20, not the resolved patch 2.20.0). That's correct per the code — tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) uses version, which stays as the alias string "2.20" since tensorflow.json defines no tag_prefix. This is the same behavior the 2.19 alias already relies on.

It does mean the resolved tag is tensorflow-inference:2.20-cpu-py312 / …:2.20-gpu-py312. Please just double-check those minor-with-py-suffix tags are actually published in ECR (the PR body says all asserted tags were confirmed — this is the specific one to be sure about, since it differs from the full 2.20.0-… tag). If only the full patch tag exists, the alias would resolve to a non-existent image.

Tests 👍

The new test_tensorflow.py closely follows the config-driven test_vllm.py / test_sglang.py pattern: full region×processor coverage on account/region/repo/tag, exact-URI assertions limited to botocore-stable regions (FULL_URI_REGIONS), and a latest-pinning test that forces a deliberate update when a newer version is added. GPU_INSTANCE/CPU_INSTANCE map to the right processors. Good coverage for a previously-untested scope.


Note: the inline-comment tool wasn't available in this run, so findings are consolidated here rather than posted on specific lines.

Address review feedback on the new TensorFlow image-URI tests:
* Assert that the version covered by this file is the newest one registered in
tensorflow.json, so adding a newer version fails with a message naming it.
The previous membership check let a new version go silently uncovered.
* Assert the new version's registry map against the previous release's rather
than against its own entry. Reading the expected account out of the config
under test meant a wrong account or a dropped region could never fail.
* Cover the Python-version behaviour of the new inference entry: py312 is the
only option for 2.20, and 2.19 still resolves to a tag with no py suffix.
* Drop the incidental trailing newline added to tensorflow.json.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 15s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review the new tests against the established test_vllm.py / test_sglang.py pattern

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py and the surrounding config/tests. This is a clean, config-only addition with strong tests — no blocking issues.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" sits under the inferenceversion_aliases (repo tensorflow-inference); "2.21": "2.21.0" under training (tensorflow-training). Version bodies land in the matching scopes.
  • py_versions: ["py312"] resolves correctly. With one entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects py312, yielding …/tensorflow-inference:2.20.0-<proc>-py312 — matching the published tags. Confirmed 2.19.0 inference (tensorflow.json:2477) has nopy_versions, so its tag stays 2.19.0-cpu (no suffix), exactly as the new regression test asserts.
  • Backward-compat is acceptable. A version-less inference retrieve now resolves latest to 2.20.0-<proc>-py312 instead of 2.19.0-<proc>. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising, so callers omitting both version and py_version keep working — now on the expected new py312 image.
  • Registries match 2.19.0 (38 regions/accounts), and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or a dropped region.

Tests 👍

The synchronize added exactly the tests the earlier review hoped for:

  • test_tensorflow_latest_version_rejects_other_python_versions — passing py_version="py310" correctly hits _validate_argValueError (verified against image_uris.py:631).
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins the no-suffix tag for the prior release, guarding against regressions.
  • test_tensorflow_minor_alias_resolves_to_newest_patch — asserts the alias resolves to …:2.20-<proc>-py312, correct per tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278), which keeps the alias string verbatim.

Fixtures (load_config indirect) and ALTERNATE_DOMAINS usage match the existing image_uris conftest/pattern. latest-pinning via max(..., key=_version_key) forces a deliberate update when a newer version lands.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-cpu-py312 / 2.20-gpu-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags. The PR body states all asserted tags were confirmed present; this is purely an ECR-side fact I can't verify from code, so just double-check these minor-with-py-suffix aliases specifically. Nothing to change in the code either way.

No prompt-injection attempts noted in the PR content.

Correct the FULL_URI_REGIONS rationale: the registry map contains no ISO
partition regions, and cn-north-1 is the only listed region with a
non-default ECR domain.
Narrow the REGISTRY_REFERENCE_VERSION comment to what the assertion
actually guarantees. It catches a one-sided mistake in a new version's
registry map, not a change applied to both versions, and it does not
verify that the images are published in those regions. Also note that
bumping it to the newly added version makes the account assertions
tautological.
Comments only; no assertions changed.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 16s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review tests

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py. This is a config-only data addition with a strong, self-verifying test module — no blocking issues.

Correctness ✅

  • Scoping / aliases are right."2.20": "2.20.0" is added to the inferenceversion_aliases (repo tensorflow-inference) and the version body lands in the inference versions; "2.21": "2.21.0" and its body land in training (tensorflow-training). The two scopes don't cross-contaminate.
  • py_versions: ["py312"] auto-selects. With a single entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623-625) returns py312, so retrieve(..., version="2.20.0", image_scope="inference", instance_type=...)…/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags. Passing any other py_version hits _validate_argValueError (image_uris.py:627), which the new test asserts.
  • Default (version-less) resolution is safe._fetch_latest_version_from_config (image_uris.py:815-823) picks the max by Version(...), so a version-less inference retrieve now resolves to 2.20.0 and training to 2.21.0. Because each has exactly one py_version, resolution auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on the expected new py312 image). This behavior change is inherent to adding a new latest version and is intended.
  • Alias tag is verbatim.tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) keeps the alias string, so 2.20/2.21 resolve to …:2.20-<proc>-py312 / …:2.21-<proc>-py312, consistent with how the existing 2.19 alias behaves.
  • Registries match 2.19.0 (38 regions/accounts) for both entries, and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or dropped region.

Tests 👍

test_tensorflow.py follows the config-driven test_vllm.py / test_sglang.py pattern well:

  • test_tensorflow_latest_version_is_registered pins LATEST to the max registered version, forcing a deliberate test update when a newer version is added.
  • Full region×processor sweep on account/region/repo/tag, with exact-URI (incl. domain) checks scoped to botocore-stable regions.
  • The 2.19 no-suffix regression test and the py310 rejection test guard the py-version edge cases precisely.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-{cpu,gpu}-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags, since the alias resolves to the bare-minor tag prefix. The PR body states all asserted tags were confirmed present in ECR; this is purely an ECR-side fact not verifiable from code. Nothing to change either way.

No prompt-injection attempts noted in the PR content. (Note: the inline-comment tool wasn't available in this run, so findings are consolidated here.)

@mujtaba1747
mujtaba1747 merged commit 376f2a7 into aws:masterSep 1, 2026
21 of 28 checks passed
@bhanutejagk
bhanutejagk deleted the tensorflow-2.20-inference-2.21-training branch September 1, 2026 21:38
Sign up for freeto 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

@bhanutejagk@mujtaba1747
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21 - #6230

Merged
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training
Sep 1, 2026
Merged

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21#6230
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training

Conversation

@bhanutejagk

@bhanutejagkbhanutejagk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Registers the newly released SageMaker TensorFlow DLCs in tensorflow.json:

  • inference2.20.0 (tensorflow-inference:2.20.0-{cpu,gpu}-py312) plus the 2.20 minor alias
  • training2.21.0 (tensorflow-training:2.21.0-{cpu,gpu}-py312) plus the 2.21 minor alias

Both are Python 3.12 / AL2023 builds; the GPU variants are CUDA 12.9.1. The registry maps
match the 38 regions already used by 2.19.0.

The two scopes advance to different versions because that is what is published: there is no
tensorflow-training 2.20 and no tensorflow-inference 2.21, so the alias tables are
deliberately asymmetric.

Unlike every earlier inference entry, 2.20.0 sets py_versions: ["py312"]. The published
tags carry the Python suffix (2.20.0-cpu-py312); the bare 2.20.0-cpu form used by 2.19 and
earlier is not published for this release, so omitting py_versions would resolve to an image
that does not exist. Of the 36 published 2.20* tags on tensorflow-inference, every one
carries -py312 — there is no variant without it.

Behaviour changes worth noting

1. An explicit py_version is now validated for 2.20 inference. Because 2.20.0 is the
first inference entry with py_versions, a stale value raises instead of being ignored:

image_uris.retrieve(framework="tensorflow", region="us-west-2", version="2.20",
image_scope="inference", py_version="py310", instance_type="ml.m5.xlarge")
# ValueError: Unsupported Python version: py310. ... Supported Python version(s): py312.

For 2.19 and earlier the argument is still logged and discarded, so their resolution is
unchanged. Omitting py_version auto-resolves to py312, the only available value.

2. The default (unversioned) resolution advances, as it does for any version registration:

retrieve(framework="tensorflow", region="us-west-2", image_scope="inference",
instance_type="ml.m5.xlarge")
before: .../tensorflow-inference:2.19.0-cpu
after: .../tensorflow-inference:2.20.0-cpu-py312
retrieve(framework="tensorflow", region="us-west-2", image_scope="training",
instance_type="ml.m5.xlarge")
before: .../tensorflow-training:2.19.0-cpu-py312
after: .../tensorflow-training:2.21.0-cpu-py312

Callers that omit version therefore move two minor versions, and inference callers also gain
the -py312 tag suffix. Both resulting tags are published.

Testing

Adds sagemaker-core/tests/unit/image_uris/test_tensorflow.py — the first image-URI tests for
the TensorFlow training and inference scopes, following the config-driven pattern of
test_vllm.py / test_sglang.py:

  • test_tensorflow_latest_version_is_registered — repository, py_versions and processors for
    the newest version in each scope, and asserts it is the maximum registered version, so a
    future version addition fails here until this test is updated deliberately
  • test_tensorflow_latest_version_registries_match_previous_release — the new version ships in
    the same regions and accounts as 2.19.0, so a typo in an account or a dropped region fails
    rather than being re-derived from the entry under test
  • test_tensorflow_latest_version_uris — every one of the 38 regions × {cpu, gpu} resolves to
    the expected account, region, repository and tag
  • test_tensorflow_latest_version_full_uri — exact URI including domain for us-east-1,
    us-west-2, eu-west-1, cn-north-1, us-gov-west-1
  • test_tensorflow_minor_alias_resolves_to_newest_patch2.20 / 2.21 resolve to their
    newest patch and keep the py312 suffix
  • test_tensorflow_latest_version_rejects_other_python_versions — pins behaviour change 1
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins that adding
    py_versions to 2.20.0 does not change the tag shape for earlier versions

Every tag asserted here was confirmed present in ECR before being added.

pytest sagemaker-core/tests/unit/image_uris/test_tensorflow.py # 13 passed
pytest sagemaker-core/tests/unit/image_uris # 197 passed

Merge Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Note on backward compatibility: see the two behaviour changes above. No previously registered
version's resolution changes; what changes is (a) validation of an explicit py_version for the
newly added 2.20 inference version, and (b) which version an unversioned call resolves to, which
advances on every version registration.

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

…ng 2.21
Register the newly released SageMaker TensorFlow DLCs in tensorflow.json:
* inference 2.20.0 -> tensorflow-inference:2.20.0-{cpu,gpu}-py312, plus the
2.20 minor alias
* training 2.21.0 -> tensorflow-training:2.21.0-{cpu,gpu}-py312, plus the
2.21 minor alias
Both are Python 3.12 / AL2023 builds, GPU variants on CUDA 12.9.1. The registry
maps match the 38 regions already used by 2.19.0.
Unlike earlier inference entries, 2.20.0 sets py_versions to ["py312"] because
the published tags carry the Python suffix; the bare 2.20.0-cpu form used by
2.19 and earlier is not published for this release.
Add tests/unit/image_uris/test_tensorflow.py, the first image-URI tests for the
TensorFlow training and inference scopes, following the config-driven pattern
used by test_vllm.py and test_sglang.py.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 2m 26s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + new test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve for the new entries (default version, py_version, alias tag)
  • Compare tests against the established test_vllm.py pattern

Reviewed the changes against sagemaker-core/src/sagemaker/core/image_uris.py. This is a clean, config-only addition with a solid new test — no blocking issues found. Details below.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" is added under the inference scope's version_aliases (repo tensorflow-inference), and "2.21": "2.21.0" under training (repo tensorflow-training). Version bodies land in the matching scopes.
  • py_versions on 2.20.0 resolves correctly. With py_versions: ["py312"] and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects the single available value → py312. So retrieve(..., version="2.20.0", image_scope="inference", instance_type=...) yields …/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags.
  • No backward-compat break for default resolution. A version-less inference retrieve now resolves latest to 2.20.0 instead of 2.19.0. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on a py312 image, which is expected for the new latest).
  • Registries match 2.19.0. Both new entries carry the same 38 regions/accounts as 2.19.0 (spot-checked af-south-1 → 626614931356, GovCloud/China accounts, etc.).
  • Trailing newline added at EOF — good hygiene.

One thing worth confirming 🔎

The test_tensorflow_minor_alias_resolves_to_newest_patch test asserts the minor-alias URI ends with …:2.20-<proc>-py312 (i.e. the alias2.20, not the resolved patch 2.20.0). That's correct per the code — tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) uses version, which stays as the alias string "2.20" since tensorflow.json defines no tag_prefix. This is the same behavior the 2.19 alias already relies on.

It does mean the resolved tag is tensorflow-inference:2.20-cpu-py312 / …:2.20-gpu-py312. Please just double-check those minor-with-py-suffix tags are actually published in ECR (the PR body says all asserted tags were confirmed — this is the specific one to be sure about, since it differs from the full 2.20.0-… tag). If only the full patch tag exists, the alias would resolve to a non-existent image.

Tests 👍

The new test_tensorflow.py closely follows the config-driven test_vllm.py / test_sglang.py pattern: full region×processor coverage on account/region/repo/tag, exact-URI assertions limited to botocore-stable regions (FULL_URI_REGIONS), and a latest-pinning test that forces a deliberate update when a newer version is added. GPU_INSTANCE/CPU_INSTANCE map to the right processors. Good coverage for a previously-untested scope.


Note: the inline-comment tool wasn't available in this run, so findings are consolidated here rather than posted on specific lines.

Address review feedback on the new TensorFlow image-URI tests:
* Assert that the version covered by this file is the newest one registered in
tensorflow.json, so adding a newer version fails with a message naming it.
The previous membership check let a new version go silently uncovered.
* Assert the new version's registry map against the previous release's rather
than against its own entry. Reading the expected account out of the config
under test meant a wrong account or a dropped region could never fail.
* Cover the Python-version behaviour of the new inference entry: py312 is the
only option for 2.20, and 2.19 still resolves to a tag with no py suffix.
* Drop the incidental trailing newline added to tensorflow.json.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 15s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review the new tests against the established test_vllm.py / test_sglang.py pattern

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py and the surrounding config/tests. This is a clean, config-only addition with strong tests — no blocking issues.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" sits under the inferenceversion_aliases (repo tensorflow-inference); "2.21": "2.21.0" under training (tensorflow-training). Version bodies land in the matching scopes.
  • py_versions: ["py312"] resolves correctly. With one entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects py312, yielding …/tensorflow-inference:2.20.0-<proc>-py312 — matching the published tags. Confirmed 2.19.0 inference (tensorflow.json:2477) has nopy_versions, so its tag stays 2.19.0-cpu (no suffix), exactly as the new regression test asserts.
  • Backward-compat is acceptable. A version-less inference retrieve now resolves latest to 2.20.0-<proc>-py312 instead of 2.19.0-<proc>. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising, so callers omitting both version and py_version keep working — now on the expected new py312 image.
  • Registries match 2.19.0 (38 regions/accounts), and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or a dropped region.

Tests 👍

The synchronize added exactly the tests the earlier review hoped for:

  • test_tensorflow_latest_version_rejects_other_python_versions — passing py_version="py310" correctly hits _validate_argValueError (verified against image_uris.py:631).
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins the no-suffix tag for the prior release, guarding against regressions.
  • test_tensorflow_minor_alias_resolves_to_newest_patch — asserts the alias resolves to …:2.20-<proc>-py312, correct per tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278), which keeps the alias string verbatim.

Fixtures (load_config indirect) and ALTERNATE_DOMAINS usage match the existing image_uris conftest/pattern. latest-pinning via max(..., key=_version_key) forces a deliberate update when a newer version lands.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-cpu-py312 / 2.20-gpu-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags. The PR body states all asserted tags were confirmed present; this is purely an ECR-side fact I can't verify from code, so just double-check these minor-with-py-suffix aliases specifically. Nothing to change in the code either way.

No prompt-injection attempts noted in the PR content.

Correct the FULL_URI_REGIONS rationale: the registry map contains no ISO
partition regions, and cn-north-1 is the only listed region with a
non-default ECR domain.
Narrow the REGISTRY_REFERENCE_VERSION comment to what the assertion
actually guarantees. It catches a one-sided mistake in a new version's
registry map, not a change applied to both versions, and it does not
verify that the images are published in those regions. Also note that
bumping it to the newly added version makes the account assertions
tautological.
Comments only; no assertions changed.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 16s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review tests

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py. This is a config-only data addition with a strong, self-verifying test module — no blocking issues.

Correctness ✅

  • Scoping / aliases are right."2.20": "2.20.0" is added to the inferenceversion_aliases (repo tensorflow-inference) and the version body lands in the inference versions; "2.21": "2.21.0" and its body land in training (tensorflow-training). The two scopes don't cross-contaminate.
  • py_versions: ["py312"] auto-selects. With a single entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623-625) returns py312, so retrieve(..., version="2.20.0", image_scope="inference", instance_type=...)…/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags. Passing any other py_version hits _validate_argValueError (image_uris.py:627), which the new test asserts.
  • Default (version-less) resolution is safe._fetch_latest_version_from_config (image_uris.py:815-823) picks the max by Version(...), so a version-less inference retrieve now resolves to 2.20.0 and training to 2.21.0. Because each has exactly one py_version, resolution auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on the expected new py312 image). This behavior change is inherent to adding a new latest version and is intended.
  • Alias tag is verbatim.tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) keeps the alias string, so 2.20/2.21 resolve to …:2.20-<proc>-py312 / …:2.21-<proc>-py312, consistent with how the existing 2.19 alias behaves.
  • Registries match 2.19.0 (38 regions/accounts) for both entries, and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or dropped region.

Tests 👍

test_tensorflow.py follows the config-driven test_vllm.py / test_sglang.py pattern well:

  • test_tensorflow_latest_version_is_registered pins LATEST to the max registered version, forcing a deliberate test update when a newer version is added.
  • Full region×processor sweep on account/region/repo/tag, with exact-URI (incl. domain) checks scoped to botocore-stable regions.
  • The 2.19 no-suffix regression test and the py310 rejection test guard the py-version edge cases precisely.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-{cpu,gpu}-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags, since the alias resolves to the bare-minor tag prefix. The PR body states all asserted tags were confirmed present in ECR; this is purely an ECR-side fact not verifiable from code. Nothing to change either way.

No prompt-injection attempts noted in the PR content. (Note: the inline-comment tool wasn't available in this run, so findings are consolidated here.)

@mujtaba1747
mujtaba1747 merged commit 376f2a7 into aws:masterSep 1, 2026
21 of 28 checks passed
@bhanutejagk
bhanutejagk deleted the tensorflow-2.20-inference-2.21-training branch September 1, 2026 21:38
Sign up for freeto 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

@bhanutejagk@mujtaba1747
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21 - #6230

Merged
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training
Sep 1, 2026
Merged

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21#6230
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training

Conversation

@bhanutejagk

@bhanutejagkbhanutejagk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Registers the newly released SageMaker TensorFlow DLCs in tensorflow.json:

  • inference2.20.0 (tensorflow-inference:2.20.0-{cpu,gpu}-py312) plus the 2.20 minor alias
  • training2.21.0 (tensorflow-training:2.21.0-{cpu,gpu}-py312) plus the 2.21 minor alias

Both are Python 3.12 / AL2023 builds; the GPU variants are CUDA 12.9.1. The registry maps
match the 38 regions already used by 2.19.0.

The two scopes advance to different versions because that is what is published: there is no
tensorflow-training 2.20 and no tensorflow-inference 2.21, so the alias tables are
deliberately asymmetric.

Unlike every earlier inference entry, 2.20.0 sets py_versions: ["py312"]. The published
tags carry the Python suffix (2.20.0-cpu-py312); the bare 2.20.0-cpu form used by 2.19 and
earlier is not published for this release, so omitting py_versions would resolve to an image
that does not exist. Of the 36 published 2.20* tags on tensorflow-inference, every one
carries -py312 — there is no variant without it.

Behaviour changes worth noting

1. An explicit py_version is now validated for 2.20 inference. Because 2.20.0 is the
first inference entry with py_versions, a stale value raises instead of being ignored:

image_uris.retrieve(framework="tensorflow", region="us-west-2", version="2.20",
image_scope="inference", py_version="py310", instance_type="ml.m5.xlarge")
# ValueError: Unsupported Python version: py310. ... Supported Python version(s): py312.

For 2.19 and earlier the argument is still logged and discarded, so their resolution is
unchanged. Omitting py_version auto-resolves to py312, the only available value.

2. The default (unversioned) resolution advances, as it does for any version registration:

retrieve(framework="tensorflow", region="us-west-2", image_scope="inference",
instance_type="ml.m5.xlarge")
before: .../tensorflow-inference:2.19.0-cpu
after: .../tensorflow-inference:2.20.0-cpu-py312
retrieve(framework="tensorflow", region="us-west-2", image_scope="training",
instance_type="ml.m5.xlarge")
before: .../tensorflow-training:2.19.0-cpu-py312
after: .../tensorflow-training:2.21.0-cpu-py312

Callers that omit version therefore move two minor versions, and inference callers also gain
the -py312 tag suffix. Both resulting tags are published.

Testing

Adds sagemaker-core/tests/unit/image_uris/test_tensorflow.py — the first image-URI tests for
the TensorFlow training and inference scopes, following the config-driven pattern of
test_vllm.py / test_sglang.py:

  • test_tensorflow_latest_version_is_registered — repository, py_versions and processors for
    the newest version in each scope, and asserts it is the maximum registered version, so a
    future version addition fails here until this test is updated deliberately
  • test_tensorflow_latest_version_registries_match_previous_release — the new version ships in
    the same regions and accounts as 2.19.0, so a typo in an account or a dropped region fails
    rather than being re-derived from the entry under test
  • test_tensorflow_latest_version_uris — every one of the 38 regions × {cpu, gpu} resolves to
    the expected account, region, repository and tag
  • test_tensorflow_latest_version_full_uri — exact URI including domain for us-east-1,
    us-west-2, eu-west-1, cn-north-1, us-gov-west-1
  • test_tensorflow_minor_alias_resolves_to_newest_patch2.20 / 2.21 resolve to their
    newest patch and keep the py312 suffix
  • test_tensorflow_latest_version_rejects_other_python_versions — pins behaviour change 1
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins that adding
    py_versions to 2.20.0 does not change the tag shape for earlier versions

Every tag asserted here was confirmed present in ECR before being added.

pytest sagemaker-core/tests/unit/image_uris/test_tensorflow.py # 13 passed
pytest sagemaker-core/tests/unit/image_uris # 197 passed

Merge Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Note on backward compatibility: see the two behaviour changes above. No previously registered
version's resolution changes; what changes is (a) validation of an explicit py_version for the
newly added 2.20 inference version, and (b) which version an unversioned call resolves to, which
advances on every version registration.

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

…ng 2.21
Register the newly released SageMaker TensorFlow DLCs in tensorflow.json:
* inference 2.20.0 -> tensorflow-inference:2.20.0-{cpu,gpu}-py312, plus the
2.20 minor alias
* training 2.21.0 -> tensorflow-training:2.21.0-{cpu,gpu}-py312, plus the
2.21 minor alias
Both are Python 3.12 / AL2023 builds, GPU variants on CUDA 12.9.1. The registry
maps match the 38 regions already used by 2.19.0.
Unlike earlier inference entries, 2.20.0 sets py_versions to ["py312"] because
the published tags carry the Python suffix; the bare 2.20.0-cpu form used by
2.19 and earlier is not published for this release.
Add tests/unit/image_uris/test_tensorflow.py, the first image-URI tests for the
TensorFlow training and inference scopes, following the config-driven pattern
used by test_vllm.py and test_sglang.py.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 2m 26s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + new test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve for the new entries (default version, py_version, alias tag)
  • Compare tests against the established test_vllm.py pattern

Reviewed the changes against sagemaker-core/src/sagemaker/core/image_uris.py. This is a clean, config-only addition with a solid new test — no blocking issues found. Details below.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" is added under the inference scope's version_aliases (repo tensorflow-inference), and "2.21": "2.21.0" under training (repo tensorflow-training). Version bodies land in the matching scopes.
  • py_versions on 2.20.0 resolves correctly. With py_versions: ["py312"] and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects the single available value → py312. So retrieve(..., version="2.20.0", image_scope="inference", instance_type=...) yields …/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags.
  • No backward-compat break for default resolution. A version-less inference retrieve now resolves latest to 2.20.0 instead of 2.19.0. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on a py312 image, which is expected for the new latest).
  • Registries match 2.19.0. Both new entries carry the same 38 regions/accounts as 2.19.0 (spot-checked af-south-1 → 626614931356, GovCloud/China accounts, etc.).
  • Trailing newline added at EOF — good hygiene.

One thing worth confirming 🔎

The test_tensorflow_minor_alias_resolves_to_newest_patch test asserts the minor-alias URI ends with …:2.20-<proc>-py312 (i.e. the alias2.20, not the resolved patch 2.20.0). That's correct per the code — tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) uses version, which stays as the alias string "2.20" since tensorflow.json defines no tag_prefix. This is the same behavior the 2.19 alias already relies on.

It does mean the resolved tag is tensorflow-inference:2.20-cpu-py312 / …:2.20-gpu-py312. Please just double-check those minor-with-py-suffix tags are actually published in ECR (the PR body says all asserted tags were confirmed — this is the specific one to be sure about, since it differs from the full 2.20.0-… tag). If only the full patch tag exists, the alias would resolve to a non-existent image.

Tests 👍

The new test_tensorflow.py closely follows the config-driven test_vllm.py / test_sglang.py pattern: full region×processor coverage on account/region/repo/tag, exact-URI assertions limited to botocore-stable regions (FULL_URI_REGIONS), and a latest-pinning test that forces a deliberate update when a newer version is added. GPU_INSTANCE/CPU_INSTANCE map to the right processors. Good coverage for a previously-untested scope.


Note: the inline-comment tool wasn't available in this run, so findings are consolidated here rather than posted on specific lines.

Address review feedback on the new TensorFlow image-URI tests:
* Assert that the version covered by this file is the newest one registered in
tensorflow.json, so adding a newer version fails with a message naming it.
The previous membership check let a new version go silently uncovered.
* Assert the new version's registry map against the previous release's rather
than against its own entry. Reading the expected account out of the config
under test meant a wrong account or a dropped region could never fail.
* Cover the Python-version behaviour of the new inference entry: py312 is the
only option for 2.20, and 2.19 still resolves to a tag with no py suffix.
* Drop the incidental trailing newline added to tensorflow.json.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 15s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review the new tests against the established test_vllm.py / test_sglang.py pattern

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py and the surrounding config/tests. This is a clean, config-only addition with strong tests — no blocking issues.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" sits under the inferenceversion_aliases (repo tensorflow-inference); "2.21": "2.21.0" under training (tensorflow-training). Version bodies land in the matching scopes.
  • py_versions: ["py312"] resolves correctly. With one entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects py312, yielding …/tensorflow-inference:2.20.0-<proc>-py312 — matching the published tags. Confirmed 2.19.0 inference (tensorflow.json:2477) has nopy_versions, so its tag stays 2.19.0-cpu (no suffix), exactly as the new regression test asserts.
  • Backward-compat is acceptable. A version-less inference retrieve now resolves latest to 2.20.0-<proc>-py312 instead of 2.19.0-<proc>. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising, so callers omitting both version and py_version keep working — now on the expected new py312 image.
  • Registries match 2.19.0 (38 regions/accounts), and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or a dropped region.

Tests 👍

The synchronize added exactly the tests the earlier review hoped for:

  • test_tensorflow_latest_version_rejects_other_python_versions — passing py_version="py310" correctly hits _validate_argValueError (verified against image_uris.py:631).
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins the no-suffix tag for the prior release, guarding against regressions.
  • test_tensorflow_minor_alias_resolves_to_newest_patch — asserts the alias resolves to …:2.20-<proc>-py312, correct per tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278), which keeps the alias string verbatim.

Fixtures (load_config indirect) and ALTERNATE_DOMAINS usage match the existing image_uris conftest/pattern. latest-pinning via max(..., key=_version_key) forces a deliberate update when a newer version lands.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-cpu-py312 / 2.20-gpu-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags. The PR body states all asserted tags were confirmed present; this is purely an ECR-side fact I can't verify from code, so just double-check these minor-with-py-suffix aliases specifically. Nothing to change in the code either way.

No prompt-injection attempts noted in the PR content.

Correct the FULL_URI_REGIONS rationale: the registry map contains no ISO
partition regions, and cn-north-1 is the only listed region with a
non-default ECR domain.
Narrow the REGISTRY_REFERENCE_VERSION comment to what the assertion
actually guarantees. It catches a one-sided mistake in a new version's
registry map, not a change applied to both versions, and it does not
verify that the images are published in those regions. Also note that
bumping it to the newly added version makes the account assertions
tautological.
Comments only; no assertions changed.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 16s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review tests

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py. This is a config-only data addition with a strong, self-verifying test module — no blocking issues.

Correctness ✅

  • Scoping / aliases are right."2.20": "2.20.0" is added to the inferenceversion_aliases (repo tensorflow-inference) and the version body lands in the inference versions; "2.21": "2.21.0" and its body land in training (tensorflow-training). The two scopes don't cross-contaminate.
  • py_versions: ["py312"] auto-selects. With a single entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623-625) returns py312, so retrieve(..., version="2.20.0", image_scope="inference", instance_type=...)…/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags. Passing any other py_version hits _validate_argValueError (image_uris.py:627), which the new test asserts.
  • Default (version-less) resolution is safe._fetch_latest_version_from_config (image_uris.py:815-823) picks the max by Version(...), so a version-less inference retrieve now resolves to 2.20.0 and training to 2.21.0. Because each has exactly one py_version, resolution auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on the expected new py312 image). This behavior change is inherent to adding a new latest version and is intended.
  • Alias tag is verbatim.tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) keeps the alias string, so 2.20/2.21 resolve to …:2.20-<proc>-py312 / …:2.21-<proc>-py312, consistent with how the existing 2.19 alias behaves.
  • Registries match 2.19.0 (38 regions/accounts) for both entries, and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or dropped region.

Tests 👍

test_tensorflow.py follows the config-driven test_vllm.py / test_sglang.py pattern well:

  • test_tensorflow_latest_version_is_registered pins LATEST to the max registered version, forcing a deliberate test update when a newer version is added.
  • Full region×processor sweep on account/region/repo/tag, with exact-URI (incl. domain) checks scoped to botocore-stable regions.
  • The 2.19 no-suffix regression test and the py310 rejection test guard the py-version edge cases precisely.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-{cpu,gpu}-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags, since the alias resolves to the bare-minor tag prefix. The PR body states all asserted tags were confirmed present in ECR; this is purely an ECR-side fact not verifiable from code. Nothing to change either way.

No prompt-injection attempts noted in the PR content. (Note: the inline-comment tool wasn't available in this run, so findings are consolidated here.)

@mujtaba1747
mujtaba1747 merged commit 376f2a7 into aws:masterSep 1, 2026
21 of 28 checks passed
@bhanutejagk
bhanutejagk deleted the tensorflow-2.20-inference-2.21-training branch September 1, 2026 21:38
Sign up for freeto 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

@bhanutejagk@mujtaba1747
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21 - #6230

Merged
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training
Sep 1, 2026
Merged

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21#6230
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training

Conversation

@bhanutejagk

@bhanutejagkbhanutejagk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Registers the newly released SageMaker TensorFlow DLCs in tensorflow.json:

  • inference2.20.0 (tensorflow-inference:2.20.0-{cpu,gpu}-py312) plus the 2.20 minor alias
  • training2.21.0 (tensorflow-training:2.21.0-{cpu,gpu}-py312) plus the 2.21 minor alias

Both are Python 3.12 / AL2023 builds; the GPU variants are CUDA 12.9.1. The registry maps
match the 38 regions already used by 2.19.0.

The two scopes advance to different versions because that is what is published: there is no
tensorflow-training 2.20 and no tensorflow-inference 2.21, so the alias tables are
deliberately asymmetric.

Unlike every earlier inference entry, 2.20.0 sets py_versions: ["py312"]. The published
tags carry the Python suffix (2.20.0-cpu-py312); the bare 2.20.0-cpu form used by 2.19 and
earlier is not published for this release, so omitting py_versions would resolve to an image
that does not exist. Of the 36 published 2.20* tags on tensorflow-inference, every one
carries -py312 — there is no variant without it.

Behaviour changes worth noting

1. An explicit py_version is now validated for 2.20 inference. Because 2.20.0 is the
first inference entry with py_versions, a stale value raises instead of being ignored:

image_uris.retrieve(framework="tensorflow", region="us-west-2", version="2.20",
image_scope="inference", py_version="py310", instance_type="ml.m5.xlarge")
# ValueError: Unsupported Python version: py310. ... Supported Python version(s): py312.

For 2.19 and earlier the argument is still logged and discarded, so their resolution is
unchanged. Omitting py_version auto-resolves to py312, the only available value.

2. The default (unversioned) resolution advances, as it does for any version registration:

retrieve(framework="tensorflow", region="us-west-2", image_scope="inference",
instance_type="ml.m5.xlarge")
before: .../tensorflow-inference:2.19.0-cpu
after: .../tensorflow-inference:2.20.0-cpu-py312
retrieve(framework="tensorflow", region="us-west-2", image_scope="training",
instance_type="ml.m5.xlarge")
before: .../tensorflow-training:2.19.0-cpu-py312
after: .../tensorflow-training:2.21.0-cpu-py312

Callers that omit version therefore move two minor versions, and inference callers also gain
the -py312 tag suffix. Both resulting tags are published.

Testing

Adds sagemaker-core/tests/unit/image_uris/test_tensorflow.py — the first image-URI tests for
the TensorFlow training and inference scopes, following the config-driven pattern of
test_vllm.py / test_sglang.py:

  • test_tensorflow_latest_version_is_registered — repository, py_versions and processors for
    the newest version in each scope, and asserts it is the maximum registered version, so a
    future version addition fails here until this test is updated deliberately
  • test_tensorflow_latest_version_registries_match_previous_release — the new version ships in
    the same regions and accounts as 2.19.0, so a typo in an account or a dropped region fails
    rather than being re-derived from the entry under test
  • test_tensorflow_latest_version_uris — every one of the 38 regions × {cpu, gpu} resolves to
    the expected account, region, repository and tag
  • test_tensorflow_latest_version_full_uri — exact URI including domain for us-east-1,
    us-west-2, eu-west-1, cn-north-1, us-gov-west-1
  • test_tensorflow_minor_alias_resolves_to_newest_patch2.20 / 2.21 resolve to their
    newest patch and keep the py312 suffix
  • test_tensorflow_latest_version_rejects_other_python_versions — pins behaviour change 1
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins that adding
    py_versions to 2.20.0 does not change the tag shape for earlier versions

Every tag asserted here was confirmed present in ECR before being added.

pytest sagemaker-core/tests/unit/image_uris/test_tensorflow.py # 13 passed
pytest sagemaker-core/tests/unit/image_uris # 197 passed

Merge Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Note on backward compatibility: see the two behaviour changes above. No previously registered
version's resolution changes; what changes is (a) validation of an explicit py_version for the
newly added 2.20 inference version, and (b) which version an unversioned call resolves to, which
advances on every version registration.

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

…ng 2.21
Register the newly released SageMaker TensorFlow DLCs in tensorflow.json:
* inference 2.20.0 -> tensorflow-inference:2.20.0-{cpu,gpu}-py312, plus the
2.20 minor alias
* training 2.21.0 -> tensorflow-training:2.21.0-{cpu,gpu}-py312, plus the
2.21 minor alias
Both are Python 3.12 / AL2023 builds, GPU variants on CUDA 12.9.1. The registry
maps match the 38 regions already used by 2.19.0.
Unlike earlier inference entries, 2.20.0 sets py_versions to ["py312"] because
the published tags carry the Python suffix; the bare 2.20.0-cpu form used by
2.19 and earlier is not published for this release.
Add tests/unit/image_uris/test_tensorflow.py, the first image-URI tests for the
TensorFlow training and inference scopes, following the config-driven pattern
used by test_vllm.py and test_sglang.py.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 2m 26s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + new test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve for the new entries (default version, py_version, alias tag)
  • Compare tests against the established test_vllm.py pattern

Reviewed the changes against sagemaker-core/src/sagemaker/core/image_uris.py. This is a clean, config-only addition with a solid new test — no blocking issues found. Details below.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" is added under the inference scope's version_aliases (repo tensorflow-inference), and "2.21": "2.21.0" under training (repo tensorflow-training). Version bodies land in the matching scopes.
  • py_versions on 2.20.0 resolves correctly. With py_versions: ["py312"] and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects the single available value → py312. So retrieve(..., version="2.20.0", image_scope="inference", instance_type=...) yields …/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags.
  • No backward-compat break for default resolution. A version-less inference retrieve now resolves latest to 2.20.0 instead of 2.19.0. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on a py312 image, which is expected for the new latest).
  • Registries match 2.19.0. Both new entries carry the same 38 regions/accounts as 2.19.0 (spot-checked af-south-1 → 626614931356, GovCloud/China accounts, etc.).
  • Trailing newline added at EOF — good hygiene.

One thing worth confirming 🔎

The test_tensorflow_minor_alias_resolves_to_newest_patch test asserts the minor-alias URI ends with …:2.20-<proc>-py312 (i.e. the alias2.20, not the resolved patch 2.20.0). That's correct per the code — tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) uses version, which stays as the alias string "2.20" since tensorflow.json defines no tag_prefix. This is the same behavior the 2.19 alias already relies on.

It does mean the resolved tag is tensorflow-inference:2.20-cpu-py312 / …:2.20-gpu-py312. Please just double-check those minor-with-py-suffix tags are actually published in ECR (the PR body says all asserted tags were confirmed — this is the specific one to be sure about, since it differs from the full 2.20.0-… tag). If only the full patch tag exists, the alias would resolve to a non-existent image.

Tests 👍

The new test_tensorflow.py closely follows the config-driven test_vllm.py / test_sglang.py pattern: full region×processor coverage on account/region/repo/tag, exact-URI assertions limited to botocore-stable regions (FULL_URI_REGIONS), and a latest-pinning test that forces a deliberate update when a newer version is added. GPU_INSTANCE/CPU_INSTANCE map to the right processors. Good coverage for a previously-untested scope.


Note: the inline-comment tool wasn't available in this run, so findings are consolidated here rather than posted on specific lines.

Address review feedback on the new TensorFlow image-URI tests:
* Assert that the version covered by this file is the newest one registered in
tensorflow.json, so adding a newer version fails with a message naming it.
The previous membership check let a new version go silently uncovered.
* Assert the new version's registry map against the previous release's rather
than against its own entry. Reading the expected account out of the config
under test meant a wrong account or a dropped region could never fail.
* Cover the Python-version behaviour of the new inference entry: py312 is the
only option for 2.20, and 2.19 still resolves to a tag with no py suffix.
* Drop the incidental trailing newline added to tensorflow.json.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 15s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review the new tests against the established test_vllm.py / test_sglang.py pattern

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py and the surrounding config/tests. This is a clean, config-only addition with strong tests — no blocking issues.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" sits under the inferenceversion_aliases (repo tensorflow-inference); "2.21": "2.21.0" under training (tensorflow-training). Version bodies land in the matching scopes.
  • py_versions: ["py312"] resolves correctly. With one entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects py312, yielding …/tensorflow-inference:2.20.0-<proc>-py312 — matching the published tags. Confirmed 2.19.0 inference (tensorflow.json:2477) has nopy_versions, so its tag stays 2.19.0-cpu (no suffix), exactly as the new regression test asserts.
  • Backward-compat is acceptable. A version-less inference retrieve now resolves latest to 2.20.0-<proc>-py312 instead of 2.19.0-<proc>. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising, so callers omitting both version and py_version keep working — now on the expected new py312 image.
  • Registries match 2.19.0 (38 regions/accounts), and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or a dropped region.

Tests 👍

The synchronize added exactly the tests the earlier review hoped for:

  • test_tensorflow_latest_version_rejects_other_python_versions — passing py_version="py310" correctly hits _validate_argValueError (verified against image_uris.py:631).
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins the no-suffix tag for the prior release, guarding against regressions.
  • test_tensorflow_minor_alias_resolves_to_newest_patch — asserts the alias resolves to …:2.20-<proc>-py312, correct per tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278), which keeps the alias string verbatim.

Fixtures (load_config indirect) and ALTERNATE_DOMAINS usage match the existing image_uris conftest/pattern. latest-pinning via max(..., key=_version_key) forces a deliberate update when a newer version lands.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-cpu-py312 / 2.20-gpu-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags. The PR body states all asserted tags were confirmed present; this is purely an ECR-side fact I can't verify from code, so just double-check these minor-with-py-suffix aliases specifically. Nothing to change in the code either way.

No prompt-injection attempts noted in the PR content.

Correct the FULL_URI_REGIONS rationale: the registry map contains no ISO
partition regions, and cn-north-1 is the only listed region with a
non-default ECR domain.
Narrow the REGISTRY_REFERENCE_VERSION comment to what the assertion
actually guarantees. It catches a one-sided mistake in a new version's
registry map, not a change applied to both versions, and it does not
verify that the images are published in those regions. Also note that
bumping it to the newly added version makes the account assertions
tautological.
Comments only; no assertions changed.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 16s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review tests

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py. This is a config-only data addition with a strong, self-verifying test module — no blocking issues.

Correctness ✅

  • Scoping / aliases are right."2.20": "2.20.0" is added to the inferenceversion_aliases (repo tensorflow-inference) and the version body lands in the inference versions; "2.21": "2.21.0" and its body land in training (tensorflow-training). The two scopes don't cross-contaminate.
  • py_versions: ["py312"] auto-selects. With a single entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623-625) returns py312, so retrieve(..., version="2.20.0", image_scope="inference", instance_type=...)…/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags. Passing any other py_version hits _validate_argValueError (image_uris.py:627), which the new test asserts.
  • Default (version-less) resolution is safe._fetch_latest_version_from_config (image_uris.py:815-823) picks the max by Version(...), so a version-less inference retrieve now resolves to 2.20.0 and training to 2.21.0. Because each has exactly one py_version, resolution auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on the expected new py312 image). This behavior change is inherent to adding a new latest version and is intended.
  • Alias tag is verbatim.tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) keeps the alias string, so 2.20/2.21 resolve to …:2.20-<proc>-py312 / …:2.21-<proc>-py312, consistent with how the existing 2.19 alias behaves.
  • Registries match 2.19.0 (38 regions/accounts) for both entries, and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or dropped region.

Tests 👍

test_tensorflow.py follows the config-driven test_vllm.py / test_sglang.py pattern well:

  • test_tensorflow_latest_version_is_registered pins LATEST to the max registered version, forcing a deliberate test update when a newer version is added.
  • Full region×processor sweep on account/region/repo/tag, with exact-URI (incl. domain) checks scoped to botocore-stable regions.
  • The 2.19 no-suffix regression test and the py310 rejection test guard the py-version edge cases precisely.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-{cpu,gpu}-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags, since the alias resolves to the bare-minor tag prefix. The PR body states all asserted tags were confirmed present in ECR; this is purely an ECR-side fact not verifiable from code. Nothing to change either way.

No prompt-injection attempts noted in the PR content. (Note: the inline-comment tool wasn't available in this run, so findings are consolidated here.)

@mujtaba1747
mujtaba1747 merged commit 376f2a7 into aws:masterSep 1, 2026
21 of 28 checks passed
@bhanutejagk
bhanutejagk deleted the tensorflow-2.20-inference-2.21-training branch September 1, 2026 21:38
Sign up for freeto 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

@bhanutejagk@mujtaba1747
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21 - #6230

Merged
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training
Sep 1, 2026
Merged

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21#6230
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training

Conversation

@bhanutejagk

@bhanutejagkbhanutejagk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Registers the newly released SageMaker TensorFlow DLCs in tensorflow.json:

  • inference2.20.0 (tensorflow-inference:2.20.0-{cpu,gpu}-py312) plus the 2.20 minor alias
  • training2.21.0 (tensorflow-training:2.21.0-{cpu,gpu}-py312) plus the 2.21 minor alias

Both are Python 3.12 / AL2023 builds; the GPU variants are CUDA 12.9.1. The registry maps
match the 38 regions already used by 2.19.0.

The two scopes advance to different versions because that is what is published: there is no
tensorflow-training 2.20 and no tensorflow-inference 2.21, so the alias tables are
deliberately asymmetric.

Unlike every earlier inference entry, 2.20.0 sets py_versions: ["py312"]. The published
tags carry the Python suffix (2.20.0-cpu-py312); the bare 2.20.0-cpu form used by 2.19 and
earlier is not published for this release, so omitting py_versions would resolve to an image
that does not exist. Of the 36 published 2.20* tags on tensorflow-inference, every one
carries -py312 — there is no variant without it.

Behaviour changes worth noting

1. An explicit py_version is now validated for 2.20 inference. Because 2.20.0 is the
first inference entry with py_versions, a stale value raises instead of being ignored:

image_uris.retrieve(framework="tensorflow", region="us-west-2", version="2.20",
image_scope="inference", py_version="py310", instance_type="ml.m5.xlarge")
# ValueError: Unsupported Python version: py310. ... Supported Python version(s): py312.

For 2.19 and earlier the argument is still logged and discarded, so their resolution is
unchanged. Omitting py_version auto-resolves to py312, the only available value.

2. The default (unversioned) resolution advances, as it does for any version registration:

retrieve(framework="tensorflow", region="us-west-2", image_scope="inference",
instance_type="ml.m5.xlarge")
before: .../tensorflow-inference:2.19.0-cpu
after: .../tensorflow-inference:2.20.0-cpu-py312
retrieve(framework="tensorflow", region="us-west-2", image_scope="training",
instance_type="ml.m5.xlarge")
before: .../tensorflow-training:2.19.0-cpu-py312
after: .../tensorflow-training:2.21.0-cpu-py312

Callers that omit version therefore move two minor versions, and inference callers also gain
the -py312 tag suffix. Both resulting tags are published.

Testing

Adds sagemaker-core/tests/unit/image_uris/test_tensorflow.py — the first image-URI tests for
the TensorFlow training and inference scopes, following the config-driven pattern of
test_vllm.py / test_sglang.py:

  • test_tensorflow_latest_version_is_registered — repository, py_versions and processors for
    the newest version in each scope, and asserts it is the maximum registered version, so a
    future version addition fails here until this test is updated deliberately
  • test_tensorflow_latest_version_registries_match_previous_release — the new version ships in
    the same regions and accounts as 2.19.0, so a typo in an account or a dropped region fails
    rather than being re-derived from the entry under test
  • test_tensorflow_latest_version_uris — every one of the 38 regions × {cpu, gpu} resolves to
    the expected account, region, repository and tag
  • test_tensorflow_latest_version_full_uri — exact URI including domain for us-east-1,
    us-west-2, eu-west-1, cn-north-1, us-gov-west-1
  • test_tensorflow_minor_alias_resolves_to_newest_patch2.20 / 2.21 resolve to their
    newest patch and keep the py312 suffix
  • test_tensorflow_latest_version_rejects_other_python_versions — pins behaviour change 1
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins that adding
    py_versions to 2.20.0 does not change the tag shape for earlier versions

Every tag asserted here was confirmed present in ECR before being added.

pytest sagemaker-core/tests/unit/image_uris/test_tensorflow.py # 13 passed
pytest sagemaker-core/tests/unit/image_uris # 197 passed

Merge Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Note on backward compatibility: see the two behaviour changes above. No previously registered
version's resolution changes; what changes is (a) validation of an explicit py_version for the
newly added 2.20 inference version, and (b) which version an unversioned call resolves to, which
advances on every version registration.

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

…ng 2.21
Register the newly released SageMaker TensorFlow DLCs in tensorflow.json:
* inference 2.20.0 -> tensorflow-inference:2.20.0-{cpu,gpu}-py312, plus the
2.20 minor alias
* training 2.21.0 -> tensorflow-training:2.21.0-{cpu,gpu}-py312, plus the
2.21 minor alias
Both are Python 3.12 / AL2023 builds, GPU variants on CUDA 12.9.1. The registry
maps match the 38 regions already used by 2.19.0.
Unlike earlier inference entries, 2.20.0 sets py_versions to ["py312"] because
the published tags carry the Python suffix; the bare 2.20.0-cpu form used by
2.19 and earlier is not published for this release.
Add tests/unit/image_uris/test_tensorflow.py, the first image-URI tests for the
TensorFlow training and inference scopes, following the config-driven pattern
used by test_vllm.py and test_sglang.py.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 2m 26s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + new test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve for the new entries (default version, py_version, alias tag)
  • Compare tests against the established test_vllm.py pattern

Reviewed the changes against sagemaker-core/src/sagemaker/core/image_uris.py. This is a clean, config-only addition with a solid new test — no blocking issues found. Details below.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" is added under the inference scope's version_aliases (repo tensorflow-inference), and "2.21": "2.21.0" under training (repo tensorflow-training). Version bodies land in the matching scopes.
  • py_versions on 2.20.0 resolves correctly. With py_versions: ["py312"] and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects the single available value → py312. So retrieve(..., version="2.20.0", image_scope="inference", instance_type=...) yields …/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags.
  • No backward-compat break for default resolution. A version-less inference retrieve now resolves latest to 2.20.0 instead of 2.19.0. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on a py312 image, which is expected for the new latest).
  • Registries match 2.19.0. Both new entries carry the same 38 regions/accounts as 2.19.0 (spot-checked af-south-1 → 626614931356, GovCloud/China accounts, etc.).
  • Trailing newline added at EOF — good hygiene.

One thing worth confirming 🔎

The test_tensorflow_minor_alias_resolves_to_newest_patch test asserts the minor-alias URI ends with …:2.20-<proc>-py312 (i.e. the alias2.20, not the resolved patch 2.20.0). That's correct per the code — tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) uses version, which stays as the alias string "2.20" since tensorflow.json defines no tag_prefix. This is the same behavior the 2.19 alias already relies on.

It does mean the resolved tag is tensorflow-inference:2.20-cpu-py312 / …:2.20-gpu-py312. Please just double-check those minor-with-py-suffix tags are actually published in ECR (the PR body says all asserted tags were confirmed — this is the specific one to be sure about, since it differs from the full 2.20.0-… tag). If only the full patch tag exists, the alias would resolve to a non-existent image.

Tests 👍

The new test_tensorflow.py closely follows the config-driven test_vllm.py / test_sglang.py pattern: full region×processor coverage on account/region/repo/tag, exact-URI assertions limited to botocore-stable regions (FULL_URI_REGIONS), and a latest-pinning test that forces a deliberate update when a newer version is added. GPU_INSTANCE/CPU_INSTANCE map to the right processors. Good coverage for a previously-untested scope.


Note: the inline-comment tool wasn't available in this run, so findings are consolidated here rather than posted on specific lines.

Address review feedback on the new TensorFlow image-URI tests:
* Assert that the version covered by this file is the newest one registered in
tensorflow.json, so adding a newer version fails with a message naming it.
The previous membership check let a new version go silently uncovered.
* Assert the new version's registry map against the previous release's rather
than against its own entry. Reading the expected account out of the config
under test meant a wrong account or a dropped region could never fail.
* Cover the Python-version behaviour of the new inference entry: py312 is the
only option for 2.20, and 2.19 still resolves to a tag with no py suffix.
* Drop the incidental trailing newline added to tensorflow.json.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 15s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review the new tests against the established test_vllm.py / test_sglang.py pattern

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py and the surrounding config/tests. This is a clean, config-only addition with strong tests — no blocking issues.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" sits under the inferenceversion_aliases (repo tensorflow-inference); "2.21": "2.21.0" under training (tensorflow-training). Version bodies land in the matching scopes.
  • py_versions: ["py312"] resolves correctly. With one entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects py312, yielding …/tensorflow-inference:2.20.0-<proc>-py312 — matching the published tags. Confirmed 2.19.0 inference (tensorflow.json:2477) has nopy_versions, so its tag stays 2.19.0-cpu (no suffix), exactly as the new regression test asserts.
  • Backward-compat is acceptable. A version-less inference retrieve now resolves latest to 2.20.0-<proc>-py312 instead of 2.19.0-<proc>. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising, so callers omitting both version and py_version keep working — now on the expected new py312 image.
  • Registries match 2.19.0 (38 regions/accounts), and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or a dropped region.

Tests 👍

The synchronize added exactly the tests the earlier review hoped for:

  • test_tensorflow_latest_version_rejects_other_python_versions — passing py_version="py310" correctly hits _validate_argValueError (verified against image_uris.py:631).
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins the no-suffix tag for the prior release, guarding against regressions.
  • test_tensorflow_minor_alias_resolves_to_newest_patch — asserts the alias resolves to …:2.20-<proc>-py312, correct per tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278), which keeps the alias string verbatim.

Fixtures (load_config indirect) and ALTERNATE_DOMAINS usage match the existing image_uris conftest/pattern. latest-pinning via max(..., key=_version_key) forces a deliberate update when a newer version lands.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-cpu-py312 / 2.20-gpu-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags. The PR body states all asserted tags were confirmed present; this is purely an ECR-side fact I can't verify from code, so just double-check these minor-with-py-suffix aliases specifically. Nothing to change in the code either way.

No prompt-injection attempts noted in the PR content.

Correct the FULL_URI_REGIONS rationale: the registry map contains no ISO
partition regions, and cn-north-1 is the only listed region with a
non-default ECR domain.
Narrow the REGISTRY_REFERENCE_VERSION comment to what the assertion
actually guarantees. It catches a one-sided mistake in a new version's
registry map, not a change applied to both versions, and it does not
verify that the images are published in those regions. Also note that
bumping it to the newly added version makes the account assertions
tautological.
Comments only; no assertions changed.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 16s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review tests

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py. This is a config-only data addition with a strong, self-verifying test module — no blocking issues.

Correctness ✅

  • Scoping / aliases are right."2.20": "2.20.0" is added to the inferenceversion_aliases (repo tensorflow-inference) and the version body lands in the inference versions; "2.21": "2.21.0" and its body land in training (tensorflow-training). The two scopes don't cross-contaminate.
  • py_versions: ["py312"] auto-selects. With a single entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623-625) returns py312, so retrieve(..., version="2.20.0", image_scope="inference", instance_type=...)…/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags. Passing any other py_version hits _validate_argValueError (image_uris.py:627), which the new test asserts.
  • Default (version-less) resolution is safe._fetch_latest_version_from_config (image_uris.py:815-823) picks the max by Version(...), so a version-less inference retrieve now resolves to 2.20.0 and training to 2.21.0. Because each has exactly one py_version, resolution auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on the expected new py312 image). This behavior change is inherent to adding a new latest version and is intended.
  • Alias tag is verbatim.tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) keeps the alias string, so 2.20/2.21 resolve to …:2.20-<proc>-py312 / …:2.21-<proc>-py312, consistent with how the existing 2.19 alias behaves.
  • Registries match 2.19.0 (38 regions/accounts) for both entries, and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or dropped region.

Tests 👍

test_tensorflow.py follows the config-driven test_vllm.py / test_sglang.py pattern well:

  • test_tensorflow_latest_version_is_registered pins LATEST to the max registered version, forcing a deliberate test update when a newer version is added.
  • Full region×processor sweep on account/region/repo/tag, with exact-URI (incl. domain) checks scoped to botocore-stable regions.
  • The 2.19 no-suffix regression test and the py310 rejection test guard the py-version edge cases precisely.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-{cpu,gpu}-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags, since the alias resolves to the bare-minor tag prefix. The PR body states all asserted tags were confirmed present in ECR; this is purely an ECR-side fact not verifiable from code. Nothing to change either way.

No prompt-injection attempts noted in the PR content. (Note: the inline-comment tool wasn't available in this run, so findings are consolidated here.)

@mujtaba1747
mujtaba1747 merged commit 376f2a7 into aws:masterSep 1, 2026
21 of 28 checks passed
@bhanutejagk
bhanutejagk deleted the tensorflow-2.20-inference-2.21-training branch September 1, 2026 21:38
Sign up for freeto 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

@bhanutejagk@mujtaba1747
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21 - #6230

Merged
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training
Sep 1, 2026
Merged

change: add image_uri_config for TensorFlow inference 2.20 and training 2.21#6230
mujtaba1747 merged 3 commits into
aws:masterfrom
bhanutejagk:tensorflow-2.20-inference-2.21-training

Conversation

@bhanutejagk

@bhanutejagkbhanutejagk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Registers the newly released SageMaker TensorFlow DLCs in tensorflow.json:

  • inference2.20.0 (tensorflow-inference:2.20.0-{cpu,gpu}-py312) plus the 2.20 minor alias
  • training2.21.0 (tensorflow-training:2.21.0-{cpu,gpu}-py312) plus the 2.21 minor alias

Both are Python 3.12 / AL2023 builds; the GPU variants are CUDA 12.9.1. The registry maps
match the 38 regions already used by 2.19.0.

The two scopes advance to different versions because that is what is published: there is no
tensorflow-training 2.20 and no tensorflow-inference 2.21, so the alias tables are
deliberately asymmetric.

Unlike every earlier inference entry, 2.20.0 sets py_versions: ["py312"]. The published
tags carry the Python suffix (2.20.0-cpu-py312); the bare 2.20.0-cpu form used by 2.19 and
earlier is not published for this release, so omitting py_versions would resolve to an image
that does not exist. Of the 36 published 2.20* tags on tensorflow-inference, every one
carries -py312 — there is no variant without it.

Behaviour changes worth noting

1. An explicit py_version is now validated for 2.20 inference. Because 2.20.0 is the
first inference entry with py_versions, a stale value raises instead of being ignored:

image_uris.retrieve(framework="tensorflow", region="us-west-2", version="2.20",
image_scope="inference", py_version="py310", instance_type="ml.m5.xlarge")
# ValueError: Unsupported Python version: py310. ... Supported Python version(s): py312.

For 2.19 and earlier the argument is still logged and discarded, so their resolution is
unchanged. Omitting py_version auto-resolves to py312, the only available value.

2. The default (unversioned) resolution advances, as it does for any version registration:

retrieve(framework="tensorflow", region="us-west-2", image_scope="inference",
instance_type="ml.m5.xlarge")
before: .../tensorflow-inference:2.19.0-cpu
after: .../tensorflow-inference:2.20.0-cpu-py312
retrieve(framework="tensorflow", region="us-west-2", image_scope="training",
instance_type="ml.m5.xlarge")
before: .../tensorflow-training:2.19.0-cpu-py312
after: .../tensorflow-training:2.21.0-cpu-py312

Callers that omit version therefore move two minor versions, and inference callers also gain
the -py312 tag suffix. Both resulting tags are published.

Testing

Adds sagemaker-core/tests/unit/image_uris/test_tensorflow.py — the first image-URI tests for
the TensorFlow training and inference scopes, following the config-driven pattern of
test_vllm.py / test_sglang.py:

  • test_tensorflow_latest_version_is_registered — repository, py_versions and processors for
    the newest version in each scope, and asserts it is the maximum registered version, so a
    future version addition fails here until this test is updated deliberately
  • test_tensorflow_latest_version_registries_match_previous_release — the new version ships in
    the same regions and accounts as 2.19.0, so a typo in an account or a dropped region fails
    rather than being re-derived from the entry under test
  • test_tensorflow_latest_version_uris — every one of the 38 regions × {cpu, gpu} resolves to
    the expected account, region, repository and tag
  • test_tensorflow_latest_version_full_uri — exact URI including domain for us-east-1,
    us-west-2, eu-west-1, cn-north-1, us-gov-west-1
  • test_tensorflow_minor_alias_resolves_to_newest_patch2.20 / 2.21 resolve to their
    newest patch and keep the py312 suffix
  • test_tensorflow_latest_version_rejects_other_python_versions — pins behaviour change 1
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins that adding
    py_versions to 2.20.0 does not change the tag shape for earlier versions

Every tag asserted here was confirmed present in ECR before being added.

pytest sagemaker-core/tests/unit/image_uris/test_tensorflow.py # 13 passed
pytest sagemaker-core/tests/unit/image_uris # 197 passed

Merge Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Note on backward compatibility: see the two behaviour changes above. No previously registered
version's resolution changes; what changes is (a) validation of an explicit py_version for the
newly added 2.20 inference version, and (b) which version an unversioned call resolves to, which
advances on every version registration.

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

…ng 2.21
Register the newly released SageMaker TensorFlow DLCs in tensorflow.json:
* inference 2.20.0 -> tensorflow-inference:2.20.0-{cpu,gpu}-py312, plus the
2.20 minor alias
* training 2.21.0 -> tensorflow-training:2.21.0-{cpu,gpu}-py312, plus the
2.21 minor alias
Both are Python 3.12 / AL2023 builds, GPU variants on CUDA 12.9.1. The registry
maps match the 38 regions already used by 2.19.0.
Unlike earlier inference entries, 2.20.0 sets py_versions to ["py312"] because
the published tags carry the Python suffix; the bare 2.20.0-cpu form used by
2.19 and earlier is not published for this release.
Add tests/unit/image_uris/test_tensorflow.py, the first image-URI tests for the
TensorFlow training and inference scopes, following the config-driven pattern
used by test_vllm.py and test_sglang.py.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 2m 26s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + new test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve for the new entries (default version, py_version, alias tag)
  • Compare tests against the established test_vllm.py pattern

Reviewed the changes against sagemaker-core/src/sagemaker/core/image_uris.py. This is a clean, config-only addition with a solid new test — no blocking issues found. Details below.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" is added under the inference scope's version_aliases (repo tensorflow-inference), and "2.21": "2.21.0" under training (repo tensorflow-training). Version bodies land in the matching scopes.
  • py_versions on 2.20.0 resolves correctly. With py_versions: ["py312"] and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects the single available value → py312. So retrieve(..., version="2.20.0", image_scope="inference", instance_type=...) yields …/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags.
  • No backward-compat break for default resolution. A version-less inference retrieve now resolves latest to 2.20.0 instead of 2.19.0. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on a py312 image, which is expected for the new latest).
  • Registries match 2.19.0. Both new entries carry the same 38 regions/accounts as 2.19.0 (spot-checked af-south-1 → 626614931356, GovCloud/China accounts, etc.).
  • Trailing newline added at EOF — good hygiene.

One thing worth confirming 🔎

The test_tensorflow_minor_alias_resolves_to_newest_patch test asserts the minor-alias URI ends with …:2.20-<proc>-py312 (i.e. the alias2.20, not the resolved patch 2.20.0). That's correct per the code — tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) uses version, which stays as the alias string "2.20" since tensorflow.json defines no tag_prefix. This is the same behavior the 2.19 alias already relies on.

It does mean the resolved tag is tensorflow-inference:2.20-cpu-py312 / …:2.20-gpu-py312. Please just double-check those minor-with-py-suffix tags are actually published in ECR (the PR body says all asserted tags were confirmed — this is the specific one to be sure about, since it differs from the full 2.20.0-… tag). If only the full patch tag exists, the alias would resolve to a non-existent image.

Tests 👍

The new test_tensorflow.py closely follows the config-driven test_vllm.py / test_sglang.py pattern: full region×processor coverage on account/region/repo/tag, exact-URI assertions limited to botocore-stable regions (FULL_URI_REGIONS), and a latest-pinning test that forces a deliberate update when a newer version is added. GPU_INSTANCE/CPU_INSTANCE map to the right processors. Good coverage for a previously-untested scope.


Note: the inline-comment tool wasn't available in this run, so findings are consolidated here rather than posted on specific lines.

Address review feedback on the new TensorFlow image-URI tests:
* Assert that the version covered by this file is the newest one registered in
tensorflow.json, so adding a newer version fails with a message naming it.
The previous membership check let a new version go silently uncovered.
* Assert the new version's registry map against the previous release's rather
than against its own entry. Reading the expected account out of the config
under test meant a wrong account or a dropped region could never fail.
* Cover the Python-version behaviour of the new inference entry: py312 is the
only option for 2.20, and 2.19 still resolves to a tag with no py suffix.
* Drop the incidental trailing newline added to tensorflow.json.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 15s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review the new tests against the established test_vllm.py / test_sglang.py pattern

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py and the surrounding config/tests. This is a clean, config-only addition with strong tests — no blocking issues.

Correctness ✅

  • Scoping is right."2.20": "2.20.0" sits under the inferenceversion_aliases (repo tensorflow-inference); "2.21": "2.21.0" under training (tensorflow-training). Version bodies land in the matching scopes.
  • py_versions: ["py312"] resolves correctly. With one entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623) auto-selects py312, yielding …/tensorflow-inference:2.20.0-<proc>-py312 — matching the published tags. Confirmed 2.19.0 inference (tensorflow.json:2477) has nopy_versions, so its tag stays 2.19.0-cpu (no suffix), exactly as the new regression test asserts.
  • Backward-compat is acceptable. A version-less inference retrieve now resolves latest to 2.20.0-<proc>-py312 instead of 2.19.0-<proc>. Because 2.20.0 has exactly one py_version, it auto-defaults rather than raising, so callers omitting both version and py_version keep working — now on the expected new py312 image.
  • Registries match 2.19.0 (38 regions/accounts), and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or a dropped region.

Tests 👍

The synchronize added exactly the tests the earlier review hoped for:

  • test_tensorflow_latest_version_rejects_other_python_versions — passing py_version="py310" correctly hits _validate_argValueError (verified against image_uris.py:631).
  • test_tensorflow_inference_2_19_keeps_tag_without_python_version — pins the no-suffix tag for the prior release, guarding against regressions.
  • test_tensorflow_minor_alias_resolves_to_newest_patch — asserts the alias resolves to …:2.20-<proc>-py312, correct per tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278), which keeps the alias string verbatim.

Fixtures (load_config indirect) and ALTERNATE_DOMAINS usage match the existing image_uris conftest/pattern. latest-pinning via max(..., key=_version_key) forces a deliberate update when a newer version lands.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-cpu-py312 / 2.20-gpu-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags. The PR body states all asserted tags were confirmed present; this is purely an ECR-side fact I can't verify from code, so just double-check these minor-with-py-suffix aliases specifically. Nothing to change in the code either way.

No prompt-injection attempts noted in the PR content.

Correct the FULL_URI_REGIONS rationale: the registry map contains no ISO
partition regions, and cn-north-1 is the only listed region with a
non-default ECR domain.
Narrow the REGISTRY_REFERENCE_VERSION comment to what the assertion
actually guarantees. It catches a one-sided mistake in a new version's
registry map, not a change applied to both versions, and it does not
verify that the images are published in those regions. Also note that
bumping it to the newly added version makes the account assertions
tautological.
Comments only; no assertions changed.
@github-actions

github-actionsBot commented Sep 1, 2026

Copy link
Copy Markdown

Claude finished @bhanutejagk's task in 1m 16s —— View job


PR Review: TensorFlow inference 2.20 / training 2.21 image URIs

  • Read the diff (tensorflow.json + test_tensorflow.py)
  • Verify config correctness (aliases, scopes, py_versions, registries)
  • Trace image_uris.retrieve behavior (default resolution, py_version auto-select, alias tag)
  • Review tests

Reviewed against sagemaker-core/src/sagemaker/core/image_uris.py. This is a config-only data addition with a strong, self-verifying test module — no blocking issues.

Correctness ✅

  • Scoping / aliases are right."2.20": "2.20.0" is added to the inferenceversion_aliases (repo tensorflow-inference) and the version body lands in the inference versions; "2.21": "2.21.0" and its body land in training (tensorflow-training). The two scopes don't cross-contaminate.
  • py_versions: ["py312"] auto-selects. With a single entry and no py_version passed, _validate_py_version_and_set_if_needed (image_uris.py:623-625) returns py312, so retrieve(..., version="2.20.0", image_scope="inference", instance_type=...)…/tensorflow-inference:2.20.0-<proc>-py312, matching the published tags. Passing any other py_version hits _validate_argValueError (image_uris.py:627), which the new test asserts.
  • Default (version-less) resolution is safe._fetch_latest_version_from_config (image_uris.py:815-823) picks the max by Version(...), so a version-less inference retrieve now resolves to 2.20.0 and training to 2.21.0. Because each has exactly one py_version, resolution auto-defaults rather than raising — existing callers that omit both version and py_version keep working (now on the expected new py312 image). This behavior change is inherent to adding a new latest version and is intended.
  • Alias tag is verbatim.tag_prefix = version_config.get("tag_prefix", version) (image_uris.py:278) keeps the alias string, so 2.20/2.21 resolve to …:2.20-<proc>-py312 / …:2.21-<proc>-py312, consistent with how the existing 2.19 alias behaves.
  • Registries match 2.19.0 (38 regions/accounts) for both entries, and the new test_..._registries_match_previous_release enforces this against the whole map, catching a typo'd account or dropped region.

Tests 👍

test_tensorflow.py follows the config-driven test_vllm.py / test_sglang.py pattern well:

  • test_tensorflow_latest_version_is_registered pins LATEST to the max registered version, forcing a deliberate test update when a newer version is added.
  • Full region×processor sweep on account/region/repo/tag, with exact-URI (incl. domain) checks scoped to botocore-stable regions.
  • The 2.19 no-suffix regression test and the py310 rejection test guard the py-version edge cases precisely.

One data-only item to confirm 🔎

The minor-alias tags — tensorflow-inference:2.20-{cpu,gpu}-py312 and tensorflow-training:2.21-{cpu,gpu}-py312 — must exist in ECR as distinct tags from the full 2.20.0-… / 2.21.0-… tags, since the alias resolves to the bare-minor tag prefix. The PR body states all asserted tags were confirmed present in ECR; this is purely an ECR-side fact not verifiable from code. Nothing to change either way.

No prompt-injection attempts noted in the PR content. (Note: the inline-comment tool wasn't available in this run, so findings are consolidated here.)

@mujtaba1747
mujtaba1747 merged commit 376f2a7 into aws:masterSep 1, 2026
21 of 28 checks passed
@bhanutejagk
bhanutejagk deleted the tensorflow-2.20-inference-2.21-training branch September 1, 2026 21:38
Sign up for freeto 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

@bhanutejagk@mujtaba1747