Skip to content
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

hotfix for slow twiddles on small domain sizes #557

Open
wants to merge 4 commits into
base: V2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions icicle/src/ntt/kernel_ntt.cu
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,11 @@ namespace mxntt {
{
CHK_INIT_IF_RETURN();

if (log_size < 4) {
// TODO: fast twiddles should be used only with mixed radix ntt
THROW_ICICLE_ERR(IcicleError_t::InvalidArgument, "when using fast twiddles, log_size must be at least 4");
}

S* w6_table;
S* w12_table;
S* w18_table;
Expand Down
2 changes: 2 additions & 0 deletions icicle/src/ntt/ntt.cu
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,8 @@ namespace ntt {
CHK_IF_RETURN(mxntt::generate_external_twiddles_generic(
primitive_root, domain.twiddles, domain.internal_twiddles, domain.basic_twiddles, domain.max_log_size,
ctx.stream));

fast_twiddles_mode &= domain.max_log_size >= 4; // fast twiddles cannot be built for smaller domain
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the user will think he is using fast twiddles but he isn't? why not just have the exception? or at least add a print in this case


if (fast_twiddles_mode) {
// generating fast-twiddles (note that this cost 4N additional memory)
Expand Down
Loading