Skip to content

[Incubated] Preserve scalar splat masks used by atomic RMW - #88

Open
Kaiwen1024 wants to merge 1 commit into
flagos-ai:mainfrom
Kaiwen1024:fix/atomic-splat-mask
Open

Kaiwen1024 wants to merge 1 commit into
flagos-ai:mainfrom
Kaiwen1024:fix/atomic-splat-mask

Conversation

@Kaiwen1024

Copy link
Copy Markdown

A scalar predicate splatted into a tensor mask was recognized as a memory mask for loads and stores, but not for tt.atomic_rmw. If the splat was shared by an indirect load and an atomic, MaskState::parseSplat consequently retained the full tensor extent and dropped the predicate for both accesses. For the one-element-block reproducer in flagos-ai/FlagTree#1383, two valid elements produced eight increments.

Recognize the atomic's mask operand in the existing memory-mask classification. The resulting subview and input slice have a predicate-dependent extent, including extent zero. Add FileCheck regressions for a load/atomic shared mask and an atomic-only vector mask.

Validation:

  • The exposed native triton-to-linalg-incubated pass and FileCheck pass for both regression modules; the same checks fail with the original library.
  • On Ascend910_9382 / CANN 9.1.0, the original N=2, BLOCK=1 reproducer changes from sum 8 to the expected sum 2. Existing BLOCK=4 and BLOCK=32 examples also pass.
  • 30 configurations (int32/float32, blocks 1/4/32, lengths 0/1/2/7/8), each exercising shared-mask and atomic-only kernels: 60 exact CPU-reference comparisons pass.
  • Repository pre-commit checks pass.

Hardware validation incrementally rebuilt this translation unit and relinked a private libtriton against an existing FlagTree Ascend build. The baseline translation unit is identical to current flir main; the shared installation was untouched.

@Kaiwen1024

Copy link
Copy Markdown
Author

Hi @zhzhcookie, gentle ping to review this scalar-splat mask preservation fix for tt.atomic_rmw (Refs flagos-ai/FlagTree#1383) when convenient. Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant