Run
The image classification demo is based on PyTorch's Torchvision library. This application demos two different memory configurations for the CXL Host interacting with the CXL based AI/ML accelerator devices.
- CXL Type 1: The accelerator reads the data directly from CXL Host's system memory via CXL.cache protocol.
- CXL Type 2: The accelerator reads the data from its own memory that has been mapped by the CXL Host. This mapped memory (HDM) gets updated via CXL.mem protocol.
Download Image Dataset
note
The dataset is from fast.ai's GitHub repo which is licensed under Apache 2.0.
Download the image.
wget https://eeum.s3.us-west-1.amazonaws.com/public/imagenette/imagenette2-160.tgz
Extract to a desired path. You will need this path later to run the demo.
Run
note
This is a full-featured PyTorch ML demo could take minutes to execute (depending on the configuration). The dataset is composed of 10,000 images. Using a CUDA-based ML accelerator could speed things up quite a bit.
Go to the opencxl-core/demos/image-classification
directory and run:
poetry run python run-demo.py -p <dataset folder> -t <accelerator type> [-n <number of acelerators>]
CXL Type 1
poetry run python run-demo.py -p <path to the image data folder> -t 1
CXL Type 2
poetry run python run-demo.py -p <path to the image data folder> -t 2