Skip to content

chore(marlin): drop the sm_75 (Turing) path; require sm_80+ - #5200

Merged
Qubitium merged 1 commit into
mainfrom
chore/marlin-drop-sm75
Nov 18, 2026
Merged

Qubitium merged 1 commit into
mainfrom
chore/marlin-drop-sm75

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Summary

Drops Marlin's sm_75 (Turing) path. Marlin now requires compute capability 8.0+ for GPTQ, which AWQ Marlin already required.

Turing support came in with the upstream Marlin sync (#2717). It added an m16n8k8 MMA path, an FP16-accumulate variant, a 2-stage pipeline with its own kernel instantiations and tile rules, and an fp16-only dtype gate in Python. This PR removes all of it and restores the < 800 kernel stubs.

What Changed

  • gptqmodel_ext/marlin/marlin_mma.h: remove the __CUDA_ARCH__ == 750 m16n8k8 MMA paths and the FP16-accumulate branch. mma<scalar_t>() and mma_trans<scalar_t>() no longer take use_fp16_accum.
  • gptqmodel_ext/marlin/marlin_template.h:
    • Kernels compile to stubs for __CUDA_ARCH__ < 800 (was < 750).
    • Remove the use_fp16_accum constant, the half→float epilogue conversion and the sm_75 bf16 early return.
  • gptqmodel_ext/marlin/gptq_marlin.cu:
    • The host stub covers < 800, with the message requires CUDA_ARCH >= 8.0.
    • The capability check is major_capability >= 8 ("Ampere or newer").
    • Remove the Turing stages = 2 branch and the fp16-only check, all stages == 2 kernel selection, the stage-2 tile filter in _GET_IF, and the stage-2 rule in is_valid_config.
  • gptqmodel_ext/marlin/generate_kernels.py: no stage-2 instantiations. fp16 kernel instantiations drop from 616 to 330, so fp16 JIT builds are faster.
  • gptqmodel_ext/marlin/kernel_fp16_ku8.cu: regenerated. It is one of the two generated kernel files tracked in git.
  • gptqmodel/nn_modules/qlinear/marlin.py: _MARLIN_MIN_CAPABILITY = (8, 0). Remove _MARLIN_SM75_CAPABILITY and the "compute capability 7.5 requires dtype=torch.float16" gates in _validate/post_init.
  • gptqmodel/utils/marlin.py: _marlin_capability_supported is major >= 8; the error message says >= 8.0.
  • Kept: the cp.async fallbacks in marlin.cuh (__CUDA_ARCH__ < 800). They predate the Turing work and keep the repack kernels compiling when TORCH_CUDA_ARCH_LIST includes an older arch.
  • Docs: docs/support-matrix.md lists Marlin under sm_80+.
  • No backward-compat shims. Turing users fall back to non-Marlin CUDA kernels through normal kernel selection.

Tests

  • Unit tests have been executed and passed, or the reason they are not applicable is documented.
  • I added a new simple/fast unit test for this change, or documented why that is not applicable.

Test changes:

  • test_marlin_capability_checks_allow_sm75_but_reject_sm70 becomes test_marlin_capability_checks_require_sm80.
  • ..._validate_device_allows_sm75 / ..._rejects_pre_turing become ..._allows_sm80 / ..._rejects_turing.
  • test_sm75_turing_contract_is_present_in_marlin_sources and test_stage2_dense_four_bit_tiles_... are replaced by test_marlin_sources_have_no_turing_path. It asserts that no == 750 path, use_fp16_accum, m16n8k8 or stages == 2 remains, and that no generated kernel instantiates stage 2.
  • test_marlin_scratch_cuda.py: the skip rule is major < 8.
pytest -q -rs tests/test_marlin_jit.py
# RTX 4090 (sm_89): 64 passed
pytest -q -rs tests/kernels/test_marlin_tile_determinism_4735.py tests/kernels/test_awq_marlin_determinism_4683.py \
  tests/kernels/test_marlin_bias_epilogue.py tests/kernels/test_marlin_fp32_schedule.py \
  tests/kernels/test_marlin_quant_dtype_boundaries.py tests/kernels/test_marlin_strided_activation_4563.py \
  tests/kernels/test_awq_marlin_stream_4683.py tests/test_marlin_scratch_cuda.py tests/test_kernel_device_error_reason.py
# RTX 4090 (sm_89): 280 passed, 3 skipped
  • Skips are environment-only: two test_marlin_scratch_cuda.py cases need two CUDA devices visible, and one needs a built Machete extension.
  • Mixed arch list: with TORCH_CUDA_ARCH_LIST="7.5;8.9", both Marlin fp16 and bf16 extensions build (sm_75 gets the stub kernels).
  • ruff check gptqmodel docs/eora tests setup.py (0.14.2): all checks passed.
  • Not run: sm_120 for this PR, because the RTX 5090 was busy with another benchmark. No Turing hardware is available; on Turing, Marlin is now rejected up front by design.

Model Support / Module Plan

Not applicable.

AWQ onboarding safety

Not applicable.

Logic Flow Documentation

  • This change does not alter a major logic flow, or the required diagrams and docs page are included below.

Kernel selection simply loses its sm_75 branch; no new mechanism.

Review Requirements

  • Reviewed this PR.
  • Checked that the code matches existing project structure, APIs, and conventions.
  • Avoided unnecessary monkeypatching and used the project's normal extension points where possible.
  • Minimized and compacted the impacted code surface.
  • Considered and eliminated potential regressions.

Kernel Accuracy Requirements

Notes

🤖 Generated with Claude Code

Remove the Turing support added with the upstream Marlin sync (#2717):

* marlin_mma.h: the m16n8k8 MMA paths and the FP16-accumulate variant; mma()
  and mma_trans() lose the use_fp16_accum template parameter.
* marlin_template.h: the sm_75 use_fp16_accum epilogue conversion and the
  bf16 early return. Kernels compile to stubs below sm_80 again, so a mixed
  TORCH_CUDA_ARCH_LIST that includes 7.5 still builds.
* gptq_marlin.cu: the 2-stage Turing pipeline, its kernel selection and
  tile-validity rules, and the Turing capability branch. The host now requires
  compute capability >= 8.0.
* generate_kernels.py: no more stage-2 instantiations (fp16 instantiations go
  from 616 to 330).
* GPTQ MarlinLinear and the Marlin runtime check require sm_80, matching AWQ
  Marlin; the fp16-only sm_75 dtype gate is gone.

The cp.async fallbacks in marlin.cuh predate the Turing work. They stay, so
the repack kernels keep building for any arch list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Qubitium
Qubitium marked this pull request as ready for review November 18, 2026 11:03
@Qubitium
Qubitium merged commit 280e2ff into main Nov 18, 2026
6 checks passed
@Qubitium
Qubitium deleted the chore/marlin-drop-sm75 branch November 18, 2026 11:03
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