@@ -52,61 +52,61 @@ jobs:
5252
5353
5454# jobs:
55- # Tests:
56- # strategy:
57- # # Don't fail fast - want to see results for all builds even if one fails.
58- # fail-fast: false
59- # matrix:
60- # job_info: [
61- # {
62- # os: "linux-x86-n2-16",
63- # container: "us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/ml-build:latest",
64- # pretty_name: "XLA Linux x86 CPU",
65- # },
66- # {
67- # os: "linux-arm64-c4a-16",
68- # container: "us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/ml-build-arm64:latest",
69- # pretty_name: "XLA Linux ARM64 CPU",
70- # }
71- # ]
72- # name: ${{ matrix.job_info.pretty_name }}
73- # runs-on: ${{ matrix.job_info.os }}
74- # container: ${{ matrix.job_info.container }}
75- # defaults:
76- # run:
77- # shell: bash
78- # timeout-minutes: 30
79- # steps:
80- # - name: Print machine specs
81- # run: |
82- # lscpu
83- # free -h # Memory information
84- # df -h # Disk space information
85- # uname -a # Kernel information
55+ Tests :
56+ strategy :
57+ # Don't fail fast - want to see results for all builds even if one fails.
58+ fail-fast : false
59+ matrix :
60+ job_info : [
61+ {
62+ os : " linux-x86-n2-16" ,
63+ container : " us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/ml-build:latest" ,
64+ pretty_name : " XLA Linux x86 CPU" ,
65+ },
66+ {
67+ os : " linux-arm64-c4a-16" ,
68+ container : " us-central1-docker.pkg.dev/tensorflow-sigs/tensorflow/ml-build-arm64:latest" ,
69+ pretty_name : " XLA Linux ARM64 CPU" ,
70+ }
71+ ]
72+ name : ${{ matrix.job_info.pretty_name }}
73+ runs-on : ${{ matrix.job_info.os }}
74+ container : ${{ matrix.job_info.container }}
75+ defaults :
76+ run :
77+ shell : bash
78+ timeout-minutes : 30
79+ steps :
80+ - name : Print machine specs
81+ run : |
82+ lscpu
83+ free -h # Memory information
84+ df -h # Disk space information
85+ uname -a # Kernel information
8686
87- # - name: Check Python Version in Container
88- # run: python3 --version
87+ - name : Check Python Version in Container
88+ run : python3 --version
8989
90- # - name: Install Python 3.10 if not present (IN CONTAINER)
91- # run: |
92- # if ! python3 --version > /dev/null 2>&1; then # check for python3
93- # echo "Python 3 not found, installing..."
94- # apt-get update
95- # apt-get install -y python3.10 python3-pip
96- # else
97- # echo "Python 3 found."
98- # fi
90+ - name : Install Python 3.10 if not present (IN CONTAINER)
91+ run : |
92+ if ! python3 --version > /dev/null 2>&1; then # check for python3
93+ echo "Python 3 not found, installing..."
94+ apt-get update
95+ apt-get install -y python3.10 python3-pip
96+ else
97+ echo "Python 3 found."
98+ fi
9999
100- # - name: Checkout OpenXLA
101- # uses: actions/checkout@v3
102- # with:
103- # repository: openxla/xla
104- # ref: dev # Specify the dev branch
100+ - name : Checkout OpenXLA
101+ uses : actions/checkout@v3
102+ with :
103+ repository : openxla/xla
104+ ref : dev # Specify the dev branch
105105
106- # - name: Create results directory
107- # working-directory: xla
108- # run:
109- # mkdir results
106+ - name : Create results directory
107+ working-directory : xla
108+ run :
109+ mkdir results
110110
111111 # - name: Run setup.sh for E2E benchmarks flax_2b
112112 # working-directory: xla/backends/cpu/benchmarks/e2e/gemma2/flax_2b
@@ -120,54 +120,54 @@ jobs:
120120 # run: |
121121 # bash run.sh | tee -a ../../../../../../results/flax_2b.log
122122
123- # TODO(juliagmt): Re-enable once the build is fixed.
124- # - name: Build run_hlo_module
125- # working-directory: xla
126- # run: bazel build -c opt --dynamic_mode=off //xla/tools:run_hlo_module
123+ TODO(juliagmt) : Re-enable once the build is fixed.
124+ - name : Build run_hlo_module
125+ working-directory : xla
126+ run : bazel build -c opt --dynamic_mode=off //xla/tools:run_hlo_module
127127
128- # - name: Run HLO Module Benchmarks
129- # working-directory: xla
130- # continue-on-error: true
131- # run: |
132- # for file in tests/fuzz/*.hlo; do
133- # filename=$(basename "$file")
134- # # Skip expected failed hlo files.
135- # if [[ "$filename" == "rand_000060.hlo" || "$filename" == "rand_000067.hlo" || "$filename" == "rand_000072.hlo" ]]; then
136- # echo "Skipping benchmark on $file"
137- # continue
138- # fi
139- # echo "Running benchmark on $file"
140- # ./bazel-bin/xla/tools/run_hlo_module --input_format=hlo --platform=CPU "$file"
141- # done
128+ - name : Run HLO Module Benchmarks
129+ working-directory : xla
130+ continue-on-error : true
131+ run : |
132+ for file in tests/fuzz/*.hlo; do
133+ filename=$(basename "$file")
134+ # Skip expected failed hlo files.
135+ if [[ "$filename" == "rand_000060.hlo" || "$filename" == "rand_000067.hlo" || "$filename" == "rand_000072.hlo" ]]; then
136+ echo "Skipping benchmark on $file"
137+ continue
138+ fi
139+ echo "Running benchmark on $file"
140+ ./bazel-bin/xla/tools/run_hlo_module --input_format=hlo --platform=CPU "$file"
141+ done
142142
143- # - name: Build CPU Benchmarks
144- # working-directory: xla
145- # run: bazel build -c opt --dynamic_mode=off //xla/backends/cpu/benchmarks:*
143+ - name : Build CPU Benchmarks
144+ working-directory : xla
145+ run : bazel build -c opt --dynamic_mode=off //xla/backends/cpu/benchmarks:*
146146
147- # - name: Run CPU benchmarks
148- # working-directory: xla
149- # continue-on-error: true
150- # run: |
151- # find ./bazel-bin/xla/backends/cpu/benchmarks/ -maxdepth 1 -type f -executable -name "*_test" -print0 | while IFS= read -r -d $'\0' benchmark; do
152- # benchmark_name=$(basename "$benchmark" | sed 's/_test$//')
153- # echo "Running benchmark: $benchmark_name"
147+ - name : Run CPU benchmarks
148+ working-directory : xla
149+ continue-on-error : true
150+ run : |
151+ find ./bazel-bin/xla/backends/cpu/benchmarks/ -maxdepth 1 -type f -executable -name "*_test" -print0 | while IFS= read -r -d $'\0' benchmark; do
152+ benchmark_name=$(basename "$benchmark" | sed 's/_test$//')
153+ echo "Running benchmark: $benchmark_name"
154154
155- # # Run the benchmark with default parameters.
156- # $benchmark --benchmark_filter=".*"
157- # $benchmark --benchmark_filter=".*" > "results/$benchmark_name.log" 2>&1
155+ # Run the benchmark with default parameters.
156+ $benchmark --benchmark_filter=".*"
157+ $benchmark --benchmark_filter=".*" > "results/$benchmark_name.log" 2>&1
158158
159- # # Check the exit code of the benchmark
160- # if [ $? -ne 0 ]; then
161- # echo "Error: Benchmark '$benchmark_name' failed. Check the log file: results/$benchmark_name.log"
162- # else
163- # echo "Benchmark '$benchmark_name' completed successfully."
164- # fi
165- # done
166- # - name: Upload Results ${{ matrix.build_target }}
167- # uses: actions/upload-artifact@v4
168- # with:
169- # name: cpu-xla-benchmarks-${{ matrix.job_info.os }}
170- # path: xla/results
159+ # Check the exit code of the benchmark
160+ if [ $? -ne 0 ]; then
161+ echo "Error : Benchmark '$benchmark_name' failed. Check the log file: results/$benchmark_name.log"
162+ else
163+ echo "Benchmark '$benchmark_name' completed successfully."
164+ fi
165+ done
166+ - name : Upload Results ${{ matrix.build_target }}
167+ uses : actions/upload-artifact@v4
168+ with :
169+ name : cpu-xla-benchmarks-${{ matrix.job_info.os }}
170+ path : xla/results
171171
172172 # build-xla-gpu-and-test:
173173 # runs-on: "linux-x86-n2-16" #linux-x86-g2-48-l4-4gpu # Use a GPU-enabled runner
@@ -311,18 +311,18 @@ jobs:
311311 # # - name: Create gpu_hlo_backend.hlo
312312 # # working-directory: xla
313313 # # run: |
314- # # cat << EOF > gpu_hlo_backend.hlo
315- # # HloModule module
316- # # // CHECK: is_scheduled=true
314+ # cat << EOF > gpu_hlo_backend.hlo
315+ # HloModule module
316+ # // CHECK: is_scheduled=true
317317
318- # # ENTRY computation {
319- # # p = f32[5000,6000]{1,0} parameter(0)
320- # # e = f32[5000,6000]{1,0} sqrt(p)
321- # # c = f32[6000,5000] transpose(p), dimensions={1,0}
322- # # r = f32[300,20,5000] reshape(c)
323- # # ROOT out = (f32[5000,6000], f32[300,20,5000]) tuple(e,r)
324- # # }
325- # # EOF
318+ # ENTRY computation {
319+ # p = f32[5000,6000]{1,0} parameter(0)
320+ # e = f32[5000,6000]{1,0} sqrt(p)
321+ # c = f32[6000,5000] transpose(p), dimensions={1,0}
322+ # r = f32[300,20,5000] reshape(c)
323+ # ROOT out = (f32[5000,6000], f32[300,20,5000]) tuple(e,r)
324+ # }
325+ # EOF
326326
327327 # # - name: Wait For Connection
328328 # # uses: google-ml-infra/actions/ci_connection@main
0 commit comments