-
Notifications
You must be signed in to change notification settings - Fork 231
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
feat(math): implement (I)FFT #71
Conversation
bcd48d2
to
6cf315f
Compare
I think |
f2428a9
to
9b3d8fb
Compare
Could you please separate file relocations from commit |
Plus, you forgot to update include guard macro. |
tachyon/math/polynomial/domains/radix2/radix2_evaluation_domain_unittest.cc
Outdated
Show resolved
Hide resolved
tachyon/math/polynomial/domains/radix2/radix2_evaluation_domain_unittest.cc
Outdated
Show resolved
Hide resolved
tachyon/math/polynomial/domains/radix2/radix2_evaluation_domain_unittest.cc
Outdated
Show resolved
Hide resolved
tachyon/math/polynomial/domains/radix2/radix2_evaluation_domain_unittest.cc
Outdated
Show resolved
Hide resolved
tachyon/math/polynomial/domains/radix2/radix2_evaluation_domain_unittest.cc
Outdated
Show resolved
Hide resolved
1c120af
to
954eb49
Compare
When seeing the commit body of |
tachyon/math/polynomial/polynomials/univariate/univariate_polynomial.h
Outdated
Show resolved
Hide resolved
tachyon/math/polynomial/polynomials/univariate/dense_coefficients.h
Outdated
Show resolved
Hide resolved
tachyon/math/polynomial/domains/radix2/radix2_evaluation_domain.h
Outdated
Show resolved
Hide resolved
tachyon/math/polynomial/domains/mixed_radix/mixed_radix_evaluation_domain.h
Outdated
Show resolved
Hide resolved
tachyon/math/polynomial/domains/mixed_radix/mixed_radix_evaluation_domain.h
Outdated
Show resolved
Hide resolved
tachyon/math/polynomial/domains/mixed_radix/mixed_radix_evaluation_domain.h
Outdated
Show resolved
Hide resolved
1b34765
to
064e820
Compare
tachyon/math/polynomial/domains/radix2/radix2_evaluation_domain.h
Outdated
Show resolved
Hide resolved
tachyon/math/polynomial/domains/mixed_radix/mixed_radix_evaluation_domain.h
Outdated
Show resolved
Hide resolved
tachyon/math/polynomial/domains/mixed_radix/mixed_radix_evaluation_domain_unittest.cc
Outdated
Show resolved
Hide resolved
tachyon/math/polynomial/domains/radix2/radix2_evaluation_domain_unittest.cc
Outdated
Show resolved
Hide resolved
bb1c22a
to
1e034f9
Compare
33e7f05
to
85ce232
Compare
3a756e2
to
129d947
Compare
This gives a better performance if the type `T` meets some conditions and can be implemented with fewer lines. See https://google.github.io/styleguide/cppguide.html#noexcept
There are multiple definitions of `SparseCoefficients` in `univaraite/sparse_coefficients.h` and `multivariate/sparse_coefficients.h`. This prevents symbol conflict by adding prefix `Multivariate` and `Univariate` respectively. In addition, this renames followings in a similar way. - `SparseUnivaraitePolynomial` -> `UnivariateSparsePolynomial` - `DenseUnivariatePolynomial` -> `UnivariateDensePolynomial` - `SparseMultivariatePolynomial` -> `MultivariateSparsePolynomial` - `DenseCoefficients` -> `UnivariateDenseCoefficients`
This computes quotient and remainder for polynomial at once.
30bf59d
to
cfa90ec
Compare
LGTM |
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.
LGTM
tachyon/math/polynomials/univariate/mixed_radix_evaluation_domain.h
Outdated
Show resolved
Hide resolved
To test `MixedRadixEvaluationDomain` we need a prime field such that `MixedRadixEvaluationDomain` is constructable. Existing prime fields does not fit to construct `MixedRadixEvaluationDomain`, so bn384_small_two_adicity is added.
We have to use `omp_get_max_threads()` to adjust thread nums by such environment variable `OMP_NUM_THREADS`. See https://www.openmp.org/spec-html/5.0/openmpse50.html
cfa90ec
to
8fc2359
Compare
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.
LGTM
8fc2359
to
a6a6b39
Compare
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.
LGTM
Description
This PR implements (I)FFT over dense univariate polynomial.
To do (I)FFT over a polynomial, an evaluation domain must exist, so this PR also implements evaluation domains. Evaluation domain is basically a domain over which finite field (I)FFTs can be performed.
GeneralEvaluationDomain
is a wrapper overRadix2EvaluationDomain
andMixedRadixEvaluationDomain
where it generally tries to build aRadix2EvaluationDomain
and falls back to aMixedRadixEvaluationDomain
if the radix-2 multiplicative subgroup is too small.Radix2EvaluationDomain
is anEvaluationDomain
for performing various kinds of polynomial arithmetic on top of fields that are FFT-friendly.Radix2EvaluationDomain
supports (I)FFTs of size at most 2^two-adicity.MixedRadixEvaluationDomain
is anEvaluationDomain
for performing various kinds of polynomial arithmetic on top of fields that are FFT-friendly but do not have high-enough two-adicity to perform the FFT efficiently.MixedRadixEvaluationDomain
resolves this issue by using a larger subgroup obtained by combining G with another subgroup of sizeF::Config::kSmallSubgroupBase
^F::Config::kSmallSubgroupAdicity
, to obtain a subgroup generated byF::Config::kLargeSubgroupRootOfUnity
.