Unverified Commit 481bf395 authored by Keiven C's avatar Keiven C Committed by GitHub
Browse files

refactor: standardize HF_CACHE to HF_HOME across codebase (use Hugging Face convention) (#3310)


Signed-off-by: default avatarKeiven Chang <keivenchang@users.noreply.github.com>
parent 6ffd20a8
......@@ -111,7 +111,7 @@ export MOUNTS="${PWD}/../:/mnt"
# NOTE: In general, Deepseek R1 is very large, so it is recommended to
# pre-download the model weights and save them in some shared location,
# NFS storage, HF_CACHE, etc. and modify the `--model-path` below
# NFS storage, HF_HOME, etc. and modify the `--model-path` below
# to reuse the pre-downloaded weights instead.
#
# On Blackwell systems (ex: GB200), it is recommended to use the FP4 weights:
......
......@@ -74,7 +74,7 @@ export IMAGE="<dynamo_trtllm_image>"
# NOTE: In general, Deepseek R1 is very large, so it is recommended to
# pre-download the model weights and save them in some shared location,
# NFS storage, HF_CACHE, etc. and modify the `--model-path` below
# NFS storage, HF_HOME, etc. and modify the `--model-path` below
# to reuse the pre-downloaded weights instead.
#
# On Blackwell systems (ex: GB200), it is recommended to use the FP4 weights:
......
......@@ -31,8 +31,8 @@ DEFAULT_FRAMEWORK=VLLM
SOURCE_DIR=$(dirname "$(readlink -f "$0")")
IMAGE=
HF_CACHE=
DEFAULT_HF_CACHE=${SOURCE_DIR}/.cache/huggingface
HF_HOME=${HF_HOME:-}
DEFAULT_HF_HOME=${SOURCE_DIR}/.cache/huggingface
GPUS="all"
PRIVILEGED=
VOLUME_MOUNTS=
......@@ -85,9 +85,9 @@ get_options() {
missing_requirement "$1"
fi
;;
--hf-cache)
--hf-cache|--hf-home)
if [ "$2" ]; then
HF_CACHE=$2
HF_HOME=$2
shift
else
missing_requirement "$1"
......@@ -250,8 +250,8 @@ get_options() {
VOLUME_MOUNTS+=" -v /tmp:/tmp "
VOLUME_MOUNTS+=" -v /mnt/:/mnt "
if [ -z "$HF_CACHE" ]; then
HF_CACHE=$DEFAULT_HF_CACHE
if [ -z "$HF_HOME" ]; then
HF_HOME=$DEFAULT_HF_HOME
fi
if [ -z "${PRIVILEGED}" ]; then
......@@ -263,19 +263,19 @@ get_options() {
INTERACTIVE=" -it "
fi
if [[ ${HF_CACHE^^} == "NONE" ]]; then
HF_CACHE=
if [[ ${HF_HOME^^} == "NONE" ]]; then
HF_HOME=
fi
if [ -n "$HF_CACHE" ]; then
mkdir -p "$HF_CACHE"
if [ -n "$HF_HOME" ]; then
mkdir -p "$HF_HOME"
# Use /home/ubuntu for local-dev target, /root for dev target.
if [ "$TARGET" = "local-dev" ] || [[ "$IMAGE" == *"local-dev"* ]]; then
HF_CACHE_TARGET="/home/ubuntu/.cache/huggingface"
HF_HOME_TARGET="/home/ubuntu/.cache/huggingface"
else
HF_CACHE_TARGET="/root/.cache/huggingface"
HF_HOME_TARGET="/root/.cache/huggingface"
fi
VOLUME_MOUNTS+=" -v $HF_CACHE:$HF_CACHE_TARGET"
VOLUME_MOUNTS+=" -v $HF_HOME:$HF_HOME_TARGET"
fi
if [ -z "${PRIVILEGED}" ]; then
......@@ -325,7 +325,7 @@ show_help() {
echo " [--name name for launched container, default NONE]"
echo " [--privileged whether to launch in privileged mode, default FALSE unless mounting workspace]"
echo " [--dry-run print docker commands without running]"
echo " [--hf-cache directory to volume mount as the hf cache, default is NONE unless mounting workspace]"
echo " [--hf-home|--hf-cache directory to volume mount as the hf home, default is NONE unless mounting workspace]"
echo " [--gpus gpus to enable, default is 'all', 'none' disables gpu support]"
echo " [--use-nixl-gds add volume mounts and capabilities needed for NVIDIA GPUDirect Storage]"
echo " [--network network mode for container, default is 'host']"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment