Skip to content

CSA: request ex2.approx.ftz through fastmath= so the compressor builds at the cutlass-dsl floor - #463

Merged
Anerudhan merged 1 commit into
NVIDIA:developfrom
zkyue:fix-460-exp2-fastmath
Jul 31, 2026
Merged

CSA: request ex2.approx.ftz through fastmath= so the compressor builds at the cutlass-dsl floor#463
Anerudhan merged 1 commit into
NVIDIA:developfrom
zkyue:fix-460-exp2-fastmath

Conversation

@zkyue

@zkyue zkyue commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

cute.math.exp2's approx/ftz keywords are newer than the
nvidia-cutlass-dsl[cu13]>=4.5.0 floor python/pyproject.toml resolves to, so the
ratio=128 compressor's fast-exp path raised TypeError: exp2() got an unexpected keyword argument 'approx' on any environment that installs that floor -- 14 failures
in test/python/fe_api/csa/test_CSA_compressor.py, all from this one call site (#460).

fastmath=True is accepted by both versions and lowers to the same
ex2.approx.ftz.f32 the r128 tolerance contract is calibrated on, so this is a pure
spelling change:

  • cutlass-dsl 4.5.0 before: 14 failed, 74 passed. After: 88 passed, 1 skipped.
  • cutlass-dsl 4.6.1 after: the 16-kernel reg_probe_csa_compressor_r128.py PTX is
    byte-identical to before this change -- same register counts, 0 spill / 0 stack, and
    1104 ex2.approx.ftz.f32 across the set -- so nothing changes on 4.6.
  • cutlass-dsl 4.5.0 after: the same 1104 ex2.approx.ftz.f32, and no no-.ftz
    ex2.approx.f32 anywhere.
  • gate_csa_compressor_r128.py: GATE PASS 21/21 on both 4.5.0 and 4.6.1.

Verified on B200 (CC 10.0), cuDNN 9.23, driver 590.48.01.

Signed-off-by: zky kaiyue.zhou@z.ai

This addresses the CSA half of #460 only (the 14 test_CSA_compressor.py failures attributed to b950af1). It does not touch the 25 wgrad failures from #456 -- those reproduce on 4.6.1 as well per the table in the issue, and cutlass.utils.rubin_helpers is a separate gap.

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility of the fast exponential calculation while preserving approximate, flush-to-zero behavior.
    • No user-facing API changes.

…s at the cutlass-dsl floor

``cute.math.exp2``'s ``approx``/``ftz`` keywords are newer than the
``nvidia-cutlass-dsl[cu13]>=4.5.0`` floor python/pyproject.toml resolves to, so the
ratio=128 compressor's fast-exp path raised ``TypeError: exp2() got an unexpected
keyword argument 'approx'`` on any environment that installs that floor -- 14 failures
in test/python/fe_api/csa/test_CSA_compressor.py, all from this one call site (NVIDIA#460).

``fastmath=True`` is accepted by both versions and lowers to the same
``ex2.approx.ftz.f32`` the r128 tolerance contract is calibrated on, so this is a pure
spelling change:

* cutlass-dsl 4.5.0 before: 14 failed, 74 passed. After: 88 passed, 1 skipped.
* cutlass-dsl 4.6.1 after: the 16-kernel reg_probe_csa_compressor_r128.py PTX is
  byte-identical to before this change -- same register counts, 0 spill / 0 stack, and
  1104 ex2.approx.ftz.f32 across the set -- so nothing changes on 4.6.
* cutlass-dsl 4.5.0 after: the same 1104 ex2.approx.ftz.f32, and no no-.ftz
  ex2.approx.f32 anywhere.
* gate_csa_compressor_r128.py: GATE PASS 21/21 on both 4.5.0 and 4.6.1.

Verified on B200 (CC 10.0), cuDNN 9.23, driver 590.48.01.

Signed-off-by: zky <kaiyue.zhou@z.ai>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 59978d4e-a85f-42dd-82e5-248c3f444fa9

📥 Commits

Reviewing files that changed from the base of the PR and between 968f1ef and d50f12e.

📒 Files selected for processing (1)
  • python/cudnn/csa/compressor/compressor_sm100_r128.py

📝 Walkthrough

Walkthrough

The _exp_fast function in compressor_sm100_r128.py now calls cute.math.exp2 with the fastmath=True keyword instead of approx=True, ftz=True. The compatibility comments are updated accordingly. The FMA-based exponent transformation logic remains unchanged.

Changes

exp2 invocation change

Layer / File(s) Summary
Update exp2 fastmath keyword
python/cudnn/csa/compressor/compressor_sm100_r128.py
Changes the exp2 call in _exp_fast from approx=True, ftz=True to fastmath=True and updates related comments.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested reviewers: anerudhan

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the CSA compressor change and the compatibility goal for the cutlass-dsl dependency floor.
Description check ✅ Passed The description explains the problem, solution, compatibility impact, issue scope, and detailed test results, despite not using the template headings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@Anerudhan Anerudhan added orig-external Reported or requested by an external user, customer, or community contributor. mod-cutedsl CuTeDSL kernels, generated kernels, examples, or related integration work. cat-enhancements labels Jul 31, 2026
@Anerudhan Anerudhan added this to the Frontend 1.27.0 milestone Jul 31, 2026
@Anerudhan
Anerudhan merged commit 1d2c4eb into NVIDIA:develop Jul 31, 2026
1 check passed
@Anerudhan Anerudhan mentioned this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat-enhancements mod-cutedsl CuTeDSL kernels, generated kernels, examples, or related integration work. orig-external Reported or requested by an external user, customer, or community contributor.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants