Skip to content

fix: Prevent OOB access from sentinel indices in atomic_rmw (closes #1335)#1353

Open
botbikamordehai2-sketch wants to merge 1 commit into
aws-neuron:masterfrom
botbikamordehai2-sketch:fix/issue-1335-1782216422
Open

fix: Prevent OOB access from sentinel indices in atomic_rmw (closes #1335)#1353
botbikamordehai2-sketch wants to merge 1 commit into
aws-neuron:masterfrom
botbikamordehai2-sketch:fix/issue-1335-1782216422

Conversation

@botbikamordehai2-sketch

Copy link
Copy Markdown

What

The bug occurs when using max-int sentinel indices in atomic_rmw operations. The current implementation passes the raw index to the hardware, which tries to perform an indirect memory access even for sentinel lanes before applying fill/drop semantics. This results in NRT_EXEC_OOB errors.

Fix

Added a sentinel mask that identifies lanes with indices equal to np.iinfo(np.int32).max. The safe_indices tensor replaces sentinel indices with 0 to avoid OOB memory accesses. The atomic_rmw now uses a predicate to skip sentinel lanes entirely, ensuring they never touch memory. This matches the expected fill/drop semantics where sentinel lanes should be ignored.

Closes #1335

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.

JAX indexed fill/drop semantics with max-int sentinel can execute OOB indirect memory accesses

1 participant