Make Docker builds architecture-agnostic (x86_64 / aarch64) and modernize Dockerfile syntax#112
Merged
Merged
Conversation
Parameterize arch-specific paths via an ARCH build-arg (defaulting to x86_64) so images can build on aarch64. build_docker.sh passes $(uname -m), which matches both the NVHPC SDK dir naming (Linux_<arch>) and the HPCX tarball naming (...-cuda13-<arch>.tbz). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Thorsten Kurth <tkurth@nvidia.com>
Signed-off-by: Thorsten Kurth <tkurth@nvidia.com>
…ARm has slightly different accumulation error characteristics than x86 Signed-off-by: Thorsten Kurth <tkurth@nvidia.com>
Signed-off-by: Thorsten Kurth <tkurth@nvidia.com>
…hitecture. Signed-off-by: Josh Romero <joshr@nvidia.com>
Collaborator
|
I pushed a modification to your Dockerfiles here to use
There is an annoying wrinkle in that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables the TorchFort container images to build on both x86_64 and aarch64 (e.g. GB10 / DGX Spark, Grace) from the same Dockerfiles, driven by a single ARCH build-arg. Also modernizes ENV
syntax to silence BuildKit lint warnings, and relaxes one RL test tolerance that fails only on ARM due to floating-point accumulation differences.
Changes
Architecture-agnostic builds
working unchanged.
without a warning.
Dockerfile syntax modernization
removes the UndefinedVar warning on the bare-Ubuntu CPU image and keeps the GPU images robust regardless of whether the base image pre-sets the var (no trailing colon when unset).
Test fix (ARM)
sum across the batch. The buffer and the test's manual recomputation use mathematically equivalent but differently-rounded paths (std::pow + torch tensor ops vs. repeated scalar float
multiply), which diverge by a few ULP per term and differ across architectures (FMA contraction on aarch64). The buffer math is unchanged and correct on both arches; only the test's exact-zero
comparison was too strict. sdiff (no arithmetic) stays on exact equality.
Testing
expected on a single-GPU host — not a regression.
Notes for reviewers