From 4e1a7630aa408b592c5d833c7ca8bdff46f9c4bf Mon Sep 17 00:00:00 2001 From: SkqLiao Date: Fri, 14 Mar 2025 23:13:39 +0800 Subject: [PATCH 1/4] fix cicd script --- .github/workflows/install.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 31d37bbf..402868d8 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -40,7 +40,6 @@ jobs: conda activate ktransformers-dev pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126 pip3 install packaging ninja cpufeature numpy - wget pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.2cxx11abiTRUE-cp311-cp311-linux_x86_64.whl - name: Install KTransformers run: | From 8c51f520ddb4c56c54595630f05870b4bc9d50df Mon Sep 17 00:00:00 2001 From: SkqLiao Date: Sat, 15 Mar 2025 01:43:38 +0800 Subject: [PATCH 2/4] fix install issue & add test --- .github/workflows/install.yml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 402868d8..7ba9be8d 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -6,11 +6,12 @@ on: job_to_run: description: "Which job to run?" required: true - default: "install" + default: "install&test" type: choice options: - - create&install - - install + - create&install&&test + - install&&test + - test jobs: Install-KTransformers: runs-on: self-hosted @@ -22,31 +23,43 @@ jobs: - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - name: Remove old conda environment continue-on-error: true - if: ${{ inputs.job_to_run == 'create&install'}} + if: contains(inputs.job_to_run, 'create') run: | source /home/qujing3/anaconda3/etc/profile.d/conda.sh conda env remove --name ktransformers-dev -y - name: Create conda environment - if: ${{ inputs.job_to_run == 'create&install'}} + if: contains(inputs.job_to_run, 'create') run: | source /home/qujing3/anaconda3/etc/profile.d/conda.sh conda create --name ktransformers-dev python=3.11 conda activate ktransformers-dev conda install -c conda-forge libstdcxx-ng -y - name: Install dependencies - if: ${{ inputs.job_to_run == 'create&install'}} + if: contains(inputs.job_to_run, 'create') run: | source /home/qujing3/anaconda3/etc/profile.d/conda.sh conda activate ktransformers-dev pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126 pip3 install packaging ninja cpufeature numpy - pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.2cxx11abiTRUE-cp311-cp311-linux_x86_64.whl + pip install ~/flash_attn-2.7.4.post1+cu12torch2.6cxx11abiTRUE-cp311-cp311-linux_x86_64.whl - name: Install KTransformers + if: contains(inputs.job_to_run, 'install') run: | source /home/qujing3/anaconda3/etc/profile.d/conda.sh conda activate ktransformers-dev + pip3 uninstall ktransformers -y cd ${{ github.workspace }} git submodule init git submodule update - USE_NUMA=1 bash install.sh + bash install.sh + - name: Test Local Chat + run: | + source /home/qujing3/anaconda3/etc/profile.d/conda.sh + conda activate ktransformers-dev + export PATH=/usr/local/cuda-12.4/bin:$PATH + export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64:$LD_LIBRARY_PATH + export CUDA_HOME=/usr/local/cuda-12.4 + cd ${{ github.workspace }} + python ktransformers/local_chat.py --model_path /home/qujing3/models/DeepSeek-R1-Q4_K_M/config --gguf_path /home/qujing3/models/DeepSeek-R1-Q4_K_M/ --max_new_tokens 100 --cache_len 1536 --cpu_infer 64 --prompt_file /home/qujing3/promptsbook.txt + DeepSeek-R1-Q4_K_M/config --gguf_path /home/qujing3/models/DeepSeek-R1-Q4_K_M/ --max_new_tokens 100 --cache_len 1536 --cpu_infer 64 --prompt_file /home/qujing3/prompts/chinese.txt - run: echo "This job's status is ${{ job.status }}." From 6c98bb600923a86d9cb60ba38cf1cfa2cdacb179 Mon Sep 17 00:00:00 2001 From: SkqLiao Date: Sat, 15 Mar 2025 01:45:07 +0800 Subject: [PATCH 3/4] modify job name --- .github/workflows/install.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 7ba9be8d..04065c36 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -1,5 +1,5 @@ -name: Install KTransformers -run-name: Install KTransformers +name: Install and Test KTransformers +run-name: Install and Test KTransformers on: workflow_dispatch: inputs: @@ -13,7 +13,7 @@ on: - install&&test - test jobs: - Install-KTransformers: + Install-Test-KTransformers: runs-on: self-hosted steps: - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." From bd9dc55a8d5195871a4db2dc3a5f6bee7284575b Mon Sep 17 00:00:00 2001 From: SkqLiao Date: Sat, 15 Mar 2025 01:45:49 +0800 Subject: [PATCH 4/4] fix option typos --- .github/workflows/install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index 04065c36..c8a87a49 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -9,8 +9,8 @@ on: default: "install&test" type: choice options: - - create&install&&test - - install&&test + - create-install-test + - install-test - test jobs: Install-Test-KTransformers: