Skip to content

deepseek-v4: CUDA_ARCH=portable-pre-ampere needs CUDA <= 12.9; say so where the preset is recommended - #2760

Merged
JustVugg merged 1 commit into
JustVugg:devfrom
KairaCode:kaira/dsv4-pre-ampere-cuda13-hint
Nov 13, 2026
Merged

JustVugg merged 1 commit into
JustVugg:devfrom
KairaCode:kaira/dsv4-pre-ampere-cuda13-hint

Conversation

@KairaCode

Copy link
Copy Markdown

deepseek-v4: CUDA_ARCH=portable-pre-ampere needs CUDA <= 12.9; say so where the preset is recommended

Summary

When the DeepSeek V4 GPU tier cannot use a Pascal or Turing card, the loader, the backend, resource_plan.py and the docs all point the user to CUDA_ARCH=portable-pre-ampere NO_TC=1. That preset's gencode list starts at compute_61, which CUDA 13 dropped. With a CUDA 13 toolkit, nvcc stops at once, and none of these hints mention the toolkit limit. This PR adds "CUDA <= 12.9" to every place that recommends the preset. The Makefile comment and the doc also say that a Turing card builds on CUDA 13 with CUDA_ARCH=sm_75 NO_TC=1. A test keeps the hints and the measured nvcc table in setup_flow.py in step.

It complements #2755, which adds the same preset to c/Makefile for the Windows DLL. Code and build flags are unchanged: only message strings, comments and docs change.

Problem on dev (d138de3)

  • c/Makefile.deepseek-v4:164-175: the portable-pre-ampere gencode list is compute_61, 75, 80, 86, 89, 90 plus compute_90 PTX. The comment explains why NO_TC=1 is needed (cuBLASLt needs CUDA >= 12.8), but says nothing about an upper toolkit bound. The summary at :132-133 has the same gap.

  • c/setup_flow.py:186-197 (CUDA_RELEASES, measured from NVIDIA's own nvcc) already records it: ((12, 9), 50, 121), then ((13, 0), 75, 121). tests/test_setup_flow.py keeps the real nvcc --list-gpu-arch of 13.0.88 and 13.4.92, and both start at compute_75.

  • With the CUDA 13.4 toolkit on this machine, the preset's own flags fail before any compilation:

    $ nvcc --version | grep release
    Cuda compilation tools, release 13.4, V13.4.92
    $ nvcc --dryrun -O3 -std=c++20 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_75,code=sm_75 \
          -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_89,code=sm_89 \
          -gencode arch=compute_90,code=sm_90 -gencode arch=compute_90,code=compute_90 -DCOLI_DSV4_NO_TC \
          -c backend_cuda_dsv4.cu -o x.o
    nvcc fatal   : Unsupported gpu architecture 'compute_61'
    
  • These places send Pascal and Turing users to the preset with no toolkit limit:

Fix

  • c/Makefile.deepseek-v4: the summary at :133 says the preset needs NO_TC=1 and CUDA <= 12.9. A new paragraph in the preset block says why: CUDA 13 dropped compute_61, and nvcc stops with Unsupported gpu architecture 'compute_61'. With CUDA 13, a Turing card builds with CUDA_ARCH=sm_75 NO_TC=1.

  • c/backend_loader_dsv4.c: the message now ends CUDA_ARCH=portable-pre-ampere NO_TC=1 and CUDA <= 12.9 (docs/deepseek-v4.md).

  • c/backend_cuda_dsv4.cu: for a card below sm_80, the no kernel image reason now suggests CUDA_ARCH=portable-pre-ampere NO_TC=1 with CUDA <= 12.9.

  • c/resource_plan.py: the hint now reads a build with CUDA_ARCH=portable-pre-ampere NO_TC=1 (CUDA <= 12.9) runs on Pascal and Turing. The existing Findings on Zen2/Windows with DS4F REAP-150B (v1.12.1): SMT thread default, non-monotonic --ram, cross-build token divergence (+#1136), and a few docs/UX items #1906 test only checks for sm_61 and portable-pre-ampere, so it still passes.

  • docs/deepseek-v4.md: the "GPU coverage" paragraph names the limit, the nvcc error and the sm_75 route on CUDA 13. The table row adds CUDA <= 12.9.

  • c/tests/test_deepseek_v4_cuda_arch_flags.py: new PreAmperePresetToolkitTest. It reads files only, so it needs no make, no CUDA and no POSIX shell, and it runs on Windows too. It:

    • takes the oldest compute_XX of the preset from Makefile.deepseek-v4;
    • takes the last release that builds it from setup_flow.CUDA_RELEASES (12.9), and checks that a newer release dropped it;
    • requires CUDA <= 12.9 in the preset block, in CUDA_TIER_FLOOR, and right after every portable-pre-ampere NO_TC=1 in the loader, the backend and the doc.

    If a later toolkit row or preset change moves the limit, the test names each hint that is out of date.

No Makefile auto-detection was added on purpose. The Linux CUDA=1 block already reads nvcc --version only for the >= 12.8 check, and that check is skipped with NO_TC=1, which this preset requires. nvcc's own error is clear once the hint says which toolkit to use.

Tests

Windows 11, MSYS2 UCRT64 gcc 16.2, Python 3.14, PYTHONUTF8=1, from c/:

  • New test on dev sources (only the test file from this branch): python -m unittest tests.test_deepseek_v4_cuda_arch_flags.PreAmperePresetToolkitTest fails in all five subtests, one per hint, each with recommends the preset without 'CUDA <= 12.9'. For example:
    • 'a build with CUDA_ARCH=portable-pre-ampere NO_TC=1 runs on Pascal and Turing' (resource_plan.CUDA_TIER_FLOOR);
    • 'portable-pre-ampere NO_TC=1 (docs/deepseek-v4.md).\n", ...' (backend_loader_dsv4.c);
    • 'portable-pre-ampere NO_TC=1":"portable"); ...' (backend_cuda_dsv4.cu);
    • both doc hits (docs/deepseek-v4.md).
  • This branch: the same test is OK.
  • python -m unittest tests.test_resource_plan tests.test_deepseek_v4_cuda_arch_flags tests.test_deepseek_v4_build_flags tests.test_makefile_platform: 155 tests OK, 25 skipped. The skips are the POSIX-only fake-nvcc tests.
  • python -m unittest tests.test_setup_flow.CudaToolkit: 6 tests OK. This is the measured nvcc table the new test reads.
  • make -f Makefile.deepseek-v4 deepseek-v4 (CPU build, which on Windows compiles backend_loader_dsv4.o): OK. deepseek_v4.exe contains ... take a build with CUDA_ARCH=portable-pre-ampere NO_TC=1 and CUDA <= 12.9 (docs/deepseek-v4.md).
  • backend_cuda_dsv4.cu with the changed string, compiled with CUDA 13.4 + MSVC (VS 18 BuildTools) as nvcc -O3 -std=c++17 -arch=sm_75 -DCOLI_DSV4_NO_TC --expt-relaxed-constexpr --expt-extended-lambda -Xcompiler=/Zc:preprocessor -c backend_cuda_dsv4.cu: exit 0, and cuobjdump --list-elf lists sm_75. This backs the doc's "with CUDA 13, Turing builds with CUDA_ARCH=sm_75 NO_TC=1". It was a compile check only: no Turing card was run here.
  • CUDA 12.9 accepting the preset is shown in build: cuda-dsv4-dll on Windows accepts CUDA_ARCH=portable-pre-ampere and NO_TC=1 #2755, which built it with CUDA 12.9 and ran it on a GTX 1060 (sm_61).

Risks

  • None for behaviour: no build flag, code path or return value changes. The two changed C strings are longer user messages: the loader's fprintf and a snprintf into the caller's why buffer, which truncates as before.
  • The 12.9 bound comes from setup_flow.CUDA_RELEASES. If NVIDIA ever ships a 12.10, that table needs a row first, and the new test then reports the hints that need the new number.
  • The localized READMEs (README.*.md, line ~405 in English) still give the preset without the limit. Their paragraph already says that a CUDA 12.x toolkit brings the CUDA path back for older cards, so they were left alone to keep the translations in step.

Related open PRs

🤖 Generated with Claude Code

…it is recommended

The preset's gencode list starts at compute_61, which CUDA 13 dropped
(nvcc 13 lists compute_75 first), so nvcc stops at once with
"Unsupported gpu architecture 'compute_61'". The loader's no-usable-DLL
message, the backend's no-kernel-image reason, resource_plan's
CUDA_TIER_FLOOR hint, Makefile.deepseek-v4 and docs/deepseek-v4.md all
sent Pascal and Turing users to the preset without that limit. They now
say "CUDA <= 12.9"; the Makefile comment and the doc add that a Turing
card builds on CUDA 13 with CUDA_ARCH=sm_75 NO_TC=1.

A test reads the preset's oldest compute_XX from Makefile.deepseek-v4,
takes the last release that builds it from setup_flow.CUDA_RELEASES (the
measured nvcc table) and checks every hint names that limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JustVugg
JustVugg merged commit 2ca5550 into JustVugg:dev Nov 13, 2026
93 of 117 checks passed
risner pushed a commit to risner/colibri that referenced this pull request Nov 13, 2026
…9 too

JustVugg#2755 added the row and JustVugg#2760 the check that every place recommending the
portable-pre-ampere preset names the last toolkit that builds it.
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