Skip to content

Commit

Permalink
1. refine cpu Dockerfile for better performance 2. add ipex_bert exam…
Browse files Browse the repository at this point in the history
…ple (#257)

Signed-off-by: Yao, Matrix <matrix.yao@intel.com>
  • Loading branch information
yao-matrix authored Sep 5, 2024
1 parent 1cf5bfa commit be2e253
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docker/cpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ ENV DEBIAN_FRONTEND noninteractive
ENV PATH="/home/user/.local/bin:${PATH}"
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1-mesa-dev libglib2.0-0 \
sudo build-essential git bash-completion \
sudo build-essential git bash-completion numactl \
python3.10 python3-pip python3.10-dev google-perftools && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 && \
pip install --no-cache-dir --upgrade pip setuptools wheel
pip install --no-cache-dir --upgrade pip setuptools wheel intel-openmp

ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4"
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4:/usr/local/lib/libiomp5.so"

# Install PyTorch
ARG TORCH_VERSION=stable
Expand Down
29 changes: 29 additions & 0 deletions examples/ipex_bert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
defaults:
- benchmark
- scenario: inference
- launcher: process
- backend: ipex
- _base_
- _self_

name: ipex_bert

launcher:
numactl: true
numactl_kwargs:
cpunodebind: 0
membind: 0

scenario:
latency: true
memory: true
input_shapes:
batch_size: 1
sequence_length: 128

backend:
device: cpu
no_weights: true
export: true
torch_dtype: bfloat16
model: bert-base-uncased

0 comments on commit be2e253

Please sign in to comment.