Skip to content

Flavio/refactor docs and tutorial #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions kerngen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,29 +104,25 @@ All other commands are assumed to be operations. All operations are case
insensitive, but the convention we use is the operations are capitalized. These
are defined in the [manifest.json](./pisa_generators/manifest.json) file.
```
CONTEXT BGV 8192 4
CONTEXT BGV 8192 4 3
DATA a 2
DATA b 2
DATA c 2
ADD c a b
```

## CONTEXT
Context defines the global properties `(scheme, poly_order, max_rns,
key_rns(optional))` of the input script.
Context defines the global properties `(scheme, poly_ring_dimension, max_rns,
current_rns)` of the input script.
`CONTEXT` sets a global context for properties required by the kernels.
- first field defines what we call scheme. In reality, it specifies the set of
kernel instructions given in the manifest file, see
[manifest.json](./pisa_generators/manifest.json).
- second field defines the polynomial size for the `DATA`. This is required by
the generating kernels to define how many units (multiples of the native polynomial
size, 8192 in HERACLES silicon case) are required and handled.
- third field defines the max RNS, the global max number of how many 32 bit prime number moduli
(HERACLES silicon case) are in the modulus chain that the kernels can have or need to handle.
- (optional) fourth field defines the key RNS, the number of additional moduli
that the relinearization key has relative to the third field. i.e. If `max_rns`
is 3 and `key_rns` is 1 the total max RNS of the relinearization key will be 4.
Note this field is only required for calling the `relin` kernel.
- third field defines the key RNS, i.e. the total max RNS of the relinearization key, typically the global max number of how many 32 bit prime number moduli (HERACLES silicon case) are in the modulus chain that the kernels can have or need to handle + 1.
- fourth field defines the number of RNS terms in the current polynomial.

## DATA
`DATA` defines polynomial symbols to be used and their attribute(s) (`num_parts`) where
Expand Down
Empty file modified kerngen/kerngen.py
100755 → 100644
Empty file.
5 changes: 0 additions & 5 deletions kerngen/tutorials/SimpleExamples/ADD_8K1rns.ker

This file was deleted.

5 changes: 0 additions & 5 deletions kerngen/tutorials/SimpleExamples/ADD_8K4rns.ker

This file was deleted.

5 changes: 0 additions & 5 deletions kerngen/tutorials/SimpleExamples/ADD_C8K1rns.ker

This file was deleted.

5 changes: 0 additions & 5 deletions kerngen/tutorials/SimpleExamples/ADD_C8K4rns.ker

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONTEXT BGV 16384 1
CONTEXT BGV 16384 2 1
DATA a 1
DATA b 1
DATA c 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONTEXT BGV 16384 4
CONTEXT BGV 16384 5 4
DATA a 1
DATA b 1
DATA c 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONTEXT BGV 16384 1
CONTEXT BGV 16384 2 1
# inputs
DATA a 2
DATA b 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONTEXT BGV 16384 4
CONTEXT BGV 16384 5 4
DATA a 2
DATA b 2
DATA c 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONTEXT BGV 16384 1 1
CONTEXT BGV 16384 2 1
DATA a 2
DATA b 2
DATA c 3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONTEXT BGV 16384 1 1
CONTEXT BGV 16384 2 1
DATA a 3
DATA b 2
RELIN b a