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

Remove parameter perm_inv. perm_inv overcomplex the process for gener… #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zpcore
Copy link

@zpcore zpcore commented Oct 10, 2022

We are generating the arena array to jump between different data segment/stride. Array perm tells which segment (stride) to choose and array mixer tells which element in each segment (stride) we are going to use. Below is simplified the example with nr_elts=6:
perm: 2 3 1 0 4 5.

The final goal is to build jumping in arena array: Segment 2-> segment 3 -> segment 1 -> segment 0 -> segment 4 -> segment 5.
With perm_inv, we will build the jumping data in arena with the following sequence:
segment 0 -> segment 4,
segment 1 -> segment 0,
segment 2 -> segment 3,
segment 3 -> segment 1,
segment 4 -> segment 5,
segment 5 -> segment 2.

Actually it is unnecessary to follow the construction order from 0 to 5. We can just loop through perm and build the jumping data directly:
segment 2 -> segment 3,
segment 3 -> segment 1,
segment 1 -> segment 0,
segment 0 -> segment 4,
segment 4 -> segment 5,
segment 5 -> segment 2.

Both solution will result in the same arena data content but with different sequence to fill the arena array.

Thus we can remove the perm_inv to simplify the code logic for generating the arena array, which also reduces the memory usage.

Results have been verified with puj2@.

@google-cla
Copy link

google-cla bot commented Oct 10, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@zpcore
Copy link
Author

zpcore commented Feb 17, 2024

Ping to see if anyone can help review the PR.

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.

1 participant