-
Notifications
You must be signed in to change notification settings - Fork 225
bazel: release target auto-compiles all ISAs and DPC++ by default #3537
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
base: main
Are you sure you want to change the base?
Changes from all commits
c8006a5
d9d2e59
09f5df2
05219a4
569c18a
9556c46
cc0f5e3
41905f3
7790488
c90a914
5a0a3f5
1f16ffe
a48eb1c
9939750
c79b954
5da8293
75014a9
6e92540
45faee3
cf4746e
9a220ba
a1d24f1
9e84eb3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||||
| package(default_visibility = ["//visibility:public"]) | ||||||||
|
|
||||||||
| exports_files([ | ||||||||
| "mkl_linkage_test.sh", | ||||||||
| "release_structure_test.sh", | ||||||||
| "isa_coverage_test.sh", | ||||||||
|
||||||||
| "isa_coverage_test.sh", | |
| "isa_coverage_test.sh", | |
| "mkl_linkage_test.sh", |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| #!/bin/sh | ||
| #=============================================================================== | ||
| # Copyright contributors to the oneDAL project | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| #=============================================================================== | ||
| # | ||
| # Verifies that libonedal_core.so contains CPU dispatch symbols for all | ||
| # required ISA variants: sse2, avx2, avx512 (CpuType E0/E4/E6). | ||
| # | ||
| # Make builds the required ISA variants by default. Building via //:release | ||
| # automatically compiles all ISA variants (cfg transition on release rule). | ||
| # This test enforces that contract. | ||
|
|
||
| set -eu | ||
|
|
||
| LIB="${1:-}" | ||
| if [ -z "${LIB}" ]; then | ||
| echo "Usage: $0 <path-to-libonedal_core.so>" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ ! -f "${LIB}" ]; then | ||
| echo "ERROR: Library not found: ${LIB}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! command -v nm >/dev/null 2>&1; then | ||
| echo "ERROR: nm not found on PATH" | ||
| exit 1 | ||
| fi | ||
|
|
||
| PASS=0 | ||
| FAIL=0 | ||
|
|
||
| check_isa() { | ||
| cpu_type="$1" # e.g. CpuTypeE4 | ||
| isa_name="$2" # e.g. avx2 | ||
| count=$(nm -D --defined-only "${LIB}" | grep -c "${cpu_type}" || true) | ||
| if [ "${count}" -gt 0 ]; then | ||
| echo " OK ${isa_name} (${cpu_type}): ${count} dispatch symbols" | ||
| PASS=$((PASS + 1)) | ||
| else | ||
| echo " FAIL ${isa_name} (${cpu_type}): 0 dispatch symbols found" | ||
| echo " Build via //:release (uses all ISAs via cfg transition) or pass --cpu=all" | ||
| FAIL=$((FAIL + 1)) | ||
| fi | ||
| } | ||
|
|
||
| echo "=== ISA coverage check: $(basename "${LIB}") ===" | ||
| check_isa "CpuTypeE0" "sse2" | ||
| check_isa "CpuTypeE4" "avx2" | ||
| check_isa "CpuTypeE6" "avx512" | ||
|
|
||
| echo "" | ||
| if [ "${FAIL}" -gt 0 ]; then | ||
| echo "RESULT: FAILED (${FAIL} ISA(s) missing, ${PASS} present)" | ||
| exit 1 | ||
| else | ||
| echo "RESULT: PASSED (all required ISA variants present)" | ||
| exit 0 | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description says CI workflows were updated to build with
--config=release, but this workflow was changed tobazel build :release --cpu=avx2. If the intent is to validate the new release behavior (all ISA variants) in CI, this should use the release config/behavior rather than restricting toavx2(or update the PR description accordingly).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow intentionally uses --cpu=avx2 for faster CI (documented in the inline comment above the bazel build line). The PR description was inaccurate — updated to clarify that CI overrides the ISA to avx2 for speed, while the //:release transition handles all ISAs when cpu is unset.