Skip to content

Conversation

@AntonOresten
Copy link
Contributor

@AntonOresten AntonOresten commented Jan 24, 2026

Currently there only exists scalar methods for atomic operations. This PR adds more methods for parity with Python, plus convenience methods to make e.g. atomic addition through ct.atomic_add as simple as ct.store, using tile-space indices (tuple of indices) that get converted and broadcasted to index tiles. This would be particularly convenient for the backward pass of Multi-Head Attention with query groups (see #16), but I'm ok with removing it if it is deemed unnecessary.

Since the atomic methods work with indices in tiles, I added broadcasting methods to allow the broadcasted One to be used on integer tiles.

Also adds tests for 2D gather/scatter that I should've added in #23.

Closes #50

@AntonOresten AntonOresten marked this pull request as draft January 25, 2026 12:39
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.

Tile-wise atomic operations

1 participant