Skip to content

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

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_953525822
Open

fix: implement physical slot replication for bicyclic and tricyclic layout after#3247
copybara-service[bot] wants to merge 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 4 times, most recently from 35a6dd4 to a709ba3 Compare July 27, 2026 20:04
…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: 953525822
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