Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Perf Sample Example Section #307

Merged
merged 6 commits into from
Aug 29, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

[Intel® Distribution for Python] enhances performance and can improve your program speed from 10 to 100 times faster. It is a Python distribution that includes the [Intel® Math Kernel Library] (oneMKL) and other Intel performance libraries to enable near-native performance through acceleration of core numerical and machine learning packages.

[Intel® Distribution for Python] is available as part of the [Intel® oneAPI Base Toolkit](https://software.intel.com/content/www/us/en/develop/tools/oneapi/base-toolkit.html).

## Images

The images below include variations for only the core packages in the [Intel® Distribution for Python] installation, or all of the packages.
Expand All @@ -13,9 +11,35 @@ The images below include variations for only the core packages in the [Intel® D
| `3.10-full`, `latest` | `2024.2.0` |
| `3.10-core` | `2024.2.0` |

## Build from Source
## Run a Performance Sample

To run a performance sample run the following commands:

```bash
git clone https://github.com/intel/ai-containers
cd ai-containers/python
docker run --rm -it \
-v $PWD/tests:/tests \
intel/python:latest \
python /tests/perf_sample.py
```

### Compare the results against stock python

To build the images from source, clone the [Intel® AI Containers](https://github.com/intel/ai-containers) repository, follow the main `README.md` file to setup your environment, and run the following command:
In the previous command, you should see a result at the bottom like: `Time Consuming: 0.03897857666015625`. We can compare this against `python:3.11-slim-bullseye`

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a note regarding that

```bash
docker run --rm -it \
-v $PWD/tests:/tests \
python:3.11-slim-bullseye \
bash
pip install numpy
python /tests/perf_sample.py
```

## Build from Source (Advanced)

To build the images from source, clone the [Intel® AI Containers](https://github.com/intel/ai-containers) repository, follow the main `README.md` file to setup your environment, and run the following commands:

```bash
cd python
Expand All @@ -30,6 +54,7 @@ You can find the list of services below for each container in the group:
| `idp` | Base image with [Intel® Distribution for Python] |
| `pip` | Equivalent python image without [Intel® Distribution for Python] |


## License

View the [License](https://github.com/intel/ai-containers/blob/main/LICENSE) for the [Intel® Distribution for Python].
Expand Down