Skip to content

fix div_tensor_mode accuracy failure on mthreads backends - #5454

Merged
huangyiqun merged 1 commit into
flagos-ai:fix_backends_bugfrom
lyujheng:mthreads/fixbug_div_tensor_mode
Aug 14, 2026
Merged

fix div_tensor_mode accuracy failure on mthreads backends#5454
huangyiqun merged 1 commit into
flagos-ai:fix_backends_bugfrom
lyujheng:mthreads/fixbug_div_tensor_mode

Conversation

@lyujheng

Copy link
Copy Markdown
Contributor

PR Category

OP Test

Type of Change

Bug Fix

Description

Changed accuracy test file of div_tensor_mode, relaxed atol from 1e-4 to 1.0 for test_div_tensor_mode_float when rounding_mode is trunc or floor, reference runs on CPU (--ref cpu), and backend is mthreads.

case:
When the quotient a/b is extremely close to an integer boundary (e.g., 7.9999999 vs 8.0000001), a 1-ULP difference in float32 division between the mthreads GPU and CPU implementations gets amplified to ±1.0 after trunc/floor truncation. This is inherent floating-point behavior with discontinuous rounding functions, not an operator bug.

Issue

N/A

Progress

  • Change is properly reviewed (1 reviewer required, 2 recommended).
  • Change is responded to an issue.
  • [√] Change is fully covered by a UT.

Performance

image

Accuracy

image image

@huangyiqun
huangyiqun merged commit 0248209 into flagos-ai:fix_backends_bug Aug 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants