From b3e4793ded8dd4071a64359c69d2c0bc6a0060a5 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: a8bf1abf0fd39f84748c94ac3ba39eaa53137529 --- 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 93ba3bd5b01040459a204adf5b8407a00c61e57d 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: 642c6d666f3bd00fcdea45c65a6394bcae9c2080 --- 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 955e01c038ccc708def77f392b0e342f2f51dc9b 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: 8bab99c5829a80752e461cf65a9124fdea609676 --- 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)