WIP: feat(probe-subop): normalized-key probe AArch64 SVE on HashAgg#566
Open
LeiRui wants to merge 1 commit into
Open
WIP: feat(probe-subop): normalized-key probe AArch64 SVE on HashAgg#566LeiRui wants to merge 1 commit into
LeiRui wants to merge 1 commit into
Conversation
Add env-gated BOLT_HASH_AGG_SVE_NORMALIZED_KEY_PROBE (default off) with 17B normalized-key table layout, SVE probe/insert TU on aarch64, non-aarch64 link stubs, HashAggregation/GroupingSet extension hooks, and HashTableTest parity coverage. Join hash tables (createForJoin / joinProbe) remain on native Bolt layout and probe; SVE applies only to HashAgg groupProbe. Co-authored-by: Old-Li883 <lichenhao9@huawei.com>
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
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.
What problem does this PR solve?
HashAgg with normalized-key hash tables can spend significant time in
groupNormalizedKeyProbeon AArch64. This PR adds an opt-in SVE vectorized probe/insert path (17-byte slot layout + tag region), wired through the aggregation hash-table factory, with scalar parity tests and non-aarch64 link stubs. Join hash tables (createForJoin/joinProbe) are unchanged and stay on native Bolt.Issue Number: N/A
Type of Change
Description
What
groupNormalizedKeyProbeSVE,insertForGroupBySve, 17B slot+tag table layout; scalar path usesBaseHashTable::NormalizedKeySlot(16B key+pointer, inHashTable.h).HashTableNormalizedKeyProbeSve.cpp(aarch64,-march=armv8-a+sve); stubsHashTableNormalizedKeyProbeStubs.cppon other platforms for link safety.HashTableSveRuntime.h:boltHashAggSveNormalizedKeyProbeEnabledFromEnv()+linuxAarch64RuntimeHasSve()(AT_HWCAP/HWCAP_SVE).HashAggregation::createGroupingSetForHashAggregation,GroupingSet::createAggregationHashTable— override point for customBaseHashTable/ env-driven table type without copyingHashAggregation.NormalizedKeyMode:kNativeBolt(default) /kScalar(16B slots) /kSve(17B+tag); Join build forceskNativeBoltviacreateForJoin(..., sve=false)andisJoinBuild_.Env opt-in (
BOLT_HASH_AGG_SVE_NORMALIZED_KEY_PROBE)kNativeBolt(same as upstream default)1true,yes, oron(ASCII, case-insensitive)10false,no, oroff(ASCII, case-insensitive)0Executor example (Gluten / Spark):
spark.executorEnv.BOLT_HASH_AGG_SVE_NORMALIZED_KEY_PROBE=1.Registration / runtime chain (HashAgg only)
createForAggregationdoes not callupdateNormalizedKeyModeForAggregation()directly; it only setssveNormalizedKeyProbeRequested_in the ctor. Mode is chosen later when the table switches toHashMode::kNormalizedKeyviasetHashMode(fromcheckSize/ analyze).Join (out of scope for SVE)
Flowchart — HashAgg probe mode (mermaid — click to expand)
flowchart TD A[groupProbe + kNormalizedKey] --> B[groupNormalizedKeyProbe] B --> C{normalizedKeyMode_} C -->|kScalar| D[groupNormalizedKeyProbeScalar] C -->|kSve| E[groupNormalizedKeyProbeSVE] C -->|kNativeBolt| F[ProbeState / fullProbe] G[createForJoin / joinProbe] --> H[kNativeBolt + joinNormalizedKeyProbe]File roles (HashTable + GroupingSet) (mermaid — click to expand)
flowchart TB subgraph hooks["Extension hooks"] HA["HashAggregation.h/cpp\ncreateGroupingSetForHashAggregation"] GS["GroupingSet.h/cpp\ncreateAggregationHashTable"] end subgraph hashtable["HashTable"] HT["HashTable.cpp / .h\ndispatch, allocateTables, insert"] RT["HashTableSveRuntime.h\nenv + HWCAP_SVE"] SVE["HashTableNormalizedKeyProbeSve.cpp\nSVE probe + insertForGroupBySve"] STUB["HashTableNormalizedKeyProbeStubs.cpp\nnon-aarch64"] end GS -->|env| RT GS --> HT HA --> GS HT --> SVE HT --> STUB classDef prNew fill:#d4edda,stroke:#28a745,stroke-width:2px,color:#000 classDef prModified fill:#fff3cd,stroke:#ffc107,stroke-width:2px,color:#000 class SVE,STUB,RT prNew class HT,HA,GS prModifiedLegend: green = new; yellow = modified.
GroupingSet::createAggregationHashTablecreateForAggregation(..., sveFlag). Override for plugin/custom table.HashTableSveRuntime.hlinuxAarch64RuntimeHasSve()on Linux aarch64.HashTablectorsveNormalizedKeyProbeRequested_fromcreateForAggregation(..., sveFlag).setHashMode(kNormalizedKey)→updateNormalizedKeyModeForAggregationkSve/kScalar/kNativeBolt; Join build → alwayskNativeBolt.allocateTables/clear/insertForGroupByinsertForGroupBySvewhenkSve.groupNormalizedKeyProbeHashTableNormalizedKeyProbeSve.cppHashTableNormalizedKeyProbeStubs.cppBOLT_FAILif called.createForJoinsveNormalizedKeyProbeEnabled=false;joinProbeunchanged.Tests
HashTableTest.boltHashAggSveNormalizedKeyProbeEnv— env parser (setenv/ unset /0/1)HashTableTest.normalizedKeySveMatchesScalar—#if __aarch64__ && __linux__: helper setskSvevskScalar, compares probehits;GTEST_SKIPif no runtime SVEmake unittest_release TEST=bbolt_exec_test \ TEST_ARGS='--gtest_filter=HashTableTest.boltHashAggSveNormalizedKeyProbeEnv:HashTableTest.normalizedKeySveMatchesScalar*'Performance Impact
Release Note
Please describe the changes in this PR
Release Note:
Checklist (For Author)
Breaking Changes