Fix SCHE_0 threadIdx.y/z, block_size 3D, shfl idx/xor, C++ shfl wrapp… #96
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
| # Copyright © 2019-2025 | |
| # | |
| # 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. | |
| # | |
| # Modified from Vortex CI by Aaron Kantsevoy (akantsevoy3@gatech.edu) | |
| name: CI | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout Repositoty | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| clean: false | |
| - name: Run Sbatch file | |
| run: chmod +x ./ci/run-crnch-cuda.sh && sbatch --wait --export=ALL ./ci/run-crnch-cuda.sh | |
| tests: | |
| runs-on: self-hosted | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| name: [backprop, dotproduct, pathfinder, psum, bfs, btree, conv3, nn, saxpy, sgemm, stencil, transpose, vecadd, bh-cuda, blackscholes, cc-cuda, cfd, gauss, hotspot, huffman, jaccard-cuda, jacobi-cuda, lud, marchingCubes-cuda, nw, psort, score-cuda, sfilter, spmv, srad_v2, streamcluster, wedford-cuda, sgemm_tcu, sgemm_dxa, sgemm_tcu_dxa] | |
| scheduler: [2, 0] | |
| localmem: [1] | |
| exclude: | |
| # TCU/DXA benchmarks only run on SCHE_2 (require parallel threads) | |
| - name: sgemm_tcu | |
| scheduler: 0 | |
| - name: sgemm_dxa | |
| scheduler: 0 | |
| - name: sgemm_tcu_dxa | |
| scheduler: 0 | |
| include: | |
| # SCHE_2 + LOCALMEM=0 for shared memory benchmarks | |
| - name: bh-cuda | |
| scheduler: 2 | |
| localmem: 0 | |
| - name: cc-cuda | |
| scheduler: 2 | |
| localmem: 0 | |
| - name: hotspot | |
| scheduler: 2 | |
| localmem: 0 | |
| - name: jaccard-cuda | |
| scheduler: 2 | |
| localmem: 0 | |
| - name: jacobi-cuda | |
| scheduler: 2 | |
| localmem: 0 | |
| - name: marchingCubes-cuda | |
| scheduler: 2 | |
| localmem: 0 | |
| - name: score-cuda | |
| scheduler: 2 | |
| localmem: 0 | |
| - name: wedford-cuda | |
| scheduler: 2 | |
| localmem: 0 | |
| # Previous temporary config (new benchmarks only): | |
| # name: [bh-cuda, blackscholes, cc-cuda, cfd, gauss, hotspot, huffman, jaccard-cuda, jacobi-cuda, lud, marchingCubes-cuda, nw, psort, score-cuda, sfilter, spmv, srad_v2, streamcluster, wedford-cuda] | |
| # scheduler: [2] | |
| # localmem: [1] | |
| steps: | |
| # - name: Checkout code | |
| # uses: actions/checkout@v4 | |
| - name: Run tests (SBATCH) | |
| run: | | |
| export TEST_NAME="${{ matrix.name }}" | |
| export VORTEX_SCHEDULE_FLAG="${{ matrix.scheduler }}" | |
| export VORTEX_LOCALMEM_FLAG="${{ matrix.localmem }}" | |
| chmod +x ./ci/run-crnch-cuda-test.sh && sbatch --wait --export=ALL ./ci/run-crnch-cuda-test.sh | |
| echo "Showing last 100 lines of log:" | |
| LOG_FILE=/tools/ci-reports/CuPBoP_logs/${TEST_NAME}.out | |
| tail -n 100 $LOG_FILE | |
| if grep -q "Kernel compilation completed!" "$LOG_FILE" && \ | |
| grep -q "Host compilation completed!" "$LOG_FILE" && \ | |
| grep -q "Execution completed!" "$LOG_FILE"; then | |
| echo "Execution successful!" | |
| else | |
| echo "Execution failure." | |
| exit 1 | |
| fi | |
| - name: Verify Correctness | |
| if: always() | |
| run: | | |
| export TEST_NAME="${{ matrix.name }}" | |
| export SCHEDULE="${{ matrix.scheduler }}" | |
| export LMEM="${{ matrix.localmem }}" | |
| echo "PWD: $(pwd)" | |
| ls -la ./examples/${TEST_NAME}/ci_output.txt || echo "ci_output.txt NOT FOUND" | |
| ls -la ./examples/${TEST_NAME}/golden_output.txt || echo "golden_output.txt NOT FOUND" | |
| EXAMPLE_DIR="./examples/${TEST_NAME}" | |
| CI_OUTPUT="${EXAMPLE_DIR}/ci_output.txt" | |
| STATUS_FILE="${EXAMPLE_DIR}/ci_status_SCHE_${SCHEDULE}_LMEM_${LMEM}.txt" | |
| RESULT="FAIL" | |
| case $TEST_NAME in | |
| saxpy|sgemm|sgemm_tcu|sgemm_dxa|sgemm_tcu_dxa|psum|conv3|dotproduct|vecadd|stencil|transpose|atomic_test|bh-cuda|blackscholes|cc-cuda|cfd|huffman|jaccard-cuda|jacobi-cuda|lud|marchingCubes-cuda|psort|score-cuda|sfilter|spmv|wedford-cuda) | |
| if [ -f "$CI_OUTPUT" ] && grep -q "PASSED" "$CI_OUTPUT"; then | |
| echo "Correctness: PASS" | |
| RESULT="PASS" | |
| else | |
| echo "Correctness: FAIL (PASSED not found)" | |
| [ -f "$CI_OUTPUT" ] && cat "$CI_OUTPUT" | |
| fi | |
| ;; | |
| backprop|nn|pathfinder|gauss|srad_v2) | |
| GOLDEN="${EXAMPLE_DIR}/golden_output.txt" | |
| if [ -f "$GOLDEN" ] && [ -f "$CI_OUTPUT" ]; then | |
| if python3 ./ci/compare_golden.py "$GOLDEN" "$CI_OUTPUT" --tolerance=1e-4; then | |
| RESULT="PASS" | |
| fi | |
| else | |
| echo "Correctness: FAIL (golden or CI output missing)" | |
| fi | |
| ;; | |
| nw) | |
| GOLDEN="${EXAMPLE_DIR}/golden_result_nw.txt" | |
| RESULT_FILE="${EXAMPLE_DIR}/result_vortex.txt" | |
| if [ -f "$GOLDEN" ] && [ -f "$RESULT_FILE" ]; then | |
| diff -q "$GOLDEN" "$RESULT_FILE" && echo "Correctness: PASS" && RESULT="PASS" || { echo "Correctness: FAIL"; diff "$GOLDEN" "$RESULT_FILE" || true; } | |
| else | |
| echo "Correctness: FAIL (golden or result file missing)" | |
| fi | |
| ;; | |
| hotspot) | |
| GOLDEN="${EXAMPLE_DIR}/golden_output_hotspot.txt" | |
| RESULT_FILE="${EXAMPLE_DIR}/output.out" | |
| if [ -f "$GOLDEN" ] && [ -f "$RESULT_FILE" ]; then | |
| if python3 ./ci/compare_golden.py "$GOLDEN" "$RESULT_FILE" --tolerance=1e-4; then | |
| RESULT="PASS" | |
| fi | |
| else | |
| echo "Correctness: FAIL (golden or output file missing)" | |
| fi | |
| ;; | |
| bfs) | |
| GOLDEN="${EXAMPLE_DIR}/golden_result_bfs.txt" | |
| RESULT_FILE="${EXAMPLE_DIR}/result_vortex.txt" | |
| if [ -f "$GOLDEN" ] && [ -f "$RESULT_FILE" ]; then | |
| if diff -q "$GOLDEN" "$RESULT_FILE" > /dev/null 2>&1; then | |
| echo "Correctness: PASS" | |
| RESULT="PASS" | |
| else | |
| echo "Correctness: FAIL" | |
| diff "$GOLDEN" "$RESULT_FILE" || true | |
| fi | |
| else | |
| echo "Correctness: FAIL (golden or result file missing)" | |
| fi | |
| ;; | |
| streamcluster) | |
| GOLDEN="${EXAMPLE_DIR}/golden_result_streamcluster.txt" | |
| RESULT_FILE="${EXAMPLE_DIR}/output.txt" | |
| if [ -f "$GOLDEN" ] && [ -f "$RESULT_FILE" ]; then | |
| if python3 ./ci/compare_golden.py "$GOLDEN" "$RESULT_FILE" --tolerance=1e-4; then | |
| RESULT="PASS" | |
| fi | |
| else | |
| echo "Correctness: FAIL (golden or result file missing)" | |
| fi | |
| ;; | |
| btree) | |
| GOLDEN="${EXAMPLE_DIR}/golden_result_btree.txt" | |
| RESULT_FILE="${EXAMPLE_DIR}/output.txt" | |
| if [ -f "$GOLDEN" ] && [ -f "$RESULT_FILE" ]; then | |
| if diff -q "$GOLDEN" "$RESULT_FILE" > /dev/null 2>&1; then | |
| echo "Correctness: PASS" | |
| RESULT="PASS" | |
| else | |
| echo "Correctness: FAIL" | |
| diff "$GOLDEN" "$RESULT_FILE" || true | |
| fi | |
| else | |
| echo "Correctness: FAIL (golden or result file missing)" | |
| fi | |
| ;; | |
| *) | |
| echo "No correctness check defined for $TEST_NAME" | |
| RESULT="SKIP" | |
| ;; | |
| esac | |
| echo "$RESULT" > "$STATUS_FILE" | |
| if [ "$RESULT" = "FAIL" ]; then | |
| exit 1 | |
| fi | |
| - name: Report Performance | |
| if: always() | |
| run: | | |
| export TEST_NAME="${{ matrix.name }}" | |
| export SCHEDULE="${{ matrix.scheduler }}" | |
| export LMEM="${{ matrix.localmem }}" | |
| if [ "$LMEM" = "0" ]; then | |
| PERF_FILE=$(ls ./examples/${TEST_NAME}/Perf_counter_*SCHE_${SCHEDULE}_LOCAL_MEM_0*.txt 2>/dev/null | head -1) | |
| LABEL="${TEST_NAME} (SCHE_${SCHEDULE}, LMEM=0)" | |
| else | |
| PERF_FILE=$(ls ./examples/${TEST_NAME}/Perf_counter_*SCHE_${SCHEDULE}*.txt 2>/dev/null | head -1) | |
| LABEL="${TEST_NAME} (SCHE_${SCHEDULE})" | |
| fi | |
| if [ -n "$PERF_FILE" ]; then | |
| python3 ./ci/perf_summary.py "$PERF_FILE" "$LABEL" "$SCHEDULE" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| complete: | |
| runs-on: self-hosted | |
| needs: tests | |
| if: always() | |
| steps: | |
| - name: Check Completion | |
| run: echo "All matrix jobs passed" | |
| - name: Performance Summary | |
| run: | | |
| python3 ./ci/perf_summary_all.py ./examples >> $GITHUB_STEP_SUMMARY | |