[PR #3085] [CLOSED] [Engine] Enable IQ prefill path on sm_75 (RTX 20-series / Turing) #4445

Closed
opened 2026-11-07 15:35:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3085
Author: @dd777mine
Created: 10/18/2026
Status: ❌ Closed

Base: main ← Head: fix/moe-iq-prefill-sm75-gate


📝 Commits (2)

  • 35e5c7b fix(cuda): Unblock Fused MoE IQ prefill gate on sm_75 (Turing)
  • bb32d9f fix(cuda): include d.t75 in native_supported to unblock single env var activation

📊 Changes

1 file changed (+27 additions, -9 deletions)

View changed files

📝 src/prefill/moe_fused_iq.cu (+27 -9)

📄 Description

Problem and result:
On Turing (sm_75, e.g. RTX 2060), moe_fused_iq.cu was bailing out early under the assumption that codebook formats do not fit 64 KB of shared memory at 4 warps a row. However, with ASTAGES_DEV=2, IQ3_S blocks require ~58.8 KB (cleanly fitting the 64 KB ceiling), and IQ2_S / IQ2_XS fit at 2 warps (~43.5 KB).
This PR adjusts the sm_75 gate so Turing GPUs can use the native fused MoE prefill path instead of falling back to CPU dequantization and host synchronization.

Approach:
One file: src/prefill/moe_fused_iq.cu

  • setup_one_turing(): registers IQ2_S / IQ2_XS at WW=2 only; all other formats keep WW=4 + WW=2 (matching sm_80+).
  • dev_info(): runs setup_one_turing for the codebook formats on Turing instead of restricting to Q2_0.
  • native_supported(): removes the sm_75-only Q2_0 restriction and checks d.t75 directly so either STRATA_PF_FUSED=1 or STRATA_PF_FUSED_SM75=1 activates the path.
  • experts_native(): pins ww=2 for IQ2_S / IQ2_XS on Turing to match what was registered.
    Fully opt-in: activates with either STRATA_PF_FUSED=1 or STRATA_PF_FUSED_SM75=1. Non-Turing (sm_80+) and HIP builds remain byte-identical.

Validation:
Passed:

  • Revision tested: rebased on main (v0.2.2 / 0.2.0-beta).
  • Environment: Ubuntu 24.04, CUDA 12.4, 1x RTX 2060 12 GB (sm_75).
  • Full build: ninja -C build strata (all 163 targets) passed cleanly.
  • Tests: python tools/test_setup_older_gpus.py (19/19 OK), python tools/test_setup_choices.py (50/50 OK), ./build/mmq_expert_bench executed on GPU 0 with zero errors.
  • Benchmark (RTX 2060 12 GB, Qwen3.8-Flash-Next IQ3_S, ~5.8K prompt tokens):
    • Time to first token (prompt latency): 14.1 s → 12.3 s (-1.8 s faster)
    • Bulk prefill speed: 509 tok/s → 606 tok/s (+19.2%)
    • Decode speed: identical (zero regression)
      Failed:
      None observed.
      Not run:
      Non-CUDA backends (HIP/Metal) - this is a CUDA sm_75 specific gate.

Limits:
Turing sm_75 only. Codebook formats run with ASTAGES_DEV=2 to stay within 64 KB shared memory.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3085 **Author:** [@dd777mine](https://github.com/dd777mine) **Created:** 10/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/moe-iq-prefill-sm75-gate` --- ### 📝 Commits (2) - [`35e5c7b`](https://github.com/Niko1221/Strata/commit/35e5c7b809dbc320542c164c6e92db660287087b) fix(cuda): Unblock Fused MoE IQ prefill gate on sm_75 (Turing) - [`bb32d9f`](https://github.com/Niko1221/Strata/commit/bb32d9fc3fc419641be60efbea60ae54b6df722b) fix(cuda): include d.t75 in native_supported to unblock single env var activation ### 📊 Changes **1 file changed** (+27 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/prefill/moe_fused_iq.cu` (+27 -9) </details> ### 📄 Description Problem and result: On Turing (sm_75, e.g. RTX 2060), moe_fused_iq.cu was bailing out early under the assumption that codebook formats do not fit 64 KB of shared memory at 4 warps a row. However, with ASTAGES_DEV=2, IQ3_S blocks require ~58.8 KB (cleanly fitting the 64 KB ceiling), and IQ2_S / IQ2_XS fit at 2 warps (~43.5 KB). This PR adjusts the sm_75 gate so Turing GPUs can use the native fused MoE prefill path instead of falling back to CPU dequantization and host synchronization. Approach: One file: src/prefill/moe_fused_iq.cu - setup_one_turing(): registers IQ2_S / IQ2_XS at WW=2 only; all other formats keep WW=4 + WW=2 (matching sm_80+). - dev_info(): runs setup_one_turing for the codebook formats on Turing instead of restricting to Q2_0. - native_supported(): removes the sm_75-only Q2_0 restriction and checks d.t75 directly so either STRATA_PF_FUSED=1 or STRATA_PF_FUSED_SM75=1 activates the path. - experts_native(): pins ww=2 for IQ2_S / IQ2_XS on Turing to match what was registered. Fully opt-in: activates with either STRATA_PF_FUSED=1 or STRATA_PF_FUSED_SM75=1. Non-Turing (sm_80+) and HIP builds remain byte-identical. Validation: Passed: - Revision tested: rebased on main (v0.2.2 / 0.2.0-beta). - Environment: Ubuntu 24.04, CUDA 12.4, 1x RTX 2060 12 GB (sm_75). - Full build: ninja -C build strata (all 163 targets) passed cleanly. - Tests: python tools/test_setup_older_gpus.py (19/19 OK), python tools/test_setup_choices.py (50/50 OK), ./build/mmq_expert_bench executed on GPU 0 with zero errors. - Benchmark (RTX 2060 12 GB, Qwen3.8-Flash-Next IQ3_S, ~5.8K prompt tokens): - Time to first token (prompt latency): 14.1 s → 12.3 s (-1.8 s faster) - Bulk prefill speed: 509 tok/s → 606 tok/s (+19.2%) - Decode speed: identical (zero regression) Failed: None observed. Not run: Non-CUDA backends (HIP/Metal) - this is a CUDA sm_75 specific gate. Limits: Turing sm_75 only. Codebook formats run with ASTAGES_DEV=2 to stay within 64 KB shared memory. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:35:55 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4445
No description provided.