-
Notifications
You must be signed in to change notification settings - Fork 101
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
base: V2
Are you sure you want to change the base?
Conversation
"proper fix" - the fast twiddles must only be used with mixed radix ntt, so should be part of config and not decoupled or validated. But maybe it's late to refactor v2 for this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why print and not throw an exception?
icicle/src/ntt/kernel_ntt.cu
Outdated
// TODO: should throw exception | ||
// TODO: fast twiddles should be used only with mixed radix ntt | ||
// THROW_ICICLE_ERR(IcicleError_t::InvalidArgument, "log_size must be >= 4"); | ||
printf("warning: log_size must be at least 4, got %d\n", log_size); // TODO: logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"warning: when using fast twiddles, log_size must be at least 4..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
umm, throwing would be a breaking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add the following to init_domain() just before constructing the fast twiddles, to disable it from there rather than calling a function that seems to return success but doesn't do anything.
fast_twiddles_mode &= domain.max_log_size >= 4; // fast twiddles cannot be built for smaller domain
so this would solve one particular call to a |
@@ -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 |
There was a problem hiding this comment.
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
Describe the changes
This PR is a hotfix for ntt domains of log2 sizes < 4
Linked Issues
Resolves #