diff --git a/.ci/scripts/test_llama.sh b/.ci/scripts/test_llama.sh index 5721b7fd607..2e51866d902 100644 --- a/.ci/scripts/test_llama.sh +++ b/.ci/scripts/test_llama.sh @@ -11,7 +11,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" MODEL_NAME=$1 # stories110M BUILD_TOOL=$2 # buck2 or cmake -DTYPE=$3 # fp16 or fp32 +DTYPE=$3 # fp16, bf16, or fp32 MODE=${4:-"xnnpack+custom"} # portable or xnnpack+custom or xnnpack+custom+qe UPLOAD_DIR=${5:-} if [[ $# -lt 4 ]]; then # Assuming 4 mandatory args @@ -29,7 +29,7 @@ if [[ -z "${BUILD_TOOL:-}" ]]; then fi if [[ -z "${DTYPE:-}" ]]; then - echo "Missing dtype, choose fp16 or fp32, exiting..." + echo "Missing dtype, choose fp16, bf16, or fp32, exiting..." exit 1 fi @@ -174,6 +174,8 @@ fi EXPORTED_MODEL_NAME="llama2" if [[ "${DTYPE}" == "fp16" ]]; then EXPORTED_MODEL_NAME="${EXPORTED_MODEL_NAME}_h" +elif [[ "${DTYPE}" == "bf16" ]]; then + EXPORTED_MODEL_NAME="${EXPORTED_MODEL_NAME}_bf" elif [[ "${DTYPE}" == "fp32" ]]; then : else diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index ca13d9bbd22..d4b81a23343 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -91,6 +91,13 @@ jobs: dtype: [fp32] build-tool: [buck2, cmake] mode: [portable, xnnpack+custom, xnnpack+custom+qe] + include: + - dtype: bf16 + build-tool: cmake + mode: portable + - dtype: bf16 + build-tool: buck2 + mode: portable fail-fast: false with: runner: linux.2xlarge diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 1d82a166ced..d7130561fa6 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -224,6 +224,9 @@ jobs: matrix: dtype: [fp32] mode: [portable, xnnpack+kv+custom, mps, coreml] + include: + - dtype: bf16 + mode: portable fail-fast: false with: runner: macos-m1-stable