Skip to content

fix: migrate llama-cpp-arm64 to cpu processor schema and align image_uri unit tests - #6290

Open
Yadan-Wei wants to merge 4 commits into
aws:masterfrom
Yadan-Wei:dlc-config-promote-fixes
Open

Yadan-Wei wants to merge 4 commits into
aws:masterfrom
Yadan-Wei:dlc-config-promote-fixes

Conversation

@Yadan-Wei

@Yadan-Wei Yadan-Wei commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Scopes this PR to the schema and unit-test changes needed to keep the image_uri_config tests green, without the bulk config-data promotion.

Changes

  • sagemaker-core/src/sagemaker/core/image_uri_config/llama-cpp-arm64.json — migrate versions 1 and 1.0 from the whole-tag form to the cpu-only processor schema (processors: ["cpu"], processor_in_tag: false, tag tail in container_version["cpu"]). The resolved image tag is unchanged (server-sagemaker-cpu-v1 / server-sagemaker-cpu-v1.0), so existing callers are unaffected.
  • sagemaker-core/tests/unit/image_uris/test_dlc_serving_frameworks.py — reclassify llama-cpp-arm64 as a cpu-only processor-schema config (moved out of the now-empty whole-tag list); add mirrored uri and reject-gpu-instance coverage.
  • sagemaker-core/tests/unit/image_uris/test_tensorflow.py — the newest tensorflow version may additionally carry a newly launched region still inside the image-copy window (not yet backfilled onto the previous release), so the registries check becomes a subset check instead of exact equality (superset regressions are still caught).

Testing

pytest sagemaker-core/tests/unit/image_uris/ — 205 passed, 2 skipped (pre-existing conditional skips).

sagemaker-bot and others added 2 commits September 17, 2026 22:24
…e_uri tests

- whisperx: drop the spurious "3.8": "3.8.6" version alias so version 3.8 resolves to its
  own moving minor tag (3.8-cu128-amzn2023-sagemaker) rather than the pinned 3.8.6 tag; the
  latest alias still points to 3.8.
- tests: reclassify llama-cpp-arm64 as a cpu-only processor-schema config (migrated from the
  whole-tag form) with mirrored uri / reject-gpu-instance / literal-tag coverage.
- tests: allow the newest tensorflow version to additionally carry a newly launched region
  that is still inside the image-copy window (subset check instead of exact equality).
@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown

Claude finished @Yadan-Wei's task in 2m 24s —— View job


Code review

Reviewed the full diff plus the resulting whisperx.json and the serving-framework test helper. This is a generated config promotion; I focused on the hand-authored fixes and on invariants a generator can silently get wrong. Overall it looks sound and the test changes are reasonable. Two things to confirm.

Note: the inline-comment tool isn't available in this run, so findings are consolidated here with file references.


1. whisperx: the two versions have divergent registry maps — latest/3.8 does not get me-west-1 (medium, please confirm)

whisperx.json now has two versions that resolve to the same underlying image (both container_version.gpu = cu128-amzn2023-sagemaker, differing only by tag_prefix 3.8 vs 3.8.6), yet their registries maps differ in both directions:

  • 3.8 (versions."3.8".registries) contains cn-north-1, cn-northwest-1, us-gov-east-1, us-gov-west-1 but not me-west-1.
  • 3.8.6 (versions."3.8.6".registries) contains me-west-1 but not the cn / us-gov partitions above.

Because version_aliases.latest = "3.8", the version most users actually pull (latest, and the bare moving tag 3.8) is the one that is missing me-west-1 — which undercuts this PR's stated goal ("adds me-west-1 coverage to in-window framework versions"). Conversely the pinned 3.8.6 loses the cn/gov coverage that 3.8 has.

If 3.8 and 3.8.6 are the same build, their region availability should match. Please confirm this asymmetry reflects real ECR availability (e.g. the mutable 3.8 tag genuinely hasn't been republished to me-west-1 yet) rather than a generation artifact. Note the existing test_gpu_only_processor_serving_framework_uris won't catch this — it validates each version against its own registry list.

2. Edited config files lost their trailing newline (minor)

Every edited JSON config now ends with } and no trailing newline (the diffs show \ No newline at end of file on the new side only — the base files ended with }\n). Affects all 13 changed image_uri_config/*.json files. This is cosmetic, but if the repo runs an end-of-file-fixer / black-style pre-commit or has an .editorconfig requiring a final newline, it'll flag these. Worth having the generator emit a trailing newline to avoid churn on every future promotion.


Looks good

  • tensorflow test relaxation (test_tensorflow.py): the subset check (reference ⊆ latest) is correct — it still catches regions/accounts dropped from the newest release while tolerating a newly launched region that hasn't been backfilled onto the reference version. Good.
  • cpu-only serving tests (test_dlc_serving_frameworks.py): the new CPU_ONLY_PROCESSOR_FILES path mirrors the gpu-only case cleanly (cpu tail resolution, optional instance_type, gpu-instance rejection), and emptying WHOLE_TAG_CONFIG_FILES is consistent with migrating llama-cpp-arm64 to the processor schema.
  • llama-cpp / llama-cpp-arm64 / ray-serve / vllm- / sglang- additive changes**: version reordering + new versions look additive; spot-checked that ray-serve 1.4 retains its cn-north-1/cn-northwest-1/us-gov-* registries (they moved in the textual diff but are preserved).
  • No security/credential concerns — pure data + test changes.
    · branch dlc-config-promote-fixes

…t alignment

Revert the bundled image_uri_config data promotion and the whisperx alias change carried
by earlier commits on this branch, leaving the net change as exactly:
- llama-cpp-arm64.json migrated to the cpu-only processor schema (resolved tag unchanged),
- serving-framework and tensorflow image_uri unit-test alignments.
@Yadan-Wei
Yadan-Wei deployed to auto-approve September 21, 2026 23:10 — with GitHub Actions Active
@Yadan-Wei
Yadan-Wei deployed to auto-approve September 21, 2026 23:10 — with GitHub Actions Active
@Yadan-Wei
Yadan-Wei deployed to auto-approve September 21, 2026 23:10 — with GitHub Actions Active
@Yadan-Wei Yadan-Wei changed the title change: promote image_uri_config (DLC frameworks + me-west-1) with whisperx alias fix and test alignment fix: migrate llama-cpp-arm64 to cpu processor schema and align image_uri unit tests Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown

Claude finished @Yadan-Wei's task in 1m 29s —— View job


Code review — PR #6290

  • Read the PR diff (ground truth)
  • Verify llama-cpp-arm64.json cpu-schema migration preserves resolved tags
  • Verify test changes against the retrieval logic & helpers
  • Post consolidated review

Reviewed the current diff (/tmp/pr.diff) against image_uris.retrieve() and the serving-framework test helpers. Note: the diff on this branch is now scoped to just 3 filesllama-cpp-arm64.json and the two test files. The prior review's two concerns (whisperx me-west-1 asymmetry and lost trailing newlines across 13 configs) are no longer part of this PR; the scoping commit removed them. So this review focuses on what's actually here.

The inline-comment tool isn't available in this run, so findings are consolidated below with file references.


Correctness — verified sound ✅

  • llama-cpp-arm64.json cpu-schema migration is a byte-identical no-op for callers. For both versions the resolved tag stays the same as the pre-migration whole tag:
    • tag_prefix "server-sagemaker" + container_version["cpu"]="cpu-v1", with processor_in_tag=false dropping the processor token → server-sagemaker-cpu-v1 (was server-sagemaker-cpu-v1). Same for 1.0server-sagemaker-cpu-v1.0. Confirmed against image_uris.py:230-231 / :288-289 / _format_tag.
  • test_cpu_only_processor_rejects_gpu_instance is correct. With processors=["cpu"], a ml.g5 instance makes _processor() return "gpu" and _validate_arg("gpu", ["cpu"]) raises ValueError (image_uris.py:572-588). Rejection, not silent cpu-serving. ✅
  • test_cpu_only_processor_serving_framework_uris correctly mirrors the gpu-only case, including the optional-instance_type path (single processor defaults to cpu at image_uris.py:547-549). ✅
  • tensorflow subset relaxation is correct. missing = reference regions whose account differs in latest; asserting not missing still catches any region/account dropped or changed in the newest release, while tolerating a newly launched region present only on latest. The docstring accurately describes the new semantics. ✅

Minor — test coverage gap (worth addressing, not blocking)

test_dlc_serving_frameworks.py — no literal-tag pin for the cpu-only path. The PR description claims "mirrored uri / reject-gpu-instance / literal-tag coverage" for llama-cpp-arm64, but unlike the gpu-only (GPU_ONLY_EXPECTED_REPO_TAGS) and multi-processor (EXPECTED_REPO_TAGS) cases, no cpu-only literal-tag test was added. test_cpu_only_processor_serving_framework_uris derives expected_tag = f"{prefix}-{cpu_tail}" from the config itself, so a self-consistent typo in tag_prefix/container_version would pass — exactly the failure the gpu-only literal test was written to catch (see its comment at lines 262-263). A small CPU_ONLY_EXPECTED_REPO_TAGS block pinning e.g. "1": "llama-cpp-arm64:server-sagemaker-cpu-v1" / "1.0": "...-cpu-v1.0" would close the gap and lock backward-compat with the pre-migration whole tag.

Nit

  • Emptying WHOLE_TAG_CONFIG_FILES = [] makes test_serving_framework_uris and test_serving_framework_latest_alias parametrize over an empty list, so they now collect 0 tests (effectively dead until a whole-tag config reappears). Fine to keep as scaffolding, but noting it in case CI has a "no empty parametrize"/collection guard.

No security or backward-compatibility concerns — pure config + test changes, and the resolved image URIs are unchanged for existing callers. Looks good to merge; the literal-tag pin is the only thing I'd suggest adding.
· branch dlc-config-promote-fixes

@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown

Claude finished @Yadan-Wei's task in 51s —— View job


Code review — PR #6290

  • Read the PR diff (ground truth)
  • Verify llama-cpp-arm64.json cpu-schema migration preserves resolved tags
  • Verify test changes against retrieval logic & helpers
  • Post consolidated review

Reviewed the 3-file diff against image_uris.retrieve() and the serving-framework test helpers. The inline-comment tool isn't available in this run, so findings are consolidated below with file references.


Correctness — verified sound ✅

  • llama-cpp-arm64.json migration is a byte-identical no-op for callers. For both versions the resolved tag is unchanged: tag_prefix="server-sagemaker" + container_version["cpu"]="cpu-v1" with processor_in_tag=false (which sets processor=None at image_uris.py:288-289) → _get_image_tag produces server-sagemaker-cpu-v1 (was the whole tag server-sagemaker-cpu-v1). Same for 1.0server-sagemaker-cpu-v1.0. Confirmed against image_uris.py:230-231 / :278 / :288-304.
  • test_cpu_only_processor_serving_framework_uris correctly mirrors the gpu-only test, including the optional-instance_type path (single processor defaults to cpu).
  • test_cpu_only_processor_rejects_gpu_instance is correct: with processors=["cpu"], a ml.g5 instance makes _processor() return "gpu", which fails _validate_argValueError. Rejection, not silent cpu-serving.
  • tensorflow subset relaxation is correct — missing = reference regions whose account differs in latest; assert not missing still catches any region/account dropped or changed in the newest release while tolerating a newly launched region present only on latest. Docstring accurately describes the new semantics.

Minor — test coverage gap (worth addressing, not blocking)

test_dlc_serving_frameworks.py — no literal-tag pin for the cpu-only path. test_cpu_only_processor_serving_framework_uris derives expected_tag = f"{prefix}-{cpu_tail}" from the config itself (lines 151-153), so a self-consistent typo across tag_prefix/container_version would still pass — precisely the failure mode the gpu-only literal pin (GPU_ONLY_EXPECTED_REPO_TAGS, and its comment at lines 262-263) exists to catch. Since this migration's whole point is that the resolved tag is unchanged, a small CPU_ONLY_EXPECTED_REPO_TAGS block pinning "1": "llama-cpp-arm64:server-sagemaker-cpu-v1" / "1.0": "...-cpu-v1.0" would lock backward-compat against the pre-migration whole tag and match the pattern the other two paths already follow.

Nit

  • WHOLE_TAG_CONFIG_FILES = [] makes test_serving_framework_uris / test_serving_framework_latest_alias parametrize over an empty list, so they now collect 0 tests. Fine as scaffolding, but worth noting in case CI has an empty-parametrize / collection guard.

No security or backward-compatibility concerns — pure config + test changes, resolved image URIs unchanged for existing callers. Looks good to merge; the cpu literal-tag pin is the one thing I'd suggest adding.
· branch dlc-config-promote-fixes

@Yadan-Wei
Yadan-Wei deployed to auto-approve September 21, 2026 23:22 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
auto-approve 66390fb6 Deployed Sep 21, 2026 by Yadan-Wei via wait-for-approval #1775
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants