Skip to content
Open
Changes from all 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
2 changes: 1 addition & 1 deletion docs/source/user_guide/algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ These algorithms run on all of Quadrants' GPU backends (CUDA, AMDGPU, Vulkan, Me

## Composable `@qd.func` ops

Every algorithm is a composable `@qd.func` (e.g. `reduce_add`, `sort`): call it at the **top level** of your own `@qd.kernel`, so the op is captured into the same kernel / graph as your surrounding phases. The function is annotated with `requires_top_level=True`, so attempting to use it outside of top level will throw an exception at compile time. Note that within a `qd.loop_do_while` counts as being at top-level [FIXME: add qd.checkpoint here too, once/when we merge qd.checkpoint].
Every algorithm is a composable `@qd.func` (e.g. `reduce_add`, `sort`): call it at the **top level** of your own `@qd.kernel`, so the op is captured into the same kernel / graph as your surrounding phases. The function is annotated with `requires_top_level=True`, so attempting to use it outside of top level will throw an exception at compile time. Note that within a `qd.loop_do_while` or `qd.checkpoint` counts as being at top-level.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not say algorithms can be called directly in checkpoints

This new wording tells users that a qd.checkpoint body counts as top level for composable algorithms, but the checkpoint transformer rejects any non-docstring bare ast.Expr in a checkpoint body before the call is lowered (checkpoint_transformer.py lines 247-263). Since calls such as qd.algorithms.reduce_add(...) or qd.algorithms.sort(...) are bare expression statements in the documented usage pattern, placing them directly under with qd.checkpoint(...): raises QuadrantsSyntaxError, and wrapping them in a normal for then violates requires_top_level=True. Please qualify this or document the supported wrapping pattern, otherwise the docs advertise an API shape that currently fails at compile time.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The bot comment looks legit.


## Key sizing parameters

Expand Down
Loading