Skip to content

Commit 8a47f7a

Browse files
swolchokfacebook-github-bot
authored andcommitted
Add test_llama bf16 portable config to CI
Summary: We should ensure that bfloat16 works. Reviewed By: mergennachin Differential Revision: D62963924
1 parent 6ed8873 commit 8a47f7a

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

.ci/scripts/test_llama.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1111

1212
MODEL_NAME=$1 # stories110M
1313
BUILD_TOOL=$2 # buck2 or cmake
14-
DTYPE=$3 # fp16 or fp32
14+
DTYPE=$3 # fp16, bf16, or fp32
1515
MODE=${4:-"xnnpack+custom"} # portable or xnnpack+custom or xnnpack+custom+qe
1616
UPLOAD_DIR=${5:-}
1717
if [[ $# -lt 4 ]]; then # Assuming 4 mandatory args
@@ -29,7 +29,7 @@ if [[ -z "${BUILD_TOOL:-}" ]]; then
2929
fi
3030

3131
if [[ -z "${DTYPE:-}" ]]; then
32-
echo "Missing dtype, choose fp16 or fp32, exiting..."
32+
echo "Missing dtype, choose fp16, bf16, or fp32, exiting..."
3333
exit 1
3434
fi
3535

@@ -174,6 +174,8 @@ fi
174174
EXPORTED_MODEL_NAME="llama2"
175175
if [[ "${DTYPE}" == "fp16" ]]; then
176176
EXPORTED_MODEL_NAME="${EXPORTED_MODEL_NAME}_h"
177+
elif [[ "${DTYPE}" == "bf16" ]]; then
178+
EXPORTED_MODEL_NAME="${EXPORTED_MODEL_NAME}_bf"
177179
elif [[ "${DTYPE}" == "fp32" ]]; then
178180
:
179181
else

.github/workflows/pull.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ jobs:
9191
dtype: [fp32]
9292
build-tool: [buck2, cmake]
9393
mode: [portable, xnnpack+custom, xnnpack+custom+qe]
94+
include:
95+
- dtype: bf16
96+
build-tool: cmake
97+
mode: portable
98+
- dtype: bf16
99+
build-tool: buck2
100+
mode: portable
94101
fail-fast: false
95102
with:
96103
runner: linux.2xlarge

.github/workflows/trunk.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ jobs:
224224
matrix:
225225
dtype: [fp32]
226226
mode: [portable, xnnpack+kv+custom, mps, coreml]
227+
include:
228+
- dtype: bf16
229+
mode: portable
227230
fail-fast: false
228231
with:
229232
runner: macos-m1-stable

0 commit comments

Comments
 (0)