Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

[NSE-927] Implement AVX512 optimization selection in Runtime and merge two C2R code files into one. #937

Merged

Conversation

zhixingheyi-tian
Copy link
Collaborator

@zhixingheyi-tian zhixingheyi-tian commented May 25, 2022

What changes were proposed in this pull request?

  • Implement AVX512 optimization selection in Runtime.
  • Merge two C2R code files into one.

How was this patch tested?

(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)

(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)

@github-actions
Copy link

Thanks for opening a pull request!

Could you open an issue for this pull request on Github Issues?

https://github.com/oap-project/native-sql-engine/issues

Then could you also rename commit message and pull request title in the following format?

[NSE-${ISSUES_ID}] ${detailed message}

See also:

@zhixingheyi-tian zhixingheyi-tian changed the title Branch runtime avxselection [NSE-927] Implement AVX512 optimization selection in Runtime and merge two C2R code files into one. May 25, 2022
@github-actions
Copy link

#927

@zhixingheyi-tian
Copy link
Collaborator Author

cc @FelixYBW

reminder_8x = _mm256_sub_epi32(x8_8x, reminder_8x);
reminder_8x = _mm256_and_si256(reminder_8x, x7_8x);
reminder_8x = _mm256_add_epi32(reminder_8x, length_8x);
__m256i dst_length_8x = _mm256_loadu_si256((__m256i*)length_data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here should be aligned load since we allocate length_data as 32B aligned

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

reminder_8x = _mm256_add_epi32(reminder_8x, length_8x);
__m256i dst_length_8x = _mm256_loadu_si256((__m256i*)length_data);
dst_length_8x = _mm256_add_epi32(dst_length_8x, reminder_8x);
_mm256_storeu_si256((__m256i*)length_data, dst_length_8x);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similarly, aligned store

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

__m256i x8_8x = _mm256_load_si256((__m256i*)x_8);
__m256i offsetarray_1_8x;
if (j + 16 < num_rows_) {
offsetarray_1_8x = _mm256_loadu_si256((__m256i*)&offsetarray[j]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fill an issue here. by default arrow should always allocate 64Byte aligned buffer

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@FelixYBW
Copy link
Collaborator

FelixYBW commented Jun 4, 2022

can you fix the bencharm issue in this PR as well?

gazelle_plugin/native-sql-engine/cpp/src/benchmarks/columnar_to_row_converter_benchmark.cc:36:10: fatal error: utils/memorypool.h: No such file or directory
   36 | #include "utils/memorypool.h"
      |          ^~~~~~~~~~~~~~~~~~~~

@zhixingheyi-tian zhixingheyi-tian force-pushed the branch_runtime_avxselection branch 3 times, most recently from a7d0a59 to b5c261e Compare June 5, 2022 12:49
@zhixingheyi-tian
Copy link
Collaborator Author

can you fix the bencharm issue in this PR as well?

gazelle_plugin/native-sql-engine/cpp/src/benchmarks/columnar_to_row_converter_benchmark.cc:36:10: fatal error: utils/memorypool.h: No such file or directory
   36 | #include "utils/memorypool.h"
      |          ^~~~~~~~~~~~~~~~~~~~

Have fixed in #936

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants