From 9146131f7c60366ea88e5a2a326b8bf19c891a81 Mon Sep 17 00:00:00 2001 From: Whittney Tsang Date: Thu, 17 Oct 2024 20:12:00 +0000 Subject: [PATCH] [CI] Reduce env vars Signed-off-by: Whittney Tsang --- .github/workflows/triton-benchmarks.yml | 115 +++++++----------------- 1 file changed, 31 insertions(+), 84 deletions(-) diff --git a/.github/workflows/triton-benchmarks.yml b/.github/workflows/triton-benchmarks.yml index ac5735f72..6c56b78af 100644 --- a/.github/workflows/triton-benchmarks.yml +++ b/.github/workflows/triton-benchmarks.yml @@ -106,25 +106,19 @@ jobs: cd benchmarks python setup.py install - - name: Run Triton Softmax kernel benchmark - if: ${{ steps.install.outcome == 'success' && !cancelled() }} - run: | - cd benchmarks/triton_kernels_benchmark - python fused_softmax.py --reports $REPORTS - source ../../scripts/capture-hw-details.sh - python ../../scripts/build_report.py $REPORTS/softmax-performance.csv $REPORTS/softmax-triton-report.csv --benchmark softmax --compiler triton --param_cols "N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - python ../../scripts/build_report.py $REPORTS/softmax-performance.csv $REPORTS/softmax-xetla-report.csv --benchmark softmax --compiler xetla --param_cols "N" --tflops_col XeTLA-TFlops --hbm_col "XeTLA-GB/s" --tag $TAG - - - name: Run Triton GEMM kernel benchmark + - name: Run Triton GEMM kernel benchmark - default path (before) if: ${{ steps.install.outcome == 'success' && !cancelled() }} run: | cd benchmarks/triton_kernels_benchmark + # Default path: + TRITON_INTEL_ADVANCED_PATH=0 \ + TRITON_INTEL_ENABLE_ADDRESS_PAYLOAD_OPT=1 \ python gemm_benchmark.py --reports $REPORTS - mv $REPORTS/matmul-performance.csv $REPORTS/matmul-performance-base.csv + mv $REPORTS/matmul-performance.csv $REPORTS/matmul-performance-default-path.csv source ../../scripts/capture-hw-details.sh - python ../../scripts/build_report.py $REPORTS/matmul-performance-base.csv $REPORTS/gemm-triton-report.csv --benchmark gemm --compiler triton --param_cols "B,M,K,N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - python ../../scripts/build_report.py $REPORTS/matmul-performance-base.csv $REPORTS/gemm-xetla-report.csv --benchmark gemm --compiler xetla --param_cols "B,M,K,N" --tflops_col XeTLA-TFlops --hbm_col "XeTLA-GB/s" --tag $TAG + TAG="${TAG}-dflt" + python ../../scripts/build_report.py $REPORTS/matmul-performance-default-path.csv $REPORTS/gemm-triton-default-report.csv --benchmark gemm --compiler triton --param_cols "B,M,K,N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - name: Run Triton GEMM kernel benchmark - default path if: ${{ steps.install.outcome == 'success' && !cancelled() }} @@ -142,7 +136,7 @@ jobs: TAG="${TAG}-dflt" python ../../scripts/build_report.py $REPORTS/matmul-performance-default-path.csv $REPORTS/gemm-triton-default-report.csv --benchmark gemm --compiler triton --param_cols "B,M,K,N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - - name: Run Triton GEMM kernel benchmark - advanced path + - name: Run Triton GEMM kernel benchmark - advanced path (before) if: ${{ steps.install.outcome == 'success' && !cancelled() }} run: | cd benchmarks/triton_kernels_benchmark @@ -158,77 +152,32 @@ jobs: TAG="${TAG}-adv" python ../../scripts/build_report.py $REPORTS/matmul-performance-adv-path.csv $REPORTS/gemm-triton-advanced-report.csv --benchmark gemm --compiler triton --param_cols "B,M,K,N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - - name: Run Triton GEMM (A@B^t) kernel benchmark - if: ${{ steps.install.outcome == 'success' && !cancelled() }} - run: | - cd benchmarks/triton_kernels_benchmark - TRANSPOSE_B=1 python gemm_benchmark.py --reports $REPORTS - mv $REPORTS/matmul-performance.csv $REPORTS/matmul-performance-bt.csv - source ../../scripts/capture-hw-details.sh - - python ../../scripts/build_report.py $REPORTS/matmul-performance-bt.csv $REPORTS/gemm-bt-triton-report.csv --benchmark gemm-bt --compiler triton --param_cols "B,M,K,N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - python ../../scripts/build_report.py $REPORTS/matmul-performance-bt.csv $REPORTS/gemm-bt-onednn-report.csv --benchmark gemm-bt --compiler onednn --param_cols "B,M,K,N" --tflops_col onednn-TFlops --hbm_col "onednn-GB/s" --tag $TAG - - - name: Run Triton GEMM (A^t@B) kernel benchmark - if: ${{ steps.install.outcome == 'success' && !cancelled() }} - run: | - cd benchmarks/triton_kernels_benchmark - TRANSPOSE_A=1 python gemm_benchmark.py --reports $REPORTS - mv $REPORTS/matmul-performance.csv $REPORTS/matmul-performance-at.csv - source ../../scripts/capture-hw-details.sh - - python ../../scripts/build_report.py $REPORTS/matmul-performance-at.csv $REPORTS/gemm-at-triton-report.csv --benchmark gemm-at --compiler triton --param_cols "B,M,K,N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - python ../../scripts/build_report.py $REPORTS/matmul-performance-at.csv $REPORTS/gemm-at-onednn-report.csv --benchmark gemm-at --compiler onednn --param_cols "B,M,K,N" --tflops_col onednn-TFlops --hbm_col "onednn-GB/s" --tag $TAG - - - name: Run Triton GEMM (stream-k) kernel benchmark - if: ${{ steps.install.outcome == 'success' && !cancelled() }} - run: | - cd benchmarks/triton_kernels_benchmark - python gemm_streamk_benchmark.py --reports $REPORTS - source ../../scripts/capture-hw-details.sh - python ../../scripts/build_report.py $REPORTS/matmul-streamk-performance.csv $REPORTS/gemm-streamk-triton-report.csv --benchmark gemm-streamk --compiler triton --param_cols "M,K,N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - - - name: Run Triton GEMM (split-k) kernel benchmark - if: ${{ steps.install.outcome == 'success' && !cancelled() }} - run: | - cd benchmarks/triton_kernels_benchmark - python gemm_splitk_benchmark.py --reports $REPORTS - source ../../scripts/capture-hw-details.sh - python ../../scripts/build_report.py $REPORTS/matmul-splitk-performance.csv $REPORTS/gemm-splitk-triton-report.csv --benchmark gemm-splitk --compiler triton --param_cols "M,K,N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - - - name: Run Triton GEMM + PreOp (exp) kernel benchmark - if: ${{ steps.install.outcome == 'success' && !cancelled() }} - run: | - cd benchmarks/triton_kernels_benchmark - python gemm_preop_exp_benchmark.py --reports $REPORTS - source ../../scripts/capture-hw-details.sh - python ../../scripts/build_report.py $REPORTS/matmul-performance-preop-exp.csv $REPORTS/gemm-preop-exp-triton-report.csv --benchmark gemm-preop-exp --compiler triton --param_cols "B,M,K,N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - - - name: Run Triton GEMM + PostOp (Gelu) kernel benchmark + - name: Run Triton GEMM kernel benchmark - advanced path if: ${{ steps.install.outcome == 'success' && !cancelled() }} run: | cd benchmarks/triton_kernels_benchmark - python gemm_postop_gelu_benchmark.py --reports $REPORTS - source ../../scripts/capture-hw-details.sh - python ../../scripts/build_report.py $REPORTS/matmul-performance-postop-gelu.csv $REPORTS/gemm-postop-gelu-triton-report.csv --benchmark gemm-postop-gelu --compiler triton --param_cols "B,M,K,N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG + # Advanced path: + TRITON_INTEL_ADVANCED_PATH=1 \ + TRITON_INTEL_ENABLE_ADDRESS_PAYLOAD_OPT=1 \ + python gemm_benchmark.py --reports $REPORTS + mv $REPORTS/matmul-performance.csv $REPORTS/matmul-performance-adv-path.csv - - name: Run Triton GEMM + PostOp (add matrix) kernel benchmark - if: ${{ steps.install.outcome == 'success' && !cancelled() }} - run: | - cd benchmarks/triton_kernels_benchmark - python gemm_postop_addmatrix_benchmark.py --reports $REPORTS source ../../scripts/capture-hw-details.sh - python ../../scripts/build_report.py $REPORTS/matmul-performance-postop-addmatrix.csv $REPORTS/gemm-postop-addmatrix-triton-report.csv --benchmark gemm-postop-addmatrix --compiler triton --param_cols "B,M,K,N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG + TAG="${TAG}-adv" + python ../../scripts/build_report.py $REPORTS/matmul-performance-adv-path.csv $REPORTS/gemm-triton-advanced-report.csv --benchmark gemm --compiler triton --param_cols "B,M,K,N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - - name: Run Triton FA kernel benchmark + - name: Run Triton FA kernel benchmark - default path (before) if: ${{ steps.install.outcome == 'success' && !cancelled() }} run: | cd benchmarks/triton_kernels_benchmark + TRITON_INTEL_ADVANCED_PATH=0 \ + TRITON_INTEL_ENABLE_ADDRESS_PAYLOAD_OPT=1 \ + IGC_VISAOptions=" -enableBCR" \ python flash_attention_fwd_benchmark.py --reports $REPORTS + TAG="${TAG}-dflt" source ../../scripts/capture-hw-details.sh - python ../../scripts/build_report.py $REPORTS/attn-performance.csv $REPORTS/attn-triton-report.csv --benchmark attn --compiler triton --param_cols "Z,H,N_CTX,D_HEAD,CAUSAL" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - python ../../scripts/build_report.py $REPORTS/attn-performance.csv $REPORTS/attn-xetla-report.csv --benchmark attn --compiler xetla --param_cols "Z,H,N_CTX,D_HEAD,CAUSAL" --tflops_col XeTLA-TFlops --hbm_col "XeTLA-GB/s" --tag $TAG + python ../../scripts/build_report.py $REPORTS/attn-performance.csv $REPORTS/attn-triton-default-report.csv --benchmark attn --compiler triton --param_cols "Z,H,N_CTX,D_HEAD,CAUSAL" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - name: Run Triton FA kernel benchmark - default path if: ${{ steps.install.outcome == 'success' && !cancelled() }} @@ -236,14 +185,13 @@ jobs: cd benchmarks/triton_kernels_benchmark TRITON_INTEL_ADVANCED_PATH=0 \ TRITON_INTEL_ENABLE_ADDRESS_PAYLOAD_OPT=1 \ - IGC_VISAOptions=" -enableBCR" \ python flash_attention_fwd_benchmark.py --reports $REPORTS TAG="${TAG}-dflt" source ../../scripts/capture-hw-details.sh python ../../scripts/build_report.py $REPORTS/attn-performance.csv $REPORTS/attn-triton-default-report.csv --benchmark attn --compiler triton --param_cols "Z,H,N_CTX,D_HEAD,CAUSAL" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - - name: Run Triton FA kernel benchmark - advanced path + - name: Run Triton FA kernel benchmark - advanced path (before) if: ${{ steps.install.outcome == 'success' && !cancelled() }} run: | cd benchmarks/triton_kernels_benchmark @@ -257,19 +205,18 @@ jobs: source ../../scripts/capture-hw-details.sh python ../../scripts/build_report.py $REPORTS/attn-performance.csv $REPORTS/attn-triton-advanced-report.csv --benchmark attn --compiler triton --param_cols "Z,H,N_CTX,D_HEAD,CAUSAL" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - - name: Run Prefix Sums kernel benchmark + - name: Run Triton FA kernel benchmark - advanced path if: ${{ steps.install.outcome == 'success' && !cancelled() }} run: | cd benchmarks/triton_kernels_benchmark - python prefix_sums.py --reports $REPORTS - source ../../scripts/capture-hw-details.sh - python ../../scripts/build_report.py $REPORTS/prefix-sums.csv $REPORTS/prefix_sums-triton-report.csv --benchmark prefix_sums --compiler triton --param_cols "N" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG + TRITON_INTEL_ADVANCED_PATH=1 \ + TRITON_INTEL_ENABLE_INSTR_SCHED=1 \ + TRITON_INTEL_ENABLE_ADDRESS_PAYLOAD_OPT=1 \ + python flash_attention_fwd_benchmark.py --reports $REPORTS - - name: Run micro benchmark - if: ${{ steps.install.outcome == 'success' && !cancelled() }} - run: | - cd benchmarks/micro_benchmarks - python run_benchmarks.py --reports $REPORTS + TAG="${TAG}-adv" + source ../../scripts/capture-hw-details.sh + python ../../scripts/build_report.py $REPORTS/attn-performance.csv $REPORTS/attn-triton-advanced-report.csv --benchmark attn --compiler triton --param_cols "Z,H,N_CTX,D_HEAD,CAUSAL" --tflops_col Triton-TFlops --hbm_col "Triton-GB/s" --tag $TAG - name: Save pip cache if: ${{ steps.pip-cache.outputs.status == 'miss' }}