SIGN IN SIGN UP

FlashInfer: Kernel Library for LLM Serving

0 0 188 Python

fix: MNNVL Allreduce uses bitwise sentinel checking to avoid subnormal value issue (#3053) (#3304)

<!-- .github/pull_request_template.md -->

## ๐Ÿ“Œ Description

This PR fixed an inconsistency when polling communication buffer and
checking for sentinel value.

The old code does FP comparison with 0 and checks the sign bit to
determine whether the polled value is -0.0; The caveat is that when the
valid input contains a negative subnormal value, the FP comparison could
cause FTZ behavior and flush the valid input into negative zero, which
collides with the sentinel value and makes the kernel stuck at polling.

The solution is simple. This PR uses bitwise comparison to check if the
incoming value is negative zero, avoiding such subnormal flushing from
happening before polling.

Verified the mentioned hang issues reported in SGLang and VLLM can be
solved with this fix.

## ๐Ÿ” Related Issues

#3053 

also related to the issue
[vllm-project/vllm#35772](https://github.com/vllm-project/vllm/issues/35772)

## ๐Ÿš€ Pull Request Checklist

Thank you for contributing to FlashInfer! Before we review your pull
request, please make sure the following items are complete.

### โœ… Pre-commit Checks

- [x] I have installed `pre-commit` by running `pip install pre-commit`
(or used your preferred method).
- [x] I have installed the hooks with `pre-commit install`.
- [x] I have run the hooks manually with `pre-commit run --all-files`
and fixed any reported issues.

> If you are unsure about how to set up `pre-commit`, see [the
pre-commit documentation](https://pre-commit.com/).

## ๐Ÿงช Tests

- [x] Tests have been added or updated as needed.
- [x] All tests are passing (`unittest`, etc.).

## Reviewer Notes

<!-- Optional: anything you'd like reviewers to focus on, concerns, etc.
-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Strengthened negative-zero sentinel detection for FP32 by switching to
bit-exact matching and addressing GPU flush-to-zero edge cases to avoid
accidental sentinel matches and potential allreduce hangs.

* **Tests**
* Added a regression test that injects targeted sentinel patterns across
data types and fusion modes to guard against deadlocks and ensure robust
sentinel handling.

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/flashinfer-ai/flashinfer/pull/3304)
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
S
Shiyu Li committed
1a60071db81239d4b0e5f28cd0563acceba2c878
Parent: 103fcf8
Committed by GitHub <noreply@github.com> on 5/13/2026, 10:40:17 PM