Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed Sep 16, 2024
1 parent 357faaf commit ffc6262
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/user-guide/gpu-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ You can install the GPU backend for Polars with a feature flag as part of a norm
Having built a query using the lazy API [as normal](lazy/index.md), GPU-enabled execution is requested by running `.collect(engine="gpu")` instead of `.collect()`.

{{ code_header("python", [], []) }}

```python
--8<-- "python/user-guide/lazy/gpu.py:setup"

Expand All @@ -46,6 +47,7 @@ print(result)
For more detailed control over the execution, for example to specify which GPU to use on a multi-GPU node, we can provide a `GPUEngine` object. By default, the GPU engine will use a configuration applicable to most use cases.

{{ code_header("python", [], []) }}

```python
--8<-- "python/user-guide/lazy/gpu.py:engine-setup"
result = q.collect(engine=pl.GPUEngine(device=1))
Expand Down Expand Up @@ -99,6 +101,7 @@ The release of the GPU engine in Open Beta implies that we expect things to work
When running in verbose mode, any queries that cannot execute on the GPU will issue a `PerformanceWarning`:

{{ code_header("python", [], []) }}

```python
--8<-- "python/user-guide/lazy/gpu.py:fallback-setup"

Expand All @@ -123,6 +126,7 @@ print(q.collect())
To disable fallback, and have the GPU engine raise an exception if a query is unsupported, we can pass an appropriately configured `GPUEngine` object:

{{ code_header("python", [], []) }}

```python
q.collect(engine=pl.GPUEngine(raise_on_fail=True))
```
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/lazy/gpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Polars provides an in-memory, GPU-accelerated execution engine for the Lazy API
If you install Polars with the [GPU feature flag](../installation.md), you can trigger GPU-based execution by running `.collect(engine="gpu")` instead of `.collect()`.

{{ code_header("python", [], []) }}

```python
--8<-- "python/user-guide/lazy/gpu.py:setup"

Expand Down

0 comments on commit ffc6262

Please sign in to comment.