Skip to content

Commit 632d1ec

Browse files
author
Tyler Titsworth
authored
Add Workflow Docs (#142)
1 parent 74b49f9 commit 632d1ec

23 files changed

+83
-375
lines changed

.github/dockerhub-readmes.json

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
{
4040
"fname": "./preset/README.md",
4141
"repo-name": "intel/inference-optimization"
42+
},
43+
{
44+
"fname": "./workflows/README.md",
45+
"repo-name": "intel/ai-workflows"
4246
}
4347
]
4448
}

README.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8270/badge)](https://www.bestpractices.dev/projects/8270)
44
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/intel/ai-containers/badge)](https://securityscorecards.dev/viewer/?uri=github.com/intel/ai-containers)
5-
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fintel%2Fai-containers.svg?type=shield&issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2Fintel%2Fai-containers?ref=badge_shield&issueType=license)
6-
[![CodeQL](https://github.com/intel/ai-containers/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/intel/ai-containers/actions/workflows/github-code-scanning/codeql)
75
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/intel/ai-containers/main.svg)](https://results.pre-commit.ci/latest/github/intel/ai-containers/main)
6+
[![CodeQL](https://github.com/intel/ai-containers/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/intel/ai-containers/actions/workflows/github-code-scanning/codeql)
7+
[![Lint](https://github.com/intel/ai-containers/actions/workflows/lint.yaml/badge.svg)](https://github.com/intel/ai-containers/actions/workflows/lint.yaml)
88
[![Test Runner CI](https://github.com/intel/ai-containers/actions/workflows/test-runner-ci.yaml/badge.svg)](https://github.com/intel/ai-containers/actions/workflows/test-runner-ci.yaml)
99
[![Helm Chart CI](https://github.com/intel/ai-containers/actions/workflows/chart-ci.yaml/badge.svg)](https://github.com/intel/ai-containers/actions/workflows/chart-ci.yaml)
1010
[![Weekly Tests](https://github.com/intel/ai-containers/actions/workflows/weekly-test.yaml/badge.svg)](https://github.com/intel/ai-containers/actions/workflows/weekly-test.yaml)
@@ -17,14 +17,18 @@ Define your project's registry and repository each time you use the project:
1717

1818
```bash
1919
# REGISTRY/REPO:TAG
20-
export CACHE_REGISTRY=<cache_registry_name>
2120
export REGISTRY=<registry_name>
2221
export REPO=<repo_name>
2322
```
2423

24+
The maintainers of Intel® AI Containers use [harbor](https://github.com/goharbor/harbor) to store containers.
25+
2526
> [!NOTE]
2627
> `REGISTRY` and `REPO` are used to authenticate with the private registry necessary to push completed container layers and saved them for testing and publication. For example: `REGISTRY=intel && REPO=intel-extension-for-pytorch` would become `intel/intel-extension-for-pytorch` as the name of the container image, followed by the tag generated from the service found in that project's compose file.
2728
29+
> [!WARNING]
30+
> You can optionally skip this step and use some placeholder values, however some container groups depend on other images and will pull from a registry that you have not defined and result in an error.
31+
2832
### Set Up Docker Engine
2933

3034
You'll need to install Docker Engine on your development system. Note that while **Docker Engine** is free to use, **Docker Desktop** may require you to purchase a license. See the [Docker Engine Server installation instructions](https://docs.docker.com/engine/install/#server) for details.
@@ -61,6 +65,9 @@ cd pytorch
6165
PACKAGE_OPTION=idp docker compose up --build ipex-base
6266
```
6367

68+
> [!NOTE]
69+
> If you didn't specify `REGISTRY` or `REPO`, you also need to add the `idp` service to the list to build the dependent python image.
70+
6471
## Test Containers
6572

6673
To test the containers, use the [Test Runner Framework](https://github.com/intel/ai-containers/tree/main/test-runner):

docs/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ mkdocs serve --no-livereload
2424

2525
The documentation will be available at [http://localhost:8000](http://localhost:8000).
2626

27+
> [!CAUTION]
28+
> Docker compose `v2.26.1` is the minimum required version.
29+
2730
## Labelling Containers
2831

2932
To customize the tables in the [Support Matrix](./matrix.md), you can add labels to the services found in each container group's `docker-compose.yaml` file. The command `docker compose config` is run to get all of the metadata from the container group. Labels are used to specify the public metadata for each container, and then the tables are generated based on the `.actions.json` file found in the same directory.

docs/matrix.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Support Matrix
22

33
=== "Framework Containers"
4-
=== "Python"
4+
=== "[Python](https://hub.docker.com/r/intel/python)"
55
{{ read_csv('assets/python.csv') }}
6-
=== "Classical ML"
6+
=== "[Classical ML](https://hub.docker.com/r/intel/intel-optimized-ml)"
77
{{ read_csv('assets/classical-ml.csv') }}
8-
=== "PyTorch"
8+
=== "[PyTorch](https://hub.docker.com/r/intel/intel-optimized-pytorch)"
99
{{ read_csv('assets/pytorch.csv') }}
10-
=== "TensorFlow"
10+
=== "[TensorFlow](https://hub.docker.com/r/intel/intel-optimized-tensorflow)"
1111
{{ read_csv('assets/tensorflow.csv') }}
1212

1313
=== "Model Containers"
@@ -22,7 +22,7 @@
2222
=== "Max"
2323
{{ read_csv('assets/max-pvc.csv') }}
2424

25-
=== "Preset Containers"
25+
=== "[Preset Containers](https://github.com/intel/ai-containers/blob/main/preset/README.md)"
2626
=== "Data Analytics"
2727
{{ read_csv('assets/data_analytics.csv') }}
2828
=== "Classical ML"
@@ -32,10 +32,8 @@
3232
=== "Inference Optimization"
3333
{{ read_csv('assets/inference_optimization.csv') }}
3434

35-
=== "Other"
36-
=== "Serving"
35+
=== "[Workflows](https://hub.docker.com/r/intel/ai-workflows)"
36+
=== "[TorchServe](https://github.com/intel/ai-containers/tree/main/workflows/charts/torchserve)"
3737
{{ read_csv('assets/serving.csv') }}
38-
=== "Transformers"
39-
{{ read_csv('assets/transformers.csv') }}
40-
=== "GenAI"
38+
=== "[Huggingface LLM](https://github.com/intel/ai-containers/tree/main/workflows/charts/huggingface-llm)"
4139
{{ read_csv('assets/genai.csv') }}

docs/scripts/hook.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ def create_support_matrix():
4040
# compose_to_csv("preset/classical-ml", "classical_ml")
4141
# compose_to_csv("preset/deep-learning", "deep_learning")
4242
# compose_to_csv("preset/inference-optimization", "inference_optimization")
43-
# get_repo(transformers)
44-
# get_repo(genai)
43+
compose_to_csv("workflows/charts/huggingface-llm", "genai")
4544

4645

4746
def on_pre_build(*args, **kwargs):

docs/scripts/matrix.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ def make_table(setting: str = None, compose_metadata: dict = None):
174174
metadata = extract_labels(setting)
175175
df = pd.concat([df, make_table(setting, metadata)], axis=1)
176176
else:
177-
df = make_table()
177+
metadata = docker.compose.config(return_json=True)
178+
df = make_table("Name=Version", metadata)
178179

179180
os.chdir(root)
180181
df.loc[:, ~df.columns.duplicated()].to_csv(f"docs/assets/{path}.csv", index=False)

docs/scripts/readmes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"preset/README.md",
2121
"python/README.md",
2222
"pytorch/README.md",
23-
"pytorch/serving/README.md",
2423
"tensorflow/README.md",
24+
"workflows/README.md",
2525
]
2626

2727

mkdocs.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
copyright: Copyright &copy; 2024 Intel Corporation
16-
edit_uri: edit/main/docs/
1716
extra:
1817
generator: false
1918
extra_javascript:
@@ -37,15 +36,11 @@ nav:
3736
- Python Base: 'python/README.md'
3837
- PyTorch Base: 'pytorch/README.md'
3938
- TensorFlow Base: 'tensorflow/README.md'
40-
- TorchServe: 'pytorch/serving/README.md'
39+
- Workflows: 'workflows/README.md'
4140
- Support Matrix: 'matrix.md'
4241
- Roadmap: 'roadmap.md'
4342
plugins:
4443
- callouts
45-
- git-authors
46-
- git-revision-date-localized:
47-
enable_creation_date: true
48-
type: date
4944
# - optimize
5045
- search
5146
- table-reader:
@@ -73,5 +68,4 @@ theme:
7368
- navigation.prune
7469
- toc.follow
7570
- toc.integrate
76-
- content.action.edit
7771
name: material

test-runner/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,16 @@ See an [Example](../.github/workflows/test-runner-ci.yaml#L94) Implementation of
277277

278278
> [!TIP]
279279
> When writing Tests for use with a CI platform like GitHub Actions, write your tests in such a way that they would be executed from the root directory of your repository.
280+
281+
## Testing
282+
283+
For testing [tests.yaml](tests.yaml) file, some variables need to be set
284+
285+
```bash
286+
export CACHE_REGISTRY=<harbor cache_registry_name>
287+
export REGISTRY=<harbor registry>
288+
export REPO=<harbor project/repo>
289+
# optional
290+
export PERF_REPO=<internal perf repo>
291+
python test-runner/test_runner.py -f test-runner/tests.yaml -a test-runner/.actions.json
292+
```

workflows/README.md

+30-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,36 @@
1-
# Workflows
1+
# Intel® AI Workflows
22

3-
This directory contains workflows demonstrating showing how the Intel Optimized base containers can be used for
4-
different use cases:
3+
Demonstrating showing how the [Intel® AI Containers] can be used for different use cases:
54

65
## PyTorch Workflows
76

87
| Base Container | Device Type | Example | Description |
98
|----------------|-------------|---------|-------------|
10-
| `intel/intel-optimized-pytorch:2.3.0-pip-multinode` | CPU | [Distributed LLM Fine Tuning with Kubernetes](charts/huggingface-llm) | Demonstrates using Hugging Face Transformers with Intel® Xeon® Scalable Processors to fine tune LLMs with multiple nodes from a Kubernetes cluster. The example includes a LLM fine tuning script, Dockerfile, and Helm chart. |
9+
| `intel/intel-optimized-pytorch:2.3.0-pip-multinode` | CPU | [Distributed LLM Fine Tuning with Kubernetes] | Demonstrates using Hugging Face Transformers with Intel® Xeon® Scalable Processors to fine tune LLMs with multiple nodes from a Kubernetes cluster. The example includes a LLM fine tuning script, Dockerfile, and Helm chart. |
10+
| `intel/intel-optimized-pytorch:2.3.0-serving-cpu` | CPU | [TorchServe* with Kubernetes] | Demonstrates using TorchServe* with Intel® Xeon® Scalable Processors to serve models on multinodes nodes from a Kubernetes cluster. The example includes a Helm chart. |
11+
12+
## Build from Source
13+
14+
To build the images from source, clone the [Intel® AI Containers] repository, follow the main `README.md` file to setup your environment, and run the following command:
15+
16+
```bash
17+
cd workflows/charts/huggingface-llm
18+
docker compose build huggingface-llm
19+
docker compose run huggingface-llm sh -c "python /workspace/scripts/finetune.py --help"
20+
```
21+
22+
## License
23+
24+
View the [License](https://github.com/intel/ai-containers/blob/main/LICENSE) for the [Intel® AI Containers].
25+
26+
The images below also contain other software which may be under other licenses (such as Pytorch*, Jupyter*, Bash, etc. from the base).
27+
28+
It is the image user's responsibility to ensure that any use of The images below comply with any relevant licenses for all software contained within.
29+
30+
\* Other names and brands may be claimed as the property of others.
31+
32+
<!--Below are links used in these document. They are not rendered: -->
33+
34+
[Intel® AI Containers]: https://github.com/intel/ai-containers
35+
[Distributed LLM Fine Tuning with Kubernetes]: https://github.com/intel/ai-containers/tree/main/workflows/charts/huggingface-llm
36+
[TorchServe* with Kubernetes]: https://github.com/intel/ai-containers/tree/main/workflows/charts/torchserve

workflows/charts/huggingface-llm/docker-compose.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ services:
2323
BASE_IMAGE_TAG: ${BASE_IMAGE_TAG:-2.3.0-pip-multinode}
2424
context: .
2525
labels:
26+
dependency.apt.google-perftools: true
27+
dependency.apt.libjemalloc: true
28+
dependency.apt.libomp-dev: true
29+
dependency.apt.numactl: true
30+
dependency.python: ${PYTHON_VERSION:-3.10}
2631
dependency.python.pip: requirements.txt
27-
docs: pytorch
32+
docs: genai
2833
org.opencontainers.base.name: "intel/intel-optimized-pytorch:${IPEX_VERSION:-2.3.0}-pip-multinode"
2934
org.opencontainers.image.name: "intel/ai-workflows"
3035
org.opencontainers.image.title: "Intel® Extension for PyTorch with Hugging Face LLM fine tuning"

workflows/charts/test/.helmignore

-23
This file was deleted.

workflows/charts/test/Chart.yaml

-42
This file was deleted.

workflows/charts/test/README.md

-30
This file was deleted.

workflows/charts/test/templates/NOTES.txt

-16
This file was deleted.

0 commit comments

Comments
 (0)