gpus#
- gpus(arg: int, *, when: str | dict[str, str] | None = None) None#
This test requires this many GPUs
Usage#
.pyt:import canary canary.directives.gpus(arg, when=...)
.vvt:NAParameters#
arg: The number of GPUs required by this test.
The
whenexpression is limited to the following conditions:testname: Restrict processing of the directive to this test nameplatform: Restrict processing of the directive to certain platform or platformsoption: Restrict processing of the directive to command line-ooptions
Notes#
Use
gpus(int)to set a single, fixed resource requirement for a job without creating additional test instantiations.Test naming reflects only parameters introduced via parameterize(). Therefore, when GPUs are set via
gpus(arg),gpus=<arg>are not appended to the generated test name. If you want distinct named variants such as...gpus=8, useparameterize("gpus", ...)instead.