Skip to content

fix: implement physical slot replication for bicyclic and tricyclic layout after - #3247

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_953525822
Aug 11, 2026
Merged

fix: implement physical slot replication for bicyclic and tricyclic layout after#3247
copybara-service[bot] merged 1 commit into
mainfrom
test_953525822

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

fix: implement physical slot replication for bicyclic and tricyclic layout after
matrix multiplication.

In the bicyclic layout, we require for each 0 <= slot < numSlot, (ct, slot) is
mapped to (slot % n, slot % m). However, after computing through BSGS we can only
guarantee for all 0 <= slot < nm this property preserves (indeed we can guarantee
more, but for the tail part it is not correct if n
m does not divide numSlot).

In this commit, we add a new relation called periodic replication relation
that replicate the first copy to all slots periodically. After each matrix
multiplication with CRT layouts (bicyclic, tricyclic), we compose this relation
to derive the result.

The cost of the layout switching will be up to logN rotations.

@copybara-service
copybara-service Bot force-pushed the test_953525822 branch 5 times, most recently from a709ba3 to 1f69e80 Compare July 27, 2026 23:11
@copybara-service
copybara-service Bot force-pushed the test_953525822 branch 3 times, most recently from 84299f6 to 6d6cb08 Compare August 11, 2026 20:26
…ayout after

matrix multiplication.

In the bicyclic layout, we require for each 0 <= slot < numSlot, (ct, slot) is
mapped to (slot % n, slot % m). However, after computing through BSGS we can only
guarantee for all 0 <= slot < n*m this property preserves (indeed we can guarantee
more, but for the tail part it is not correct if n*m does not divide numSlot).

In this commit, we add a new relation called `periodic replication relation`
that replicate the first copy to all slots periodically. After each matrix
multiplication with CRT layouts (bicyclic, tricyclic), we compose this relation
to derive the result.

The cost of the layout switching will be up to logN rotations.

PiperOrigin-RevId: 962982741
@copybara-service
copybara-service Bot merged commit f23b772 into main Aug 11, 2026
@copybara-service
copybara-service Bot deleted the test_953525822 branch August 11, 2026 20:58
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