Skip to content

feat(linear-logp): add strict bitwise SM90 contract - #336

Merged
Flink-ddd merged 3 commits into
testfrom
codex/strict-bitwise-linear-logp
Aug 25, 2026
Merged

Flink-ddd merged 3 commits into
testfrom
codex/strict-bitwise-linear-logp

Conversation

@inaniloquentee

Copy link
Copy Markdown
Collaborator

Summary

  • freeze the SM90 fused linear_logp reduction contract so vocab splitting and reduction order no longer depend on batch shape, occupancy, or SM count
  • apply temperature at the same FP32 epilogue point, optionally return sampler logits, and mask padded vocabulary lanes out of the LSE
  • expose separate strict single-rank and tensor-parallel entry points while preserving the existing fast path
  • make TP LSE and selected-logit merges explicitly rank ordered and keep strict autograd mathematically correct

Refs #335

Validation

  • built the CUDA extension from source for CUDA 12.4 / SM90 with KERNEL_ALIGN_FORCE_SM90=1
  • python -m pytest tests/test_linear_logp.py -q (41 passed)
  • strict tests compare raw FP32 bit patterns across full-batch and single-row execution, return_logits modes, temperature, and padded-vocab masking
  • flake8 on changed Python files and git diff --check

@coderabbitai

coderabbitai Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cf87c042-daa0-4df1-90f3-a3e8d918ca52

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@Flink-ddd Flink-ddd added the platform: cuda Specific optimizations or bugs in NVIDIA graphics cards (such as FlashInfer, TMA optimizations) label Aug 24, 2026

@Flink-ddd Flink-ddd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maxiaosong1124
maxiaosong1124 self-requested a review August 25, 2026 03:40

@maxiaosong1124 maxiaosong1124 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: cuda Specific optimizations or bugs in NVIDIA graphics cards (such as FlashInfer, TMA optimizations)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants