From 875f9078d1918d12e4885ff231827858f2a9d537 Mon Sep 17 00:00:00 2001 From: hzhaoy Date: Fri, 12 Jul 2024 00:15:15 +0800 Subject: [PATCH 1/3] fix #4779 Former-commit-id: 0c8cbf9ea57292de5e222618f86e1fc5379fe008 --- docker/docker-cuda/Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker/docker-cuda/Dockerfile b/docker/docker-cuda/Dockerfile index d94aa970..a95bb900 100644 --- a/docker/docker-cuda/Dockerfile +++ b/docker/docker-cuda/Dockerfile @@ -23,13 +23,6 @@ RUN pip config set global.index-url "$PIP_INDEX" && \ python -m pip install --upgrade pip && \ python -m pip install -r requirements.txt -# Rebuild flash attention -RUN pip uninstall -y transformer-engine flash-attn && \ - if [ "$INSTALL_FLASHATTN" == "true" ]; then \ - pip uninstall -y ninja && pip install ninja && \ - pip install --no-cache-dir flash-attn --no-build-isolation; \ - fi - # Copy the rest of the application into the image COPY . /app @@ -46,6 +39,13 @@ RUN EXTRA_PACKAGES="metrics"; \ fi; \ pip install -e ".[$EXTRA_PACKAGES]" +# Rebuild flash attention +RUN pip uninstall -y transformer-engine flash-attn && \ + if [ "$INSTALL_FLASHATTN" == "true" ]; then \ + pip uninstall -y ninja && pip install ninja && \ + pip install --no-cache-dir flash-attn --no-build-isolation; \ + fi + # Set up volumes VOLUME [ "/root/.cache/huggingface", "/root/.cache/modelscope", "/app/data", "/app/output" ] From 485b8dc18b0770c9814e36dbbaac598b03c7d40c Mon Sep 17 00:00:00 2001 From: hzhaoy Date: Fri, 12 Jul 2024 00:25:48 +0800 Subject: [PATCH 2/3] fix #4780 Former-commit-id: 15f73c41d556c5f8d989697d774725a88d36f1b4 --- docker/docker-cuda/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/docker-cuda/Dockerfile b/docker/docker-cuda/Dockerfile index a95bb900..a43baf21 100644 --- a/docker/docker-cuda/Dockerfile +++ b/docker/docker-cuda/Dockerfile @@ -5,6 +5,7 @@ FROM nvcr.io/nvidia/pytorch:24.02-py3 # Define environments ENV MAX_JOBS=4 ENV FLASH_ATTENTION_FORCE_BUILD=TRUE +ENV VLLM_WORKER_MULTIPROC_METHOD=spawn # Define installation arguments ARG INSTALL_BNB=false From 137c87ff60d100caea05f9bc55a0d38be0545494 Mon Sep 17 00:00:00 2001 From: hzhaoy Date: Fri, 12 Jul 2024 00:28:44 +0800 Subject: [PATCH 3/3] tiny fix Former-commit-id: 48be67c41eb394d276b41ca22b28e1ef10af4920 --- src/llamafactory/train/callbacks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llamafactory/train/callbacks.py b/src/llamafactory/train/callbacks.py index e7ce09a2..623f6ed1 100644 --- a/src/llamafactory/train/callbacks.py +++ b/src/llamafactory/train/callbacks.py @@ -134,7 +134,7 @@ class PissaConvertCallback(TrainerCallback): if args.should_save: model = kwargs.pop("model") pissa_init_dir = os.path.join(args.output_dir, "pissa_init") - logger.info("Initial PiSSA adatper will be saved at: {}.".format(pissa_init_dir)) + logger.info("Initial PiSSA adapter will be saved at: {}.".format(pissa_init_dir)) if isinstance(model, PeftModel): init_lora_weights = getattr(model.peft_config["default"], "init_lora_weights") setattr(model.peft_config["default"], "init_lora_weights", True)