Skip to content

Commit 3d6b9e1

Browse files
Lu TengLuFinch
andcommitted
[Doc] Update v0.2.0 release doc (#133)
Co-authored-by: Lu, Fengqing <[email protected]>
1 parent e75bde9 commit 3d6b9e1

File tree

5 files changed

+81
-44
lines changed

5 files changed

+81
-44
lines changed

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,29 @@ This guide introduces the overview of OpenXLA high level integration structure a
2626

2727
Verified Hardware Platforms:
2828

29-
* Intel® Data Center GPU Max Series, Driver Version: [682](https://dgpu-docs.intel.com/releases/production_682.14_20230804.html)
29+
* Intel® Data Center GPU Max Series, Driver Version: [736](https://dgpu-docs.intel.com/releases/stable_736_25_20231031.html)
3030

31-
* Intel® Data Center GPU Flex Series 170, Driver Version: [682](https://dgpu-docs.intel.com/releases/production_682.14_20230804.html)
31+
* Intel® Data Center GPU Flex Series 170, Driver Version: [736](https://dgpu-docs.intel.com/releases/stable_736_25_20231031.html)
3232

3333
### Software Requirements
3434

35-
* Ubuntu 22.04, Red Hat 8.6/8.8/9.2 (64-bit)
35+
* Ubuntu 22.04 (64-bit)
3636
* Intel® Data Center GPU Flex Series
37-
* Ubuntu 22.04, Red Hat 8.6/8.8/9.2 (64-bit), SUSE Linux Enterprise Server(SLES) 15 SP4
37+
* Ubuntu 22.04, SUSE Linux Enterprise Server(SLES) 15 SP4
3838
* Intel® Data Center GPU Max Series
39-
* Intel® oneAPI Base Toolkit 2023.2
39+
* Intel® oneAPI Base Toolkit 2024.0
4040
* Jax/Jaxlib 0.4.20
4141
* Python 3.9-3.11
4242
* pip 19.0 or later (requires manylinux2014 support)
4343

44+
**NOTE: Since Jax has its own [platform limitation](https://jax.readthedocs.io/en/latest/installation.html#supported-platforms) (Ubuntu 20.04 or later), real software requirements is restricted when works with Jax.**
45+
4446
### Install Intel GPU Drivers
4547

4648
|OS|Intel GPU|Install Intel GPU Driver|
4749
|-|-|-|
48-
|Ubuntu 22.04, Red Hat 8.6/8.8/9.2|Intel® Data Center GPU Flex Series| Refer to the [Installation Guides](https://dgpu-docs.intel.com/installation-guides/index.html#intel-data-center-gpu-flex-series) for latest driver installation. If install the verified Intel® Data Center GPU Max Series/Intel® Data Center GPU Flex Series [682](https://dgpu-docs.intel.com/releases/production_682.14_20230804.html), please append the specific version after components, such as `sudo apt-get install intel-opencl-icd==23.22.26516.25-682~22.04`|
49-
|Ubuntu 22.04, Red Hat 8.6/8.8/9.2, SLES 15 SP4|Intel® Data Center GPU Max Series| Refer to the [Installation Guides](https://dgpu-docs.intel.com/installation-guides/index.html#intel-data-center-gpu-max-series) for latest driver installation. If install the verified Intel® Data Center GPU Max Series/Intel® Data Center GPU Flex Series [682](https://dgpu-docs.intel.com/releases/production_682.14_20230804.html), please append the specific version after components, such as `sudo apt-get install intel-opencl-icd==23.22.26516.25-682~22.04`|
50+
|Ubuntu 22.04 |Intel® Data Center GPU Flex Series| Refer to the [Installation Guides](https://dgpu-docs.intel.com/installation-guides/index.html#intel-data-center-gpu-flex-series) for latest driver installation. If install the verified Intel® Data Center GPU Max Series/Intel® Data Center GPU Flex Series [736](https://dgpu-docs.intel.com/releases/stable_736_25_20231031.html), please append the specific version after components, such as `sudo apt-get install intel-opencl-icd==23.30.26918.50-736~22.04`|
51+
|Ubuntu 22.04, SLES 15 SP4|Intel® Data Center GPU Max Series| Refer to the [Installation Guides](https://dgpu-docs.intel.com/installation-guides/index.html#intel-data-center-gpu-max-series) for latest driver installation. If install the verified Intel® Data Center GPU Max Series/Intel® Data Center GPU Flex Series [736](https://dgpu-docs.intel.com/releases/stable_736_25_20231031.html), please append the specific version after components, such as `sudo apt-get install intel-opencl-icd==23.30.26918.50-736~22.04`|
5052

5153
### Install oneAPI Base Toolkit Packages
5254

@@ -57,13 +59,13 @@ Need to install components of Intel® oneAPI Base Toolkit:
5759
* Intel® oneAPI Threading Building Blocks (TBB), dependency of DPC++ Compiler.
5860

5961
```bash
60-
wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/992857b9-624c-45de-9701-f6445d845359/l_BaseKit_p_2023.2.0.49397_offline.sh
61-
sudo sh ./l_BaseKit_p_2023.2.0.49397_offline.sh
62+
wget https://registrationcenter-download.intel.com/akdlm//IRC_NAS/20f4e6a1-6b0b-4752-b8c1-e5eacba10e01/l_BaseKit_p_2024.0.0.49564.sh
63+
# 2 components are necessary: DPC++/C++ Compiler and oneMKL
64+
sudo sh l_BaseKit_p_2024.0.0.49564.sh
6265

6366
# Source OneAPI env
64-
source /opt/intel/oneapi/compiler/2023.2.0/env/vars.sh
65-
source /opt/intel/oneapi/mkl/2023.2.0/env/vars.sh
66-
source /opt/intel/oneapi/tbb/2021.9.0/env/vars.sh
67+
source /opt/intel/oneapi/compiler/2024.0/env/vars.sh
68+
source /opt/intel/oneapi/mkl/2024.0/env/vars.sh
6769
```
6870

6971
### Install Jax and Jaxlib
@@ -82,12 +84,13 @@ pip install --upgrade intel-extension-for-openxla
8284

8385
### Install from Source Build
8486

87+
**NOTE: Extra software (GCC 10.0.0 or later) is required if want to build from source.**
8588
```bash
8689
git clone https://github.com/intel/intel-extension-for-openxla.git
8790
./configure # Choose Yes for all.
8891
bazel build //xla/tools/pip_package:build_pip_package
8992
./bazel-bin/xla/tools/pip_package/build_pip_package ./
90-
pip install intel_extension_for_openxla-0.1.0-cp39-cp39-linux_x86_64.whl
93+
pip install intel_extension_for_openxla-0.2.0-cp39-cp39-linux_x86_64.whl
9194
```
9295

9396
**Aditional Build Option**:
@@ -163,4 +166,4 @@ jax.local_devices(): [xpu(id=0), xpu(id=1)]
163166
sudo apt install plocate
164167
locate libstdc++.so |grep /usr/lib/ # For example, the output of the library path is "/usr/lib/x86_64-linux-gnu/libstdc++.so.6".
165168
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/gcc/x86_64-linux-gnu/12/libstdc++.so
166-
```
169+
```

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# pylint: enable=g-import-not-at-top
3636

3737

38-
_DEFAULT_SYCL_TOOLKIT_PATH = '/opt/intel/oneapi/compiler/latest/linux'
38+
_DEFAULT_SYCL_TOOLKIT_PATH = '/opt/intel/oneapi/compiler/latest'
3939
_DEFAULT_AOT_CONFIG = ''
4040
_DEFAULT_GCC_TOOLCHAIN_PATH = ''
4141
_DEFAULT_GCC_TOOLCHAIN_TARGET = ''

example/bert/README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# Quick Start for fine-tunes BERT on SQuAD
2-
Fine-tunes BERT model on SQuAD task by [Question Answering examples](https://github.com/huggingface/transformers/tree/v4.27.4/examples/flax/question-answering#question-answering-examples).
2+
Fine-tunes BERT model on SQuAD task by [Question Answering examples](https://github.com/huggingface/transformers/tree/v4.32.0/examples/flax/question-answering#question-answering-examples).
33
This expample is referred from [HuggingFace Transformers](https://github.com/huggingface/transformers). See [Backup](#Backup) for modification details.
44

5+
6+
**IMPORTANT: This example is temporarily unavailable under JAX v0.4.20 with below error due to public issue (https://github.com/huggingface/transformers/issues/27644):**
7+
```
8+
AttributeError: 'ArrayImpl' object has no attribute 'split'
9+
```
10+
**Will reenable it once it's fixed in community.**
11+
12+
513
## Requirements
614

715
### 1. Install intel-extension-for-openxla
@@ -31,7 +39,7 @@ cd -
3139
### Running command
3240
```bash
3341
python run_qa.py \
34-
--model_name_or_path <WORKSPACE>/examples/bert/models \
42+
--model_name_or_path <WORKSPACE>/example/bert/models \
3543
--dataset_name squad \
3644
--do_train \
3745
--per_device_train_batch_size 8 \
@@ -62,10 +70,10 @@ Performance... xxx iter/s
6270
### Backup
6371
```patch
6472
diff --git a/examples/flax/question-answering/run_qa.py b/examples/flax/question-answering/run_qa.py
65-
index 230480428..00d901d76 100644
73+
index a2839539e..a530d8560 100644
6674
--- a/examples/flax/question-answering/run_qa.py
6775
+++ b/examples/flax/question-answering/run_qa.py
68-
@@ -821,7 +821,8 @@ def main():
76+
@@ -846,7 +846,8 @@ def main():
6977

7078
# region Training steps and logging init
7179
train_dataset = processed_raw_datasets["train"]
@@ -75,7 +83,7 @@ index 230480428..00d901d76 100644
7583

7684
# Log a few random samples from the training set:
7785
for index in random.sample(range(len(train_dataset)), 3):
78-
@@ -931,11 +932,12 @@ def main():
86+
@@ -957,11 +958,12 @@ def main():
7987
state = replicate(state)
8088

8189
train_time = 0
@@ -89,7 +97,7 @@ index 230480428..00d901d76 100644
8997
train_metrics = []
9098

9199
# Create sampling rng
92-
@@ -956,6 +958,13 @@ def main():
100+
@@ -982,6 +984,13 @@ def main():
93101

94102
cur_step = epoch * step_per_epoch + step
95103

@@ -103,7 +111,7 @@ index 230480428..00d901d76 100644
103111
if cur_step % training_args.logging_steps == 0 and cur_step > 0:
104112
# Save metrics
105113
train_metric = unreplicate(train_metric)
106-
@@ -1022,6 +1031,9 @@ def main():
114+
@@ -1048,6 +1057,9 @@ def main():
107115
if training_args.push_to_hub:
108116
repo.push_to_hub(commit_message=f"Saving weights and logs of step {cur_step}", blocking=False)
109117
epochs.desc = f"Epoch ... {epoch + 1}/{num_epochs}"

example/bert/requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
datasets >= 1.8.0
2-
jax>=0.4.13
3-
jaxlib>=0.4.13
4-
flax>=0.3.5
1+
datasets>=1.8.0
2+
jax==0.4.20
3+
jaxlib==0.4.20
4+
flax>=0.7.0
55
optax>=0.0.8
6-
transformers==4.27.4
6+
transformers==4.32.0
77
evaluate>=0.4.1

example/bert/run_qa.py

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import random
2626
import sys
2727
import time
28+
import warnings
2829
from dataclasses import asdict, dataclass, field
2930
from enum import Enum
3031
from pathlib import Path
@@ -55,13 +56,13 @@
5556
PreTrainedTokenizerFast,
5657
is_tensorboard_available,
5758
)
58-
from transformers.utils import check_min_version, get_full_repo_name, send_example_telemetry
59+
from transformers.utils import check_min_version, send_example_telemetry
5960

6061

6162
logger = logging.getLogger(__name__)
6263

6364
# Will error if the minimal version of Transformers is not installed. Remove at your own risks.
64-
check_min_version("4.27.0")
65+
check_min_version("4.32.0")
6566

6667
Array = Any
6768
Dataset = datasets.arrow_dataset.Dataset
@@ -155,12 +156,28 @@ class ModelArguments:
155156
default="main",
156157
metadata={"help": "The specific model version to use (can be a branch name, tag name or commit id)."},
157158
)
159+
token: str = field(
160+
default=None,
161+
metadata={
162+
"help": (
163+
"The token to use as HTTP bearer authorization for remote files. If not specified, will use the token "
164+
"generated when running `huggingface-cli login` (stored in `~/.huggingface`)."
165+
)
166+
},
167+
)
158168
use_auth_token: bool = field(
169+
default=None,
170+
metadata={
171+
"help": "The `use_auth_token` argument is deprecated and will be removed in v4.34. Please use `token`."
172+
},
173+
)
174+
trust_remote_code: bool = field(
159175
default=False,
160176
metadata={
161177
"help": (
162-
"Will use the token generated when running `huggingface-cli login` (necessary to use this script "
163-
"with private models)."
178+
"Whether or not to allow for custom models defined on the Hub in their own modeling files. This option"
179+
"should only be set to `True` for repositories you trust and in which you have read the code, as it will"
180+
"execute code present on the Hub on your local machine."
164181
)
165182
},
166183
)
@@ -438,6 +455,12 @@ def main():
438455
else:
439456
model_args, data_args, training_args = parser.parse_args_into_dataclasses()
440457

458+
if model_args.use_auth_token is not None:
459+
warnings.warn("The `use_auth_token` argument is deprecated and will be removed in v4.34.", FutureWarning)
460+
if model_args.token is not None:
461+
raise ValueError("`token` and `use_auth_token` are both specified. Please set only the argument `token`.")
462+
model_args.token = model_args.use_auth_token
463+
441464
# Sending telemetry. Tracking the example usage helps us better allocate resources to maintain them. The
442465
# information sent is the one passed as arguments along with your Python/PyTorch versions.
443466
send_example_telemetry("run_qa", model_args, data_args, framework="flax")
@@ -462,14 +485,14 @@ def main():
462485

463486
# Handle the repository creation
464487
if training_args.push_to_hub:
465-
if training_args.hub_model_id is None:
466-
repo_name = get_full_repo_name(
467-
Path(training_args.output_dir).absolute().name, token=training_args.hub_token
468-
)
469-
else:
470-
repo_name = training_args.hub_model_id
471-
create_repo(repo_name, exist_ok=True, token=training_args.hub_token)
472-
repo = Repository(training_args.output_dir, clone_from=repo_name, token=training_args.hub_token)
488+
# Retrieve of infer repo_name
489+
repo_name = training_args.hub_model_id
490+
if repo_name is None:
491+
repo_name = Path(training_args.output_dir).absolute().name
492+
# Create repo and retrieve repo_id
493+
repo_id = create_repo(repo_name, exist_ok=True, token=training_args.hub_token).repo_id
494+
# Clone repo locally
495+
repo = Repository(training_args.output_dir, clone_from=repo_id, token=training_args.hub_token)
473496

474497
# region Load Data
475498
# Get the datasets: you can either provide your own CSV/JSON/TXT training and evaluation files (see below)
@@ -487,7 +510,7 @@ def main():
487510
data_args.dataset_name,
488511
data_args.dataset_config_name,
489512
cache_dir=model_args.cache_dir,
490-
use_auth_token=True if model_args.use_auth_token else None,
513+
token=model_args.token,
491514
)
492515
else:
493516
# Loading the dataset from local csv or json file.
@@ -507,7 +530,7 @@ def main():
507530
data_files=data_files,
508531
field="data",
509532
cache_dir=model_args.cache_dir,
510-
use_auth_token=True if model_args.use_auth_token else None,
533+
token=model_args.token,
511534
)
512535
# See more about loading any type of standard or custom dataset (from files, python dict, pandas DataFrame, etc) at
513536
# https://huggingface.co/docs/datasets/loading_datasets.html.
@@ -520,14 +543,16 @@ def main():
520543
model_args.config_name if model_args.config_name else model_args.model_name_or_path,
521544
cache_dir=model_args.cache_dir,
522545
revision=model_args.model_revision,
523-
use_auth_token=True if model_args.use_auth_token else None,
546+
token=model_args.token,
547+
trust_remote_code=model_args.trust_remote_code,
524548
)
525549
tokenizer = AutoTokenizer.from_pretrained(
526550
model_args.tokenizer_name if model_args.tokenizer_name else model_args.model_name_or_path,
527551
cache_dir=model_args.cache_dir,
528552
use_fast=True,
529553
revision=model_args.model_revision,
530-
use_auth_token=True if model_args.use_auth_token else None,
554+
token=model_args.token,
555+
trust_remote_code=model_args.trust_remote_code,
531556
)
532557
# endregion
533558

@@ -875,7 +900,8 @@ def write_eval_metric(summary_writer, eval_metrics, step):
875900
config=config,
876901
cache_dir=model_args.cache_dir,
877902
revision=model_args.model_revision,
878-
use_auth_token=True if model_args.use_auth_token else None,
903+
token=model_args.token,
904+
trust_remote_code=model_args.trust_remote_code,
879905
seed=training_args.seed,
880906
dtype=getattr(jnp, model_args.dtype),
881907
)

0 commit comments

Comments
 (0)