Skip to content

build(container): install gcc-12 on aarch64 for torch inductor's armv9-a flags - #12507

Draft
yifjiang wants to merge 1 commit into
ai-dynamo:mainfrom
yifjiang:yifjiang/arm64-gcc12-armv9-toolchain
Draft

yifjiang wants to merge 1 commit into
ai-dynamo:mainfrom
yifjiang:yifjiang/arm64-gcc12-armv9-toolchain

Conversation

@yifjiang

@yifjiang yifjiang commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Context: one of six fixes from bringing up thinkingmachines/inkling on Dynamo + vLLM (4×GB200, TP=4, arm64). Sibling PRs from the same bring-up: #12510, #12541, #12511, #12543. This one is a build fix, hit on the aarch64 image build; it is not model-specific and affects any aarch64 vLLM runtime build where torch inductor emits -march=armv9-a.

Problem

On aarch64 the vLLM runtime image derives from the upstream vllm/vllm-openai arm64 image, which is Ubuntu 22.04 and ships gcc/g++ 11.4.

torch >= 2.13 detects Grace as armv9-a, and its inductor CPU backend then codegens:

-march=armv9-a+sve2+fp16fml+sha3+bf16+i8mm

(torch/_inductor/cpu_vec_isa.py, VecSVE.build_arch_flags). GCC only learned the armv9-a value for -march in 12, so gcc-11 rejects torch's own generated flags:

cc1plus: error: unknown value 'armv9-a' for '-march'

This is not just a build-time problem. It breaks:

  1. the validate_torch_compile_smoke.py regression guard added for the codec purge, and
  2. every runtime inductor / Triton CPU JIT on a Grace host — which only surfaces on the first compile in production, exactly the failure mode that guard exists to catch.

Fix

Install gcc-12/g++-12 and make them the default toolchain, aarch64 only — amd64 is untouched. gcc-12 is in the jammy archive and gcc-12-base is already pulled in as a dependency.

Two details worth noting for review:

  • cc and c++ are their own update-alternatives masters in this image rather than slaves of gcc/g++, so each of the four links is registered separately. Registering only gcc/g++ leaves cc/c++ pointing at 11.
  • The block ends by compiling a trivial TU with torch's exact flag set, so if the toolchain still cannot handle them the build fails rather than the deployment.

Test

Built the vLLM runtime image for linux/arm64 and confirmed the smoke guard passes and runtime JIT works on a Grace host. amd64 build path is unchanged (the whole block is inside if [ "$(uname -m)" = "aarch64" ]).

Notes

Filed as a draft — happy to attach a Linear ID and adjust the branch name to the <login>/<desc>__<DYN-ID> convention before this goes up for review.

…9-a flags

On aarch64 the vLLM runtime image is based on the upstream vllm/vllm-openai
arm64 image, which is Ubuntu 22.04 and ships gcc/g++ 11.4. torch >= 2.13
detects Grace as armv9-a, and its inductor CPU backend then codegens

    -march=armv9-a+sve2+fp16fml+sha3+bf16+i8mm

(torch/_inductor/cpu_vec_isa.py, VecSVE.build_arch_flags). GCC only learned the
`armv9-a` value for -march in 12, so gcc-11 rejects torch's own generated flags:

    cc1plus: error: unknown value 'armv9-a' for '-march'

This is not limited to the build: it breaks the torch-compile smoke guard added
for the codec purge, and every runtime inductor/Triton CPU JIT on a Grace host.

gcc-12 is available in the jammy archive (gcc-12-base is already pulled in as a
dependency), so switch the default toolchain to it on aarch64 only; amd64 is
untouched. `cc` and `c++` are their own update-alternatives masters in this
image rather than slaves of gcc/g++, so each link is registered separately. The
trailing compile of a trivial TU with torch's exact flag set fails the build
immediately if the toolchain still cannot handle them.

Signed-off-by: Yifan Jiang <19356972+yifjiang@users.noreply.github.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi yifjiang! Thank you for contributing to ai-dynamo/dynamo.

Just a reminder: The NVIDIA Test Github Validation CI runs an essential subset of the testing framework to quickly catch errors.Your PR reviewers may elect to test the changes comprehensively before approving your changes.

🚀

@github-actions github-actions Bot added the external-contribution Pull request is from an external contributor label Jul 31, 2026
@datadog-official

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

🚦 3 Pipeline jobs failed

PR | backend-status-check   View in Datadog   GitHub Actions

PR | vllm-runtime / Build multi-arch cuda13.0   View in Datadog   GitHub Actions

See error License validation failed: 6 violation(s) across 2029 packages due to denied licenses including 'GPL-2.0-or-later'.

PR | vllm-runtime-efa / Build multi-arch cuda13.0   View in Datadog   GitHub Actions

See error License validation failed: 6 violation(s) across 2031 packages due to GPL-2.0-or-later licenses in C++ related packages including gcc-12 and g++-12.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a9a187a | Docs | Datadog PR Page | Give us feedback!

This branch was previously deployed

1 inactive deployment
external_collaborator — a9a187af Deployed Jul 31, 2026 by yifjiang via pr_reminder #10806
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build container external-contribution Pull request is from an external contributor size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant