Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Add precommit config (#1216)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincyZhang authored Jan 31, 2024
1 parent 3f62ceb commit 1fdf6f0
Show file tree
Hide file tree
Showing 603 changed files with 4,851 additions and 3,025 deletions.
13 changes: 13 additions & 0 deletions .github/license_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (c) 2024 Intel Corporation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ how to reproduce the test (including hardware information)

## Dependency Change?

any library dependency introduced or removed
any library dependency introduced or removed
3 changes: 0 additions & 3 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@ If you want to run tests locally, please refer to test yml and corresponding scr
| Kernel Benchmark | [sparse_lib_CI.yml](./sparse_lib_CI.yml) | [kernel-benchmark](./script/SparseLibCI/) |
| NeuralChat Workflows | [chatbot-test.yml](./chatbot-test.yml) | [chatbot](./script/chatbot/) |
|Copyright Check | [copyright_check.yml](./copyright_check.yml) | N/A |



6 changes: 3 additions & 3 deletions .github/workflows/chatbot-finetune-mpt-7b-chat-hpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- name: Clean Up Working Directory
run: sudo rm -rf ~/itrex-actions-runner/_work/intel-extension-for-transformers/intel-extension-for-transformers/*

- uses: actions/checkout@v3
with:
submodules: "recursive"
Expand Down Expand Up @@ -59,8 +59,8 @@ jobs:
--device hpu \
--use_habana \
--use_lazy_mode "
docker exec "chatbotfinetune-hpu-s0" bash -c "$cmd"
docker exec "chatbotfinetune-hpu-s0" bash -c "$cmd"
- name: Stop Container
if: success() || failure()
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/chatbot-finetune-mpt-7b-chat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
uses: actions/checkout@v2

- name: Load environment variables
run:
run:
cat ~/itrex-actions-runner/.env >> $GITHUB_ENV
- name: Prepare Cache
run: cp ${{ env.CACHE }}/torch/* ./

- name: Build Docker Image
run:
run:
if [[ $(docker images | grep chatbotfinetune-mpi | wc -l) == 0 ]]; then
docker build ./ --target cpu --build-arg REPO=${{ github.server_url }}/${{ github.repository }}.git --build-arg ITREX_VER=${{ github.head_ref }} --build-arg REPO_PATH="." --build-arg http_proxy="${{ env.HTTP_PROXY_IMAGE_BUILD }}" --build-arg https_proxy="${{ env.HTTPS_PROXY_IMAGE_BUILD }}" -f intel_extension_for_transformers/neural_chat/docker/Dockerfile -t chatbotfinetune-mpi:latest && yes | docker container prune && yes | docker image prune;
fi
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Print Logs and Check Finetuning Status
if: success() || failure()
run: |
sh .github/workflows/script/chatbot/finish_ft_mpt-7b-chat_mpi.sh
sh .github/workflows/script/chatbot/finish_ft_mpt-7b-chat_mpi.sh
- name: Stop Container
if: success() || failure()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/chatbot-inference-llama-2-7b-chat-hf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: cat ~/actions-runner/.env >> $GITHUB_ENV

- name: Build Docker Image
run:
run:
if [ $(docker images | grep chatbotinfer-1-gha | wc -l) == 0 ]; then
docker build --no-cache ./ --target cpu --build-arg REPO=${{ github.server_url }}/${{ github.repository }}.git --build-arg ITREX_VER=${{ github.head_ref }} --build-arg REPO_PATH="." --build-arg http_proxy="${{ env.HTTP_PROXY_IMAGE_BUILD }}" --build-arg https_proxy="${{ env.HTTPS_PROXY_IMAGE_BUILD }}" -f intel_extension_for_transformers/neural_chat/docker/Dockerfile -t chatbotinfer-1-gha:latest && yes | docker container prune && yes | docker image prune;
fi
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/chatbot-inference-mpt-7b-chat-hpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
submodules: "recursive"

- name: Load environment variables
run:
run:
cat ~/itrex-actions-runner/.env >> $GITHUB_ENV

- name: Build Docker Image
run: docker build --no-cache ./ --target hpu --build-arg ITREX_VER=${{ github.event.pull_request.head.ref }} --build-arg REPO=${{ github.server_url }}/${{ github.event.pull_request.head.repo.full_name }}.git --build-arg REPO_PATH="." --build-arg http_proxy="${{ env.HTTP_PROXY_IMAGE_BUILD }}" --build-arg https_proxy="${{ env.HTTPS_PROXY_IMAGE_BUILD }}" -f intel_extension_for_transformers/neural_chat/docker/Dockerfile -t chatbotinfer-hpu:latest && yes | docker container prune && yes | docker image prune

Expand All @@ -44,4 +44,3 @@ jobs:
- name: Test Summary
run: echo "Inference completed successfully"

4 changes: 2 additions & 2 deletions .github/workflows/chatbot-inference-mpt-7b-chat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
uses: actions/checkout@v2

- name: Load environment variables
run:
run:
cat ~/actions-runner/.env >> $GITHUB_ENV

- name: Build Docker Image
run:
run:
if [ $(docker images | grep chatbotinfer-1-gha | wc -l) == 0 ]; then
docker build --no-cache ./ --target cpu --build-arg REPO=${{ github.server_url }}/${{ github.repository }}.git --build-arg ITREX_VER=${{ github.head_ref }} --build-arg REPO_PATH="." --build-arg http_proxy="${{ env.HTTP_PROXY_IMAGE_BUILD }}" --build-arg https_proxy="${{ env.HTTPS_PROXY_IMAGE_BUILD }}" -f intel_extension_for_transformers/neural_chat/docker/Dockerfile -t chatbotinfer-1-gha:latest && yes | docker container prune && yes | docker image prune;
fi
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/chatbot-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ jobs:
#
# call-finetune-mpt-7b-chat-hpu:
# uses: ./.github/workflows/chatbot-finetune-mpt-7b-chat-hpu.yml

1 change: 0 additions & 1 deletion .github/workflows/chatbot_finetuning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ concurrency:
jobs:
call-finetune-mpt-7b-chat:
uses: ./.github/workflows/chatbot-finetune-mpt-7b-chat.yml

80 changes: 0 additions & 80 deletions .github/workflows/copyright_check.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/cpp-graph-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
env:
WORKSPACE: ${{ env.WORKING_DIR }}
GRAPH_DIR: ${{ env.WORKING_DIR }}/intel_extension_for_transformers/llm/runtime/graph

- name: Rename summary
run: |
cd ${{ github.workspace }}
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
uses: actions/download-artifact@v3
with:
path: ${{ env.OUT_SCRIPT_PATH }}/generated/log

- name: Merge CPP Graph Summary Log
run: |
cd ${{ env.OUT_SCRIPT_PATH }}/generated/log/cpp_graph
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/llm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Binary build
run: |
cd ${{ github.workspace }}
conda activate llm-test || source activate llm-test
conda activate llm-test || source activate llm-test
pip install build --upgrade
pip install -r requirements.txt
python setup.py sdist bdist_wheel
Expand All @@ -66,13 +66,13 @@ jobs:
run: |
cd ${{ github.workspace }}/.github/workflows/script/models
bash run_llm.sh --model=${{ matrix.modelName }} --framework=${{ matrix.framework }} --mode=${{ matrix.mode }} --conda_env_name=llm-test --precision=int8
- name: FP8 Benchmark
run: |
cd ${{ github.workspace }}/.github/workflows/script/models
bash run_llm.sh --model=${{ matrix.modelName }} --framework=${{ matrix.framework }} --mode=${{ matrix.mode }} --conda_env_name=llm-test --precision=fp8
- name: Publish pipeline artifact
uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
Expand Down Expand Up @@ -145,4 +145,3 @@ jobs:
echo "[Performance Regression] Some model performance regression occurred, please check artifacts and reports."
exit 1
fi
14 changes: 7 additions & 7 deletions .github/workflows/optimize-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ jobs:
docker exec ${{ env.CONTAINER_NAME }} \
bash -c "cd /intel-extension-for-transformers/.github/workflows/script/models \
&& bash run_optimize.sh --model=${{ matrix.modelName }} --framework=${{ matrix.framework }} --mode='tuning'"
- name: INT8 Benchmark
run: |
docker exec ${{ env.CONTAINER_NAME }} \
bash -c "cd /intel-extension-for-transformers/.github/workflows/script/models \
&& bash run_optimize.sh --model=${{ matrix.modelName }} --framework=${{ matrix.framework }} --mode=${{ matrix.mode }} --precision=int8 --PERF_STABLE_CHECK=${{ vars.PERF_STABLE_CHECK }}"
- name: FP32 Benchmark
run: |
docker exec ${{ env.CONTAINER_NAME }} \
Expand All @@ -127,7 +127,7 @@ jobs:
--output_dir=/intel-extension-for-transformers/${{matrix.framework}}_${{matrix.modelName}} \
--build_id=${{ github.run_id }} \
--model_test_type=optimize"
- name: Publish pipeline artifact
uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
Expand All @@ -136,7 +136,7 @@ jobs:
path: ${{ github.workspace }}/${{ matrix.framework }}_${{ matrix.modelName }}
if-no-files-found: ignore # 'warn' or 'ignore' are also available, defaults to `warn`
retention-days: 60 # 1 <= retention-days <= 90

Genreate-Report:
runs-on: itrex-node-spell
needs: [Optimize-Workflow]
Expand All @@ -156,7 +156,7 @@ jobs:
uses: actions/download-artifact@v3
with:
path: ${{ env.OUT_SCRIPT_PATH }}/log

- name: Analysis Summary
run: |
cd ${{ env.OUT_SCRIPT_PATH }}
Expand All @@ -178,7 +178,7 @@ jobs:
search_artifacts: false
skip_unpack: false
if_no_artifact_found: warn

- name: Display structure of downloaded files
run: cd ${{ env.OUT_SCRIPT_PATH }}/log && ls -R

Expand All @@ -194,7 +194,7 @@ jobs:
MR_source_branch: ${{ github.head_ref }}
ghprbActualCommit: ${{ github.event.pull_request.head.sha }}


- name: Publish Report
uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ jobs:
git config --local --get remote.origin.url
cd docs/build_docs
bash build.sh latest
- name: Push to github
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build_tmp/gh-pages
publish_branch: gh-pages

1 change: 0 additions & 1 deletion .github/workflows/script/chatbot/hpu_check/to_hpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
ly = torch.nn.Linear(2, 4)
ly.to("hpu")
print("hpu is available")

3 changes: 1 addition & 2 deletions .github/workflows/script/py_task_injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self, file_name: str, code_content: str, pattern: str) -> None:
self.file_path = file_name
self.code_content = code_content
self.pattern = pattern


def insert(self) -> None:
original_code = self.get_source_code(self.file_path)
Expand Down Expand Up @@ -70,4 +70,3 @@ def exists(target: str) -> bool:
code_inserter.insert()
else:
raise ValueError(f"invalid task: {args.task}")

12 changes: 6 additions & 6 deletions .github/workflows/unit-test-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
echo "remove left files through container ..."
docker exec ${{ env.EXTRA_CONTAINER_NAME }} bash -c "ls -a /intel-extension-for-transformers && rm -fr /intel-extension-for-transformers/* && rm -fr /intel-extension-for-transformers/.* || true"
fi
- name: Checkout out Repo
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
name: "UnitTest${{ matrix.test_name }}"
path: ${{ github.workspace }}/log_dir
retention-days: 5

Genreate-Report:
runs-on: itrex-node-spell
needs: [unit-test]
Expand All @@ -126,15 +126,15 @@ jobs:
fi
- name: Checkout out Repo
uses: actions/checkout@v3

- name: Download UT PR Log
uses: actions/download-artifact@v3
with:
path: ${{ github.workspace }}/log_dir

- name: Display structure of downloaded files
run: cd ${{ github.workspace }}/log_dir && ls -R

- name: Calculate coverage
run: |
cd ${{ github.workspace }}/.github/workflows/script/unitTest/coverage
Expand All @@ -146,4 +146,4 @@ jobs:
with:
name: Engine Unit Test
path: ${{ github.workspace }}/log_dir
retention-days: 5
retention-days: 5
Loading

0 comments on commit 1fdf6f0

Please sign in to comment.