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

Commit

Permalink
Merge branch 'main' into modelscope_for_itrex
Browse files Browse the repository at this point in the history
  • Loading branch information
intellinjun authored Jul 9, 2024
2 parents 6c26dd2 + 3e85ca9 commit 8042963
Show file tree
Hide file tree
Showing 32 changed files with 121 additions and 103 deletions.
98 changes: 49 additions & 49 deletions .github/checkgroup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,54 +65,54 @@ subprojects:
- "engine-unit-test-PR-test"
- "Genreate-Engine-Report"

- id: "Windows Binary Test"
paths:
- ".github/workflows/windows-test.yml"
- "requirements.txt"
- "setup.py"
- "intel_extension_for_transformers/transformers/runtime/**"
- "intel_extension_for_transformers/transformers/llm/operator/**"
- "!intel_extension_for_transformers/transformers/runtime/third_party/**"
- "!intel_extension_for_transformers/transformers/runtime/docs/**"
- "!intel_extension_for_transformers/transformers/runtime/test/**"
checks:
- "Windows-Binary-Test"
# - id: "Windows Binary Test"
# paths:
# - ".github/workflows/windows-test.yml"
# - "requirements.txt"
# - "setup.py"
# - "intel_extension_for_transformers/transformers/runtime/**"
# - "intel_extension_for_transformers/transformers/llm/operator/**"
# - "!intel_extension_for_transformers/transformers/runtime/third_party/**"
# - "!intel_extension_for_transformers/transformers/runtime/docs/**"
# - "!intel_extension_for_transformers/transformers/runtime/test/**"
# checks:
# - "Windows-Binary-Test"

- id: "LLM Model Test workflow"
paths:
- ".github/workflows/llm-test.yml"
- ".github/workflows/script/models/run_llm.sh"
- "intel_extension_for_transformers/transformers/runtime/**"
- "!intel_extension_for_transformers/transformers/runtime/kernels/**"
- "!intel_extension_for_transformers/transformers/runtime/test/**"
- "!intel_extension_for_transformers/transformers/runtime/third_party/**"
- "!intel_extension_for_transformers/transformers/runtime/docs/**"
checks:
- "LLM-Workflow (gpt-j-6b, engine, latency, bf16,int8,fp8)"
- "Generate-LLM-Report"
# - id: "LLM Model Test workflow"
# paths:
# - ".github/workflows/llm-test.yml"
# - ".github/workflows/script/models/run_llm.sh"
# - "intel_extension_for_transformers/transformers/runtime/**"
# - "!intel_extension_for_transformers/transformers/runtime/kernels/**"
# - "!intel_extension_for_transformers/transformers/runtime/test/**"
# - "!intel_extension_for_transformers/transformers/runtime/third_party/**"
# - "!intel_extension_for_transformers/transformers/runtime/docs/**"
# checks:
# - "LLM-Workflow (gpt-j-6b, engine, latency, bf16,int8,fp8)"
# - "Generate-LLM-Report"

- id: "Chat Bot Test workflow"
paths:
- ".github/workflows/chatbot-test.yml"
- ".github/workflows/chatbot-inference-llama-2-7b-chat-hf.yml"
- ".github/workflows/chatbot-inference-mpt-7b-chat.yml"
- ".github/workflows/chatbot-finetune-mpt-7b-chat.yml"
- ".github/workflows/chatbot-inference-llama-2-7b-chat-hf-hpu.yml"
- ".github/workflows/chatbot-inference-mpt-7b-chat-hpu.yml"
- ".github/workflows/chatbot-finetune-mpt-7b-chat-hpu.yml"
- ".github/workflows/script/chatbot/**"
- ".github/workflows/sample_data/**"
- "intel_extension_for_transformers/neural_chat/**"
- "intel_extension_for_transformers/transformers/llm/finetuning/**"
- "intel_extension_for_transformers/transformers/llm/quantization/**"
- "intel_extension_for_transformers/transformers/**"
- "workflows/chatbot/inference/**"
- "workflows/chatbot/fine_tuning/**"
- "!intel_extension_for_transformers/neural_chat/docs/**"
- "!intel_extension_for_transformers/neural_chat/tests/ci/**"
- "!intel_extension_for_transformers/neural_chat/examples/**"
- "!intel_extension_for_transformers/neural_chat/assets/**"
- "!intel_extension_for_transformers/neural_chat/README.md"
checks:
- "call-inference-llama-2-7b-chat-hf / inference test"
- "call-inference-mpt-7b-chat / inference test"
# - id: "Chat Bot Test workflow"
# paths:
# - ".github/workflows/chatbot-test.yml"
# - ".github/workflows/chatbot-inference-llama-2-7b-chat-hf.yml"
# - ".github/workflows/chatbot-inference-mpt-7b-chat.yml"
# - ".github/workflows/chatbot-finetune-mpt-7b-chat.yml"
# - ".github/workflows/chatbot-inference-llama-2-7b-chat-hf-hpu.yml"
# - ".github/workflows/chatbot-inference-mpt-7b-chat-hpu.yml"
# - ".github/workflows/chatbot-finetune-mpt-7b-chat-hpu.yml"
# - ".github/workflows/script/chatbot/**"
# - ".github/workflows/sample_data/**"
# - "intel_extension_for_transformers/neural_chat/**"
# - "intel_extension_for_transformers/transformers/llm/finetuning/**"
# - "intel_extension_for_transformers/transformers/llm/quantization/**"
# - "intel_extension_for_transformers/transformers/**"
# - "workflows/chatbot/inference/**"
# - "workflows/chatbot/fine_tuning/**"
# - "!intel_extension_for_transformers/neural_chat/docs/**"
# - "!intel_extension_for_transformers/neural_chat/tests/ci/**"
# - "!intel_extension_for_transformers/neural_chat/examples/**"
# - "!intel_extension_for_transformers/neural_chat/assets/**"
# - "!intel_extension_for_transformers/neural_chat/README.md"
# checks:
# - "call-inference-llama-2-7b-chat-hf / inference test"
# - "call-inference-mpt-7b-chat / inference test"
1 change: 1 addition & 0 deletions .github/workflows/script/formatScan/nlp_dict.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
alse
ans
assertIn
bu
charactor
daa
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/script/install_binary.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

source /intel-extension-for-transformers/.github/workflows/script/change_color.sh

cd /intel-extension-for-transformers
Expand All @@ -10,7 +11,7 @@ git config --global --add safe.directory "*"
git submodule update --init --recursive


$BOLD_YELLOW && echo "---------------- run python setup.py sdist bdist_wheel -------------" && $RESET
$BOLD_YELLOW && echo "---------------- run python setup.py bdist_wheel -------------" && $RESET
python setup.py bdist_wheel


Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test-optimize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
with:
submodules: "recursive"
ref: ${{ matrix.test_branch }}
fetch-tags: true
fetch-depth: 0

- name: Docker Build
run: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: debug-statements
- id: mixed-line-ending
Expand Down Expand Up @@ -44,7 +44,7 @@ repos:
)$
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args: [-w, --ignore-words=.github/workflows/script/formatScan/nlp_dict.txt]
Expand Down
2 changes: 1 addition & 1 deletion docs/code_of_conduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
level of experience, education, socioeconomic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ENV COMPOSE_DOCKER_CLI_BUILD=0
# Install torch and intel-extension-for-pytorch 2.1
RUN python3 -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
RUN python3 -m pip install intel-extension-for-pytorch intel-extension-for-transformers optimum
RUN python3 -m pip install git+https://github.com/huggingface/optimum-intel.git@f95dea1ae8966dee4d75d622e7b2468c514ba02d
RUN python3 -m pip install git+https://github.com/huggingface/optimum-intel.git@50d867c13b22c22eda451ddb67bddb8159670f85
RUN python3 -m pip install git+https://github.com/bigcode-project/bigcode-evaluation-harness@0d84db85f9ff971fa23a187a3347b7f59af288dc

# Standard requirements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ transformers >= 4.35.0
tiktoken #code_gen
neural-compressor
intel_extension_for_pytorch==2.3.0
optimum-intel
git+https://github.com/huggingface/optimum-intel.git@50d867c13b22c22eda451ddb67bddb8159670f85
auto-round==0.2
git+https://github.com/bigcode-project/bigcode-evaluation-harness@094c7cc197d13a53c19303865e2056f1c7488ac1
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace qsl {
}
}

// Splice them togather
// Splice them together
Queue_t result;
for (auto& q : Buckets)
result.splice(result.end(), std::move(q));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def postprocess_qa_predictions_with_beam_search(

assert len(predictions[0]) == len(
features
), f"Got {len(predictions[0])} predicitions and {len(features)} features."
), f"Got {len(predictions[0])} predictions and {len(features)} features."

# Build a map example to its corresponding features.
example_id_to_index = {k: i for i, k in enumerate(examples["id"])}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sentencepiece != 0.1.92
--extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
torch==2.1.0a0
transformers
optimum-intel
git+https://github.com/huggingface/optimum-intel.git@50d867c13b22c22eda451ddb67bddb8159670f85
bitsandbytes #baichuan
transformers_stream_generator
tiktoken #qwen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sentencepiece != 0.1.92
torch==2.3.0+cpu
transformers==4.38.1
intel_extension_for_pytorch==2.3.0
optimum-intel==1.16.1
git+https://github.com/huggingface/optimum-intel.git@50d867c13b22c22eda451ddb67bddb8159670f85
bitsandbytes #baichuan
transformers_stream_generator
tiktoken #qwen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,7 @@

user_model = None

# tokenizer
if config.model_type == "llama":
from transformers import LlamaTokenizer
tokenizer = LlamaTokenizer.from_pretrained(args.model)
else:
tokenizer = AutoTokenizer.from_pretrained(args.model, trust_remote_code=args.trust_remote_code)
tokenizer = AutoTokenizer.from_pretrained(args.model, trust_remote_code=args.trust_remote_code)

quantization_config = None
if args.woq:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# 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.
"""Pipeline Modificaiton based from the diffusers 0.12.1 StableDiffusionInstructPix2PixPipeline"""
"""Pipeline Modification based from the diffusers 0.12.1 StableDiffusionInstructPix2PixPipeline"""

import inspect
from typing import Callable, List, Optional, Union
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ python run_executor.py --ir_path=./qat_int8_ir --mode=latency --input_model=runw
## 3. Accuracy
Frechet Inception Distance(FID) metric is used to evaluate the accuracy. This case we check the FID scores between the pytorch image and engine image.

By setting --accuracy to check FID socre.
By setting --accuracy to check FID score.
Python API command as follows:
```python
# FP32 IR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# 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.
"""Pipeline Modificaiton based from the diffusers 0.12.1 StableDiffusionImg2ImgPipeline"""
"""Pipeline Modification based from the diffusers 0.12.1 StableDiffusionImg2ImgPipeline"""

import inspect
from typing import Callable, List, Optional, Union
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Install requirements that have denpendency on stock pytorch"
"Install requirements that have dependency on stock pytorch"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Install requirements that have denpendency on stock pytorch"
"Install requirements that have dependency on stock pytorch"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ mkdir /home/nfs_images
export IMAGE_SERVER_IP="your.server.ip"
```

# Configurate photoai.yaml
# Configure photoai.yaml

You can customize the configuration file `photoai.yaml` to match your environment setup. Here's a table to help you understand the configurable options:

Expand All @@ -91,9 +91,9 @@ You can customize the configuration file `photoai.yaml` to match your environmen
| tasks_list | ['voicechat', 'photoai'] |


# Configurate Environment Variables
# Configure Environment Variables

Configurate all of the environment variables in file `run.sh` using `export XXX=xxx`. Here's a table of all the variables needed to configurate.
Configure all of the environment variables in file `run.sh` using `export XXX=xxx`. Here's a table of all the variables needed to configure.

| Variable | Value |
| ------------------- | ---------------------------------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# 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.
"""Parse and Evalate."""
"""Parse and Evaluate."""
import os
import json

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# 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.
"""Parse and Evalate."""
"""Parse and Evaluate."""
import os
import json
import shlex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# 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.
"""Pipeline Modificaiton based from the diffusers 0.12.1 StableDiffusionInstructPix2PixPipeline."""
"""Pipeline Modification based from the diffusers 0.12.1 StableDiffusionInstructPix2PixPipeline."""

import inspect
from typing import Callable, List, Optional, Union
Expand Down
Loading

0 comments on commit 8042963

Please sign in to comment.