From 59cb658e9004382bcc28b9d1c23c948496f7d252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sun, 7 Apr 2024 10:01:53 +0200 Subject: [PATCH] [docs] Explain how to use the IPU Model --- docs/src/poplar.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/src/poplar.md b/docs/src/poplar.md index 1d26744..44ddb3f 100644 --- a/docs/src/poplar.md +++ b/docs/src/poplar.md @@ -52,3 +52,19 @@ You can slice a tensor with the usual Julia notation `tensor[index1:index2]`, th ```@autodocs Modules = [IPUToolkit.Poplar] ``` + +## Using `IPUToolkit.jl` without an IPU + +While this package requires a physical IPU to use all the available features, you can still experiment with the IPU programming model even if you do not have access to a hardwre IPU. +The Poplar SDK provides a feature called IPU Model, which is a software emulation of the behaviour of the IPU hardware. +The IPU model comes with [some limitations](https://docs.graphcore.ai/projects/poplar-user-guide/en/latest/poplar_programs.html#programming-with-poplar), but it can be useful for testing or debugging. + +To use the IPU model in `IPUToolkit.jl`, define the device of your IPU program with `Poplar.IPUModelCreateDevice` (which calls [`IPUModel::createDevice`](https://docs.graphcore.ai/projects/poplar-api/en/3.4.0/poplar/profiling/IPUModel.html#_CPPv4NK6poplar8IPUModel12createDeviceE11OptionFlagsbj) under the hood): +```julia +model = Poplar.IPUModel() +device = Poplar.IPUModelCreateDevice(model) +# Then the rest of the program continues as usual +target = Poplar.DeviceGetTarget(device) +graph = Poplar.Graph(target) +# ... +```