Skip to content

Commit

Permalink
Enable tokenizers in shortfin packages on Linux x86_64.
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottTodd committed Dec 12, 2024
1 parent 7e62c25 commit 00fa7da
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions shortfin/build_tools/build_linux_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,22 @@ REPO_ROOT="$(cd "$THIS_DIR"/../../ && pwd)"
SCRIPT_NAME="$(basename $0)"
ARCH="$(uname -m)"

# Note: we can switch to https://github.com/nod-ai/base-docker-images as needed for extra deps.
MANYLINUX_DOCKER_IMAGE="${MANYLINUX_DOCKER_IMAGE:-quay.io/pypa/manylinux_2_28_${ARCH}:latest}"
PYTHON_VERSIONS="${OVERRIDE_PYTHON_VERSIONS:-cp311-cp311 cp312-cp312 cp313-cp313}"
OUTPUT_DIR="${OUTPUT_DIR:-${THIS_DIR}/wheelhouse}"
CACHE_DIR="${CACHE_DIR:-}"
SHORTFIN_ENABLE_TRACING="${SHORTFIN_ENABLE_TRACING:-ON}"

# Our x86_64 dockerfile contains dependencies needed to build the tokenizer
# library (rust), so enable tokenizers by default on x86_64.
# TODO: publish a multi-platform manylinux image and include more deps in all platforms (rust, ccache, etc.)
if [[ "${ARCH}" == "x86_64" ]]; then
MANYLINUX_DOCKER_IMAGE="${MANYLINUX_DOCKER_IMAGE:-ghcr.io/nod-ai/manylinux_x86_64@sha256:4acf83343706d1e37252d6001ded3c97a73bc38620580f855b4e65e35ddc5681}"
SHORTFIN_ENABLE_TOKENIZERS="${SHORTFIN_ENABLE_TOKENIZERS:-ON}"
else
MANYLINUX_DOCKER_IMAGE="${MANYLINUX_DOCKER_IMAGE:-quay.io/pypa/manylinux_2_28_${ARCH}:latest}"
SHORTFIN_ENABLE_TOKENIZERS="${SHORTFIN_ENABLE_TOKENIZERS:-OFF}"
fi

function run_on_host() {
echo "Running on host"
echo "Launching docker image ${MANYLINUX_DOCKER_IMAGE}"
Expand All @@ -69,6 +78,7 @@ function run_on_host() {
-e "OVERRIDE_PYTHON_VERSIONS=${PYTHON_VERSIONS}" \
-e "OUTPUT_DIR=${OUTPUT_DIR}" \
-e "SHORTFIN_ENABLE_TRACING=${SHORTFIN_ENABLE_TRACING}" \
-e "SHORTFIN_ENABLE_TOKENIZERS=${SHORTFIN_ENABLE_TOKENIZERS}" \
${extra_args} \
"${MANYLINUX_DOCKER_IMAGE}" \
-- ${THIS_DIR}/${SCRIPT_NAME}
Expand Down

0 comments on commit 00fa7da

Please sign in to comment.