-
Notifications
You must be signed in to change notification settings - Fork 25
Add Runtime dispatch based on custom CPU capabilities function #607
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
Draft
willieyz
wants to merge
11
commits into
main
Choose a base branch
from
runtime-dispatch
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6332a01 to
b0ac532
Compare
This was referenced Nov 4, 2025
74996f5 to
3e7a817
Compare
willieyz
added a commit
that referenced
this pull request
Nov 10, 2025
- This commit adds EC2 functional tests for mldsa-native, similar to what we have in mlkem-native. - Unlike other functional tests that run on GitHub runners, the EC2 tests provide a bit more flexibility and control over the actual CPU architecture being tested. - During this work, we found that the CI did not raise an error when specifying a config_variations value that does not exist. For example, the previous commit passed several non-existent config headers from PR #607, which has not been merged yet. The CI silently accepted these missing configurations without any error. - Since the configuration header from PR #607 is not yet merged, we temporarily comment out the config_variations parameter. Once PR #607 is ported, we will re-enable it. - We also plan to add test ID validation, similar to mlkem-native PR #1291, to prevent false-positive test results caused by invalid configuration entries. Signed-off-by: willieyz <[email protected]>
willieyz
added a commit
that referenced
this pull request
Nov 11, 2025
- This commit adds EC2 functional tests for mldsa-native, similar to what we have in mlkem-native. - Unlike other functional tests that run on GitHub runners, the EC2 tests provide a bit more flexibility and control over the actual CPU architecture being tested. - During this work, we found that the CI did not raise an error when specifying a config_variations value that does not exist. For example, In this commit, We passed several non-existent config headers from PR #607, which has not been merged yet. The CI silently accepted these missing configurations without any error. - Since the configuration header from PR #607 is not yet merged, we temporarily comment out the config_variations parameter. Once PR #607 is ported, we will re-enable it. - We also plan to add test ID validation, similar to mlkem-native PR #1291, to prevent false-positive test results caused by invalid configuration entries. Signed-off-by: willieyz <[email protected]>
willieyz
added a commit
that referenced
this pull request
Nov 11, 2025
- This commit adds EC2 functional tests for mldsa-native, similar to what we have in mlkem-native. - Unlike other functional tests that run on GitHub runners, the EC2 tests provide a bit more flexibility and control over the actual CPU architecture being tested. - During this work, we found that the CI did not raise an error when specifying a config_variations value that does not exist. For example, In this commit, We passed several non-existent config headers from PR #607, which has not been merged yet. The CI silently accepted these missing configurations without any error. - Since the configuration header from PR #607 is not yet merged, we temporarily comment out the config_variations parameter. Once PR #607 is ported, we will re-enable it. - We also plan to add test ID validation, similar to mlkem-native PR #1291, to prevent false-positive test results caused by invalid configuration entries. Signed-off-by: willieyz <[email protected]>
mkannwischer
pushed a commit
that referenced
this pull request
Nov 11, 2025
- This commit adds EC2 functional tests for mldsa-native, similar to what we have in mlkem-native. - Unlike other functional tests that run on GitHub runners, the EC2 tests provide a bit more flexibility and control over the actual CPU architecture being tested. - During this work, we found that the CI did not raise an error when specifying a config_variations value that does not exist. For example, In this commit, We passed several non-existent config headers from PR #607, which has not been merged yet. The CI silently accepted these missing configurations without any error. - Since the configuration header from PR #607 is not yet merged, we temporarily comment out the config_variations parameter. Once PR #607 is ported, we will re-enable it. - We also plan to add test ID validation, similar to mlkem-native PR #1291, to prevent false-positive test results caused by invalid configuration entries. Signed-off-by: willieyz <[email protected]>
mkannwischer
added a commit
that referenced
this pull request
Nov 12, 2025
Previously the native chknorm functions would follow the C implementation, i.e., return 0 if all coefficients are within bound and 0xFFFFFFFF otherwise. This leads to problems with the run-time dispatch in #607 as we want to use -1 to signal that the current platforms lacks the required capabilities to run the native code, and we should fall back to the C implementation. This commit changes the backend API to return 1 in the failure mode. This will allow to implement the run-time dispatch.
mkannwischer
added a commit
that referenced
this pull request
Nov 12, 2025
Previously the native chknorm functions would follow the C implementation, i.e., return 0 if all coefficients are within bound and 0xFFFFFFFF otherwise. This leads to problems with the run-time dispatch in #607 as we want to use -1 to signal that the current platforms lacks the required capabilities to run the native code, and we should fall back to the C implementation. This commit changes the backend API to return 1 in the failure mode. This will allow to implement the run-time dispatch. Signed-off-by: Matthias J. Kannwischer <[email protected]>
mkannwischer
added a commit
that referenced
this pull request
Nov 12, 2025
Previously the native chknorm functions would follow the C implementation, i.e., return 0 if all coefficients are within bound and 0xFFFFFFFF otherwise. This leads to problems with the run-time dispatch in #607 as we want to use -1 to signal that the current platforms lacks the required capabilities to run the native code, and we should fall back to the C implementation. This commit changes the backend API to return 1 in the failure mode. This will allow to implement the run-time dispatch. Signed-off-by: Matthias J. Kannwischer <[email protected]>
mkannwischer
added a commit
that referenced
this pull request
Nov 12, 2025
Previously the native chknorm functions would follow the C implementation, i.e., return 0 if all coefficients are within bound and 0xFFFFFFFF otherwise. This leads to problems with the run-time dispatch in #607 as we want to use -1 to signal that the current platforms lacks the required capabilities to run the native code, and we should fall back to the C implementation. This commit changes the backend API to return 1 in the failure mode. This will allow to implement the run-time dispatch. Signed-off-by: Matthias J. Kannwischer <[email protected]>
hanno-becker
pushed a commit
that referenced
this pull request
Nov 12, 2025
Previously the native chknorm functions would follow the C implementation, i.e., return 0 if all coefficients are within bound and 0xFFFFFFFF otherwise. This leads to problems with the run-time dispatch in #607 as we want to use -1 to signal that the current platforms lacks the required capabilities to run the native code, and we should fall back to the C implementation. This commit changes the backend API to return 1 in the failure mode. This will allow to implement the run-time dispatch. Signed-off-by: Matthias J. Kannwischer <[email protected]>
hanno-becker
pushed a commit
that referenced
this pull request
Nov 12, 2025
Previously the native chknorm functions would follow the C implementation, i.e., return 0 if all coefficients are within bound and 0xFFFFFFFF otherwise. This leads to problems with the run-time dispatch in #607 as we want to use -1 to signal that the current platforms lacks the required capabilities to run the native code, and we should fall back to the C implementation. This commit changes the backend API to return 1 in the failure mode. This will allow to implement the run-time dispatch. Signed-off-by: Matthias J. Kannwischer <[email protected]>
hanno-becker
pushed a commit
that referenced
this pull request
Nov 12, 2025
Previously the native chknorm functions would follow the C implementation, i.e., return 0 if all coefficients are within bound and 0xFFFFFFFF otherwise. This leads to problems with the run-time dispatch in #607 as we want to use -1 to signal that the current platforms lacks the required capabilities to run the native code, and we should fall back to the C implementation. This commit changes the backend API to return 1 in the failure mode. This will allow to implement the run-time dispatch. Signed-off-by: Matthias J. Kannwischer <[email protected]>
…te_bitrev_to_custom) - Change mld_ntt_native() return type from void to int - Add runtime capability checking with fallback support - Implement dispatch logic in mld_poly_ntt() to try native first, fallback to C - Add MLD_NATIVE_FUNC_SUCCESS/FALLBACK return codes - Add mld_sys_check_capability() for system capability detection - Add test configuration for AVX2, static ON/OFF, add to CI test. Signed-off-by: willieyz <[email protected]>
…a4_native) Signed-off-by: willieyz <[email protected]>
Signed-off-by: willieyz <[email protected]>
Signed-off-by: willieyz <[email protected]>
Signed-off-by: willieyz <[email protected]>
Signed-off-by: willieyz <[email protected]>
Signed-off-by: willieyz <[email protected]>
Signed-off-by: willieyz <[email protected]>
…native) Signed-off-by: willieyz <[email protected]>
Signed-off-by: willieyz <[email protected]>
b1a6654 to
dc8208e
Compare
Signed-off-by: willieyz <[email protected]>
willieyz
added a commit
that referenced
this pull request
Nov 14, 2025
- This commit temporary add MLD_NATIVE_FUNC_SUCCESS to exception, this macro will introduced after PR #607, remove after it merged. - This commit re-run autogen Signed-off-by: willieyz <[email protected]>
willieyz
added a commit
that referenced
this pull request
Nov 14, 2025
- This commit temporary add MLD_NATIVE_FUNC_SUCCESS to exception, this macro will introduced after PR #607, remove after it merged. - This commit re-run autogen Signed-off-by: willieyz <[email protected]>
willieyz
added a commit
that referenced
this pull request
Nov 14, 2025
- This commit temporary add MLD_NATIVE_FUNC_SUCCESS to exception, this macro will introduced after PR #607, remove after it merged. - This commit re-run autogen Signed-off-by: willieyz <[email protected]>
willieyz
added a commit
that referenced
this pull request
Nov 14, 2025
- This commit temporary add MLD_NATIVE_FUNC_SUCCESS to exception, this macro will introduced after PR #607, remove after it merged. - This commit re-run autogen Signed-off-by: willieyz <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is still working in progress:
Ported:
Not yet ported:
ec2_functests are not included in CI yet, since this section does not exist in mldsa-native. We have already opened Add ec2_functests in ci.yml #608 and will port it in a separate PR before finalizing this one.There is currently a constant-time leak issue due to the runtime dispatch change in
mld_poly_chknorm:mldsa-native/mldsa/src/poly.c
Lines 589 to 604 in 05ad5ed
This has been discussed with @mkannwischer, and asking for help to add the fix.