For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
bench_multicontext
def bench_multicontext[bench_fn: def(mut Bencher, DeviceContext, Int) raises capturing thin -> None](mut self_: Bench, list_of_ctx: List[DeviceContext], bench_id: BenchId, measures: List[ThroughputMeasure] = List())
Benchmarks or Tests an input function across multiple device contexts.
The metric returned represents the slowest performing device.
Parameters:
- βbench_fn (
def(mut Bencher, DeviceContext, Int) raises capturing thin -> None): The function to be benchmarked.
Args:
- βself_ (
Bench): The benchmark configuration. - βlist_of_ctx (
List[DeviceContext]): A list of device contexts on which the bench_fn is run in parallel. - βbench_id (
BenchId): The benchmark Id object used for identification. - βmeasures (
List[ThroughputMeasure]): Optional arg used to represent a list of ThroughputMeasure's.
Raises:
If the operation fails.
def bench_multicontext[FuncType: def(mut Bencher, DeviceContext, Int) -> None](mut self_: Bench, func: FuncType, list_of_ctx: List[DeviceContext], bench_id: BenchId, measures: List[ThroughputMeasure] = List())
Benchmarks or Tests an input function across multiple device contexts.
The metric returned represents the slowest performing device.
Parameters:
- βFuncType (
def(mut Bencher, DeviceContext, Int) -> None): The body function type.
Args:
- βself_ (
Bench): The benchmark configuration. - βfunc (
FuncType): The closure carrying the captured state of the body function. - βlist_of_ctx (
List[DeviceContext]): A list of device contexts on which the bench_fn is run in parallel. - βbench_id (
BenchId): The benchmark Id object used for identification. - βmeasures (
List[ThroughputMeasure]): Optional arg used to represent a list of ThroughputMeasure's.
Raises:
If the operation fails.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!