Skip to content

layout: relax layout conditions to lower halevi-shoup kernel#2313

Merged
copybara-service[bot] merged 1 commit intomainfrom
test_820235341
Oct 16, 2025
Merged

layout: relax layout conditions to lower halevi-shoup kernel#2313
copybara-service[bot] merged 1 commit intomainfrom
test_820235341

Conversation

@copybara-service
Copy link
Contributor

layout: relax layout conditions to lower halevi-shoup kernel

Before, we restricted convert-to-ciphertext-semantics to only lowering to the halevi-shoup kernel if the layouts on the matrix were exactly the diagonalized layout for the matrix and the row major layout for the vector. however, layout optimization may tweak the layouts of the matrix and vector and still preserve functionality of the kernel (e.g. by simultaneously swapping columns of the matrix and entries of the vector). These should be enforced by the rectify layout code in layout-optimization.

So this removes the exact layout conditions on the pass and instead only enforces that the bare minimum conditions are satisfied in order to use a halevi-shoup kernel (e.g. the dimensions are power of two, the column dimension lines up with the vector size, etc).

@copybara-service copybara-service bot force-pushed the test_820235341 branch 2 times, most recently from a9a25c7 to 9759079 Compare October 16, 2025 19:43
Before, we restricted convert-to-ciphertext-semantics to only lowering to the halevi-shoup kernel if the layouts on the matrix were exactly the diagonalized layout for the matrix and the row major layout for the vector. however, layout optimization may tweak the layouts of the matrix and vector and still preserve functionality of the kernel (e.g. by simultaneously swapping columns of the matrix and entries of the vector). These should be enforced by the rectify layout code in layout-optimization.

So this removes the exact layout conditions on the pass and instead only enforces that the bare minimum conditions are satisfied in order to use a halevi-shoup kernel (e.g. the dimensions are power of two, the column dimension lines up with the vector size, etc).

PiperOrigin-RevId: 820366527
@copybara-service copybara-service bot merged commit 2133695 into main Oct 16, 2025
@copybara-service copybara-service bot deleted the test_820235341 branch October 16, 2025 20:15
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