Skip to content

[Carry] Dockerfile: respect TORCH_CUDA_ARCH_LIST in extensions-build - #17

Draft
terafin wants to merge 1 commit into
intarweb-devfrom
feat/dockerfile-deepep-arch-respect
Draft

[Carry] Dockerfile: respect TORCH_CUDA_ARCH_LIST in extensions-build#17
terafin wants to merge 1 commit into
intarweb-devfrom
feat/dockerfile-deepep-arch-respect

Conversation

@terafin

@terafin terafin commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Internal carry, lands via FORK_CARRIED_COMMITS. Draft for visibility only — not intended to merge.

What

docker/Dockerfile extensions-build stage (DeepEP wheel) currently hardcodes:

export TORCH_CUDA_ARCH_LIST='9.0a 10.0a'

This compiles for Hopper + Blackwell unconditionally (~4m46s) regardless of the torch_cuda_arch_list build-arg. Change to:

export TORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST:-9.0a 10.0a}"

Default behavior preserved when env is unset. Build-arg consumers get the speedup.

Why fork-only

Upstream serves a multi-arch audience; the hardcoded list is defensible there. We tune for our consumer's arch. Filed as fork carry, not as an upstream PR.

Caveat

DeepEP requires SM90+ (per upstream README). Ampere-only arch lists will fail-loud at compile time, which is preferable to silently shipping non-functional kernels.

Risk

  • Dockerfile-only diff
  • Carry-drift guard: not touching .cu/.cpp/.h — safe
  • Default-preserving fallback

The DeepEP wheel-build stage hardcodes TORCH_CUDA_ARCH_LIST='9.0a 10.0a'
(Hopper + Blackwell) regardless of the torch_cuda_arch_list build-arg
that the rest of the Dockerfile honors. This is ~4m46s of compile time
for two arches even when the consumer passes a single different arch.

Honor the env override:

    export TORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST:-9.0a 10.0a}"

When the env is unset (default upstream behavior preserved), it falls
back to '9.0a 10.0a'. When TORCH_CUDA_ARCH_LIST is exported by the
build context (e.g. via the existing torch_cuda_arch_list ARG), the
DeepEP build only emits PTX/SASS for the arches the consumer actually
needs.

Caveat — DeepEP requires SM90+ per upstream README
(https://github.com/deepseek-ai/DeepEP). Passing an Ampere-only list
(e.g. 8.6) will cause the DeepEP build to fail loudly rather than
silently shipping non-functional kernels. Consumers on Ampere should
include 9.0a in their arch list or build with --target chosen to skip
this stage.

Intarweb-only carry (fork-only — not filed upstream). Dockerfile-only
diff; carry-drift guard safe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@intarweb-sync-bot
intarweb-sync-bot Bot force-pushed the intarweb-dev branch 29 times, most recently from cbeb0e5 to 5bcea71 Compare June 14, 2026 10:09
@intarweb-sync-bot
intarweb-sync-bot Bot force-pushed the intarweb-dev branch 17 times, most recently from f02f651 to 1f3d93f Compare June 19, 2026 23:09
@intarweb-sync-bot
intarweb-sync-bot Bot force-pushed the intarweb-dev branch 13 times, most recently from 5eadc10 to 03b0a58 Compare June 28, 2026 09:26
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.

1 participant