Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
6554c32
Update README.md
jimmytwei Jun 20, 2024
0838f49
Update README.md
jimmytwei Jun 20, 2024
dff031b
Update README.md
jimmytwei Jun 21, 2024
6310039
Update lu_solve_omp_offload_optimized.F90
jimmytwei Jun 21, 2024
bcc0cfe
Update openmp_sample.f90 (#2371)
jimmytwei Jun 25, 2024
370b96f
Update openmp_sample.f90
jimmytwei Jun 26, 2024
4f9249f
Update README.md
jimmytwei Jun 26, 2024
0ff9bb5
Update inc_quantize_model.py
jimmytwei Jun 26, 2024
46abf6a
Update inc_sample_tensorflow.ipynb
jimmytwei Jun 26, 2024
7eb44e9
Update requirements.txt
jimmytwei Jun 26, 2024
aa3f6c1
replace conda install with pip (#2389)
alexsin368 Jul 22, 2024
154441c
2024.2 install changes for conda forge (#2388)
louie-tsai Jul 22, 2024
1895814
Update README.md to reflect changes in compiler output. (#2402)
xmnboy Jul 30, 2024
46c43ee
Updated samples for AI Tools 2024.2 (#2391)
Ankur-singh Jul 30, 2024
6f39bf5
Update README.md
ishaghosh27 Jul 31, 2024
06e7fb6
Revert "Updated samples for AI Tools 2024.2 (#2391)" (#2414)
jimmytwei Aug 1, 2024
9b07a27
Updated Deprecated APIs (#2420)
ankur-singh-intel Aug 1, 2024
522ed22
updated sample json files (#2418)
ankur-singh-intel Aug 1, 2024
7b2bc26
Update README.md
jimmytwei Aug 2, 2024
a234f27
Fix Coarray Sample setvars in README (#2411)
intelfong326 Aug 2, 2024
f28634b
Fix Tachyon filename in README (#2404)
fongjiantan Aug 2, 2024
2e7e572
remove TF serving
othakkar Aug 5, 2024
ea19613
replace tf_keras with tf.keras
othakkar Aug 5, 2024
876a402
Add Vectorize VecMatMult Windows instruction (#2428)
yeetengang Aug 6, 2024
af11043
Update How to Run Sample on Matrix_Multiply_VTune (#2426)
intelfong326 Aug 6, 2024
d502b37
Update how to run sample for matrix_multiply_advisor (#2427)
yeetengang Aug 6, 2024
99c939a
Fix compiler env variable in oneDNN README (#2413)
fongjiantan Aug 6, 2024
de5f632
Fix TBB-Async-Sycl README format (#2416)
fongjiantan Aug 6, 2024
22d47cc
added missing argument (#2431)
ankur-singh-intel Aug 6, 2024
ccc02e9
Moved AI-and-Analytics/Jupyter folder to Training (#2435)
jimmytwei Aug 6, 2024
d13605a
Merge pull request #2438 from fongjiantan/release/2024.2_AITools
jimmytwei Aug 7, 2024
e0cc5e2
Bump transformers
dependabot[bot] Aug 7, 2024
9d520b3
Merge pull request #2439 from oneapi-src/dependabot/pip/AI-and-Analyt…
jimmytwei Aug 7, 2024
7af8d17
Update requirements.txt
jimmytwei Aug 7, 2024
4522bea
Update Genetic Algorithm code sample according to new numba-dpex API
Posiadacz07 Aug 7, 2024
044d71c
Merge pull request #2440 from krzeszew/krzeszew/numba-dpex-api-update…
jimmytwei Aug 7, 2024
0756af1
modifying requirements
othakkar Aug 7, 2024
4a0ec3d
removed notebook execution command
ankur-singh-intel Aug 7, 2024
767de51
Merge pull request #2433 from othakkar/othakkar/remove_tf_serving_rel…
jimmytwei Aug 7, 2024
c9e0e86
Merge pull request #2441 from Ankur-singh/release/2024.2_AITools
jimmytwei Aug 7, 2024
ae187d1
updated sample.json and notebook to use new activate path for AI toolkit
ankur-singh-intel Aug 8, 2024
90a9fe4
Merge pull request #2442 from Ankur-singh/fix/tf_getting_started
jimmytwei Aug 12, 2024
1412d8a
Update README.md Modin GS
raistefintel Aug 13, 2024
f62c332
Update README.md XGBoost GS
raistefintel Aug 13, 2024
7e8801b
Update README.md daal4py GS
raistefintel Aug 13, 2024
5f6073f
Update readme.md sklearnex GS
raistefintel Aug 13, 2024
8b386e9
Update README.md modin vs pandas
raistefintel Aug 13, 2024
a6216a3
Merge pull request #2447 from raistefintel/patch-11
jimmytwei Aug 13, 2024
8e1d54d
Merge pull request #2448 from raistefintel/patch-13
jimmytwei Aug 13, 2024
6f1906f
Merge pull request #2449 from raistefintel/patch-14
jimmytwei Aug 13, 2024
0666878
Merge pull request #2450 from raistefintel/patch-15
jimmytwei Aug 13, 2024
058cc56
Merge pull request #2451 from raistefintel/patch-16
jimmytwei Aug 13, 2024
47e5d87
Update TextGenerationModelTraining.ipynb
jimmytwei Aug 16, 2024
de74fca
Update TextGenerationModelTraining.py
jimmytwei Aug 16, 2024
0cf470c
Update sample.json
jimmytwei Aug 16, 2024
a81f9dc
Merge branch 'master' into release/2024.2_AITools
jimmytwei Aug 16, 2024
495ff2b
Merge pull request #2457 from oneapi-src/release/2024.2_AITools
jimmytwei Aug 16, 2024
ea18003
Update README.md
ishaghosh27 Aug 22, 2024
0806dcb
Update README.md
ishaghosh27 Aug 22, 2024
0d8ec9a
Update README.md
ishaghosh27 Aug 22, 2024
7b6c5c0
Merge pull request #2466 from oneapi-src/release/2024.2_AITools
jimmytwei Aug 22, 2024
af0c08b
Update README.md (#2473)
jimmytwei Aug 30, 2024
0928522
Remove deprecated target variant dispatch from oneMKL sample
andrewtbarker Sep 3, 2024
6be606b
Merge pull request #2474 from andrewtbarker/deprecated-dispatch
jimmytwei Sep 17, 2024
c9c1625
Change ref to default branch as main (#2519)
mvincerx Oct 15, 2024
596b11b
Fix the bug of compiler wrong set
Martin-HZK Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 16 additions & 16 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: github-samples-app
on:
push:
branches:
- master
- main

workflow_dispatch:
workflow_dispatch:

# schedule:
# - cron: '55 13 * * *'

# Top-level default; empty/no permissions
permissions: {}
# Top-level default; empty/no permissions
permissions: {}

jobs:
pages:
Expand All @@ -33,36 +33,36 @@ jobs:
ref: 'refs/heads/app/dev'

- uses: actions/checkout@v3
name: Check out master # checks out master in subdirectory
name: Check out main # checks out main in subdirectory
with:
ref: 'refs/heads/master'
path: master
ref: 'refs/heads/main'
path: main

- name: Build JSON DB
run: |
python3 -m pip install -r src/requirements.txt
echo master
python3 src/db.py master
echo main
python3 src/db.py main

- name: Remove JSON pre-prod
run: |
- name: Remove JSON pre-prod
run: |
rm -rf src/docs/sample_db_pre.json

- name: Build Sphinx
run: |
run: |
python3 -m sphinx -W -b html src/docs/ src/docs/_build/
echo $PWD
echo ${{ github.ref }}

- name: Add GPU-Occupancy-Calculator
env:
env:
GPU_OCC_CALC: src/docs/_build/Tools/GPU-Occupancy-Calculator/
run: |
mkdir -p ${GPU_OCC_CALC}
cp -v ${{ github.workspace }}/master/Tools/GPU-Occupancy-Calculator/index.html ${GPU_OCC_CALC}/index.html
cp -v ${{ github.workspace }}/main/Tools/GPU-Occupancy-Calculator/index.html ${GPU_OCC_CALC}/index.html

- name: Push docs
if: ${{ github.ref == 'refs/heads/master' }} # only if this workflow is run from the master branch, push docs
if: ${{ github.ref == 'refs/heads/main' }} # only if this workflow is run from the main branch, push docs
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}
Expand Down
11 changes: 4 additions & 7 deletions AI-and-Analytics/End-to-end-Workloads/Census/sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
"env": [],
"id": "Intel_Modin_E2E_py",
"steps": [
"set -e # Terminate the script on first error",
"source /root/intel/oneapi/intelpython/bin/activate",
"conda create -n modin-hdk python=3.9 -y",
"conda activate modin-hdk",
"source /intel/oneapi/intelpython/bin/activate",
"conda install modin-hdk -c conda-forge -y",
"pip install scikit-learn scikit-learn-intelex matplotlib jupyter ipykernel",
"python -m ipykernel install --name modin-hdk",
"jupyter nbconvert --to notebook --execute census_modin.ipynb"
"pip install scikit-learn scikit-learn-intelex matplotlib",
"pip install jupyter",
"jupyter nbconvert --to notebook census_modin.ipynb"
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ This section explains how to train a model for language identification using the

1. Install Jupyter Notebook.
```
conda install jupyter nb_conda_kernels
pip install notebook
```
2. Launch Jupyter Notebook.
```
Expand Down Expand Up @@ -241,7 +241,7 @@ To run inference, you must have already run all of the training scripts, generat

1. If you have not already done so, install Jupyter Notebook.
```
conda install jupyter nb_conda_kernels
pip install notebook
```
2. Launch Jupyter Notebook.
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"source": [
"from datasets import load_dataset\n",
"\n",
"dataset = load_dataset(\"emotion\", name=\"split\")\n",
"dataset = load_dataset(\"emotion\", name=\"split\", trust_remote_code=True)\n",
"dataset['train'][:10]"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

from datasets import load_dataset

dataset = load_dataset("emotion", name="split")
dataset = load_dataset("emotion", name="split", trust_remote_code=True)
dataset['train'][:10]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"linux": [{
"id": "intel amx bf16 int8 inference",
"steps": [
"source /root/intel/oneapi/intelpython/bin/activate",
"source /intel/oneapi/intelpython/bin/activate",
"conda activate pytorch",
"python -m pip install -r requirements.txt",
"python -m ipykernel install --user --name=user_pytorch",
"python -m ipykernel install --user --name=pytorch",
"python pytorch_inference_vnni.py",
"python pytorch_inference_amx.py",
"jupyter nbconvert --ExecutePreprocessor.kernel_name=pytorch --to notebook IntelPyTorch_InferenceOptimizations_AMX_BF16_INT8.ipynb"
"jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=pytorch --to notebook IntelPyTorch_InferenceOptimizations_AMX_BF16_INT8.ipynb"
]
}]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
matplotlib
py-cpuinfo
notebook
ipykernel
transformers
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
{
"id": "intel amx bf16 training",
"steps": [
"source /root/intel/oneapi/intelpython/bin/activate",
"source /intel/oneapi/intelpython/bin/activate",
"conda activate pytorch",
"python -m pip install -r requirements.txt",
"python -m ipykernel install --user --name=user_pytorch",
"python -m ipykernel install --user --name=pytorch",
"python pytorch_training_avx512_bf16.py",
"python pytorch_training_amx_bf16.py",
"jupyter nbconvert --ExecutePreprocessor.kernel_name=pytorch --to notebook IntelPyTorch_TrainingOptimizations_AMX_BF16.ipynb"
"jupyter nbconvert --ExecutePreprocessor.enabled=True --ExecutePreprocessor.kernel_name=pytorch --to notebook IntelPyTorch_TrainingOptimizations_AMX_BF16.ipynb"
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
"\n",
"The only par that differs form the standard implementation is the evaluation function.\n",
"\n",
"The most important part is to specify the global index of the computation. This is the current index of the computed chromosomes. This serves as a loop function across all chromosomes."
"The most important part is to specify the index of the computation. This is the current index of the computed chromosomes. This serves as a loop function across all chromosomes."
]
},
{
Expand All @@ -365,10 +365,11 @@
"outputs": [],
"source": [
"import numba_dpex\n",
"from numba_dpex import kernel_api\n",
"\n",
"@numba_dpex.kernel\n",
"def eval_genomes_sycl_kernel(chromosomes, fitnesses, chrom_length):\n",
" pos = numba_dpex.get_global_id(0)\n",
"def eval_genomes_sycl_kernel(item: kernel_api.Item, chromosomes, fitnesses, chrom_length):\n",
" pos = item.get_id(0)\n",
" num_loops = 3000\n",
" for i in range(num_loops):\n",
" fitnesses[pos] += chromosomes[pos*chrom_length + 1]\n",
Expand Down Expand Up @@ -409,8 +410,9 @@
" chromosomes_flat = chromosomes.flatten()\n",
" chromosomes_flat_dpctl = dpnp.asarray(chromosomes_flat, device=\"gpu\")\n",
" fitnesses_dpctl = dpnp.asarray(fitnesses, device=\"gpu\")\n",
"\n",
" eval_genomes_sycl_kernel[numba_dpex.Range(pop_size)](chromosomes_flat_dpctl, fitnesses_dpctl, chrom_size)\n",
" \n",
" exec_range = kernel_api.Range(pop_size)\n",
" numba_dpex.call_kernel(eval_genomes_sycl_kernel, exec_range, chromosomes_flat_dpctl, fitnesses_dpctl, chrom_size)\n",
" fitnesses = dpnp.asnumpy(fitnesses_dpctl)\n",
" chromosomes = next_generation(chromosomes, fitnesses)\n",
" fitnesses = np.zeros(pop_size, dtype=np.float32)\n",
Expand Down Expand Up @@ -544,7 +546,7 @@
"\n",
"The evaluate created generation we are calculating the full distance of the given path (chromosome). In this example, the lower the fitness value is, the better the chromosome. That's different from the general GA that we implemented.\n",
"\n",
"As in this example we are also using numba-dpex, we are using a global index like before."
"As in this example we are also using numba-dpex, we are using an index like before."
]
},
{
Expand All @@ -554,8 +556,8 @@
"outputs": [],
"source": [
"@numba_dpex.kernel\n",
"def eval_genomes_plain_TSP_SYCL(chromosomes, fitnesses, distances, pop_length):\n",
" pos = numba_dpex.get_global_id(0)\n",
"def eval_genomes_plain_TSP_SYCL(item: kernel_api.Item, chromosomes, fitnesses, distances, pop_length):\n",
" pos = item.get_id(1)\n",
" for j in range(pop_length-1):\n",
" fitnesses[pos] += distances[int(chromosomes[pos, j]), int(chromosomes[pos, j+1])]\n"
]
Expand Down Expand Up @@ -708,7 +710,8 @@
" chromosomes_flat_dpctl = dpnp.asarray(chromosomes, device=\"gpu\")\n",
" fitnesses_dpctl = dpnp.asarray(fitnesses.copy(), device=\"gpu\")\n",
"\n",
" eval_genomes_plain_TSP_SYCL[numba_dpex.Range(pop_size)](chromosomes_flat_dpctl, fitnesses_dpctl, distances_dpctl, pop_size)\n",
" exec_range = kernel_api.Range(pop_size)\n",
" numba_dpex.call_kernel(eval_genomes_plain_TSP_SYCL, exec_range, chromosomes_flat_dpctl, fitnesses_dpctl, distances_dpctl, pop_size)\n",
" fitnesses = dpnp.asnumpy(fitnesses_dpctl)\n",
" chromosomes = next_generation_TSP(chromosomes, fitnesses)\n",
" fitnesses = np.zeros(pop_size, dtype=np.float32)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,17 @@ def next_generation(chromosomes, fitnesses):
#
# The only par that differs form the standard implementation is the evaluation function.
#
# The most important part is to specify the global index of the computation. This is the current index of the computed chromosomes. This serves as a loop function across all chromosomes.
# The most important part is to specify the index of the computation. This is the current index of the computed chromosomes. This serves as a loop function across all chromosomes.

# In[ ]:


import numba_dpex
from numba_dpex import kernel_api

@numba_dpex.kernel
def eval_genomes_sycl_kernel(chromosomes, fitnesses, chrom_length):
pos = numba_dpex.get_global_id(0)
def eval_genomes_sycl_kernel(item: kernel_api.Item, chromosomes, fitnesses, chrom_length):
pos = item.get_id(0)
num_loops = 3000
for i in range(num_loops):
fitnesses[pos] += chromosomes[pos*chrom_length + 1]
Expand Down Expand Up @@ -300,7 +301,8 @@ def eval_genomes_sycl_kernel(chromosomes, fitnesses, chrom_length):
chromosomes_flat_dpctl = dpnp.asarray(chromosomes_flat, device="gpu")
fitnesses_dpctl = dpnp.asarray(fitnesses, device="gpu")

eval_genomes_sycl_kernel[numba_dpex.Range(pop_size)](chromosomes_flat_dpctl, fitnesses_dpctl, chrom_size)
exec_range = kernel_api.Range(pop_size)
numba_dpex.call_kernel(eval_genomes_sycl_kernel, exec_range, chromosomes_flat_dpctl, fitnesses_dpctl, chrom_size)
fitnesses = dpnp.asnumpy(fitnesses_dpctl)
chromosomes = next_generation(chromosomes, fitnesses)
fitnesses = np.zeros(pop_size, dtype=np.float32)
Expand Down Expand Up @@ -398,14 +400,14 @@ def eval_genomes_sycl_kernel(chromosomes, fitnesses, chrom_length):
#
# The evaluate created generation we are calculating the full distance of the given path (chromosome). In this example, the lower the fitness value is, the better the chromosome. That's different from the general GA that we implemented.
#
# As in this example we are also using numba-dpex, we are using a global index like before.
# As in this example we are also using numba-dpex, we are using an index like before.

# In[ ]:


@numba_dpex.kernel
def eval_genomes_plain_TSP_SYCL(chromosomes, fitnesses, distances, pop_length):
pos = numba_dpex.get_global_id(0)
def eval_genomes_plain_TSP_SYCL(item: kernel_api.Item, chromosomes, fitnesses, distances, pop_length):
pos = item.get_id(1)
for j in range(pop_length-1):
fitnesses[pos] += distances[int(chromosomes[pos, j]), int(chromosomes[pos, j+1])]

Expand Down Expand Up @@ -526,7 +528,8 @@ def next_generation_TSP(chromosomes, fitnesses):
chromosomes_flat_dpctl = dpnp.asarray(chromosomes, device="gpu")
fitnesses_dpctl = dpnp.asarray(fitnesses.copy(), device="gpu")

eval_genomes_plain_TSP_SYCL[numba_dpex.Range(pop_size)](chromosomes_flat_dpctl, fitnesses_dpctl, distances_dpctl, pop_size)
exec_range = kernel_api.Range(pop_size)
numba_dpex.call_kernel(eval_genomes_plain_TSP_SYCL, exec_range, chromosomes_flat_dpctl, fitnesses_dpctl, distances_dpctl, pop_size)
fitnesses = dpnp.asnumpy(fitnesses_dpctl)
chromosomes = next_generation_TSP(chromosomes, fitnesses)
fitnesses = np.zeros(pop_size, dtype=np.float32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
"\n",
"@numba_dpex.kernel\n",
"def knn_numba_dpex(\n",
" item: numba_dpex.kernel_api.Item,\n",
" train,\n",
" train_labels,\n",
" test,\n",
Expand All @@ -339,8 +340,8 @@
" votes_to_classes_lst,\n",
"):\n",
" dtype = train.dtype\n",
" i = numba_dpex.get_global_id(0)\n",
" queue_neighbors = numba_dpex.private.array(shape=(3, 2), dtype=dtype)\n",
" i = item.get_id(0)\n",
" queue_neighbors = numba_dpex.kernel_api.PrivateArray(shape=(3, 2), dtype=dtype)\n",
"\n",
" for j in range(k):\n",
" x1 = train[j, 0]\n",
Expand Down Expand Up @@ -436,8 +437,15 @@
"y_train_dpt = dpnp.asarray(y_train.values, device=\"cpu\")\n",
"X_test_dpt = dpnp.asarray(X_test.values, device=\"cpu\")\n",
"\n",
"knn_numba_dpex[numba_dpex.Range(len(X_test.values))](\n",
" X_train_dpt, y_train_dpt, X_test_dpt, 3, predictions, votes_to_classes_lst\n",
"numba_dpex.call_kernel(\n",
" knn_numba_dpex,\n",
" numba_dpex.Range(len(X_test.values)),\n",
" X_train_dpt,\n",
" y_train_dpt,\n",
" X_test_dpt,\n",
" 3,\n",
" predictions,\n",
" votes_to_classes_lst,\n",
")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ def knn_numba(X_train, y_train, X_test, k):

@numba_dpex.kernel
def knn_numba_dpex(
item: numba_dpex.kernel_api.Item,
train,
train_labels,
test,
Expand All @@ -245,8 +246,8 @@ def knn_numba_dpex(
votes_to_classes_lst,
):
dtype = train.dtype
i = numba_dpex.get_global_id(0)
queue_neighbors = numba_dpex.private.array(shape=(3, 2), dtype=dtype)
i = item.get_id(0)
queue_neighbors = numba_dpex.kernel_api.PrivateArray(shape=(3, 2), dtype=dtype)

for j in range(k):
x1 = train[j, 0]
Expand Down Expand Up @@ -333,8 +334,15 @@ def knn_numba_dpex(
y_train_dpt = dpnp.asarray(y_train.values, device="cpu")
X_test_dpt = dpnp.asarray(X_test.values, device="cpu")

knn_numba_dpex[numba_dpex.Range(len(X_test.values))](
X_train_dpt, y_train_dpt, X_test_dpt, 3, predictions, votes_to_classes_lst
numba_dpex.call_kernel(
knn_numba_dpex,
numba_dpex.Range(len(X_test.values)),
X_train_dpt,
y_train_dpt,
X_test_dpt,
3,
predictions,
votes_to_classes_lst,
)


Expand Down
Loading