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

Randomize new partner rather than run whole process #264

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kanin-kearpimy
Copy link

@kanin-kearpimy kanin-kearpimy commented Mar 12, 2024

Hi, I noticed this process is possibly slowing down compilation time.

TLDR;

You can jump to (3) for more clarification.

Background

In the mutation of permutation, CryptOpt finds the range of independent operators. Each range is defined by minimum & maximum (min & max).

range

Then, the Optimizer selects chosen and partner between [min, max] range for instruction scheduling. It results in three possibilities.

  1. There is only one operator in the range (min == max). So, it must pick up another range by re-permutation.
range1
  1. The operators in the range are only two operators (min + 1 == max). The optimizer can switch between min & max.
range 2
  1. More than 2 choices in operators (max - min > 2). In case chosen and partner are same elements, the current program decides to run the whole permutation process. I think this will slow down the mutation time.

Solution: Instead, we are able to randomize another potential partner in the same range.

range 3

@kanin-kearpimy kanin-kearpimy marked this pull request as draft March 13, 2024 05:12
@kanin-kearpimy kanin-kearpimy deleted the featuer/randomize-new-partner-rather-than-run-whole-process branch March 13, 2024 05:14
@dderjoel
Copy link
Collaborator

I like the idea, but before we fix something that potentially speeds up something, I wonder if this actually makes things faster. Would you be able to benchmark both versions?

Also, as far as I know it is "TLDR: Too long, didn't read", not TLRD.

Also, I do not understand those intervals in the illustrations. Which instruction is 'chosen' in those pictures?

@kanin-kearpimy kanin-kearpimy restored the featuer/randomize-new-partner-rather-than-run-whole-process branch March 23, 2024 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants