task: refactor ASV benchmarks#2996
Conversation
|
View rendered docs @ https://intelpython.github.io/dpnp/pull/2996/index.html |
| # -*- coding: utf-8 -*- | ||
| # ***************************************************************************** | ||
| # Copyright (c) 2026, Intel Corporation | ||
| # Copyright (c) 2020, Intel Corporation |
There was a problem hiding this comment.
Should be an year, when file is created (here and in other places):
| # Copyright (c) 2020, Intel Corporation | |
| # Copyright (c) 2026, Intel Corporation |
| # numpy.longfloat is an alias of numpy.longdouble that was removed in | ||
| # NumPy 2.0; use numpy.longdouble, which exists on both 1.x and 2.x. | ||
| "longdouble", | ||
| "complex128", |
There was a problem hiding this comment.
dpnp does not support these data types:
| # numpy.longfloat is an alias of numpy.longdouble that was removed in | |
| # NumPy 2.0; use numpy.longdouble, which exists on both 1.x and 2.x. | |
| "longdouble", | |
| "complex128", |
|
|
||
|
|
||
| def initialize(nopt, seed, types_dict): | ||
| import numpy as np |
There was a problem hiding this comment.
The same name used to import dpnp, it'd be better to avoid that (here and in other places):
| import numpy as np | |
| import numpy |
| # --- dpBench benchmark metadata (see black_scholes.toml) -------------------- | ||
|
|
||
| NAME = "black_scholes" | ||
| PRECISION = "double" |
There was a problem hiding this comment.
Some iGPU might not support double precision. Do we need to support fallback run with float precision? Or that does not make a lot of sense?
| } | ||
| # Presets actually exercised by ASV. Larger presets require several GiB of | ||
| # device memory; add them here to benchmark bigger problem sizes. | ||
| ASV_PRESETS = ["S"] |
There was a problem hiding this comment.
I wonder if the result will be unstable when running with small preset.
What is about M16Gb preset or more smart logic to select the preset depending on available memory?
Or that is not needed and ASV runs demonstrate stable results with even S preset?
| [project.optional-dependencies] | ||
| benchmark = [ | ||
| "asv>=0.6", | ||
| "scipy" |
There was a problem hiding this comment.
Why do we need to install scipy?
| # Arguments that are arrays and therefore copied to the device. | ||
| ARRAY_ARGS = ["price", "strike", "t", "call", "put"] | ||
| # Arguments that the kernel writes into. | ||
| OUTPUT_ARGS = ["call", "put"] |
There was a problem hiding this comment.
Is that expected that OUTPUT_ARGS is never used? Do we need to have a validation step which consumes that?
|
|
||
| dpBench (https://github.com/IntelPython/dpbench) drives its benchmarks through | ||
| a fairly heavy runner that spawns a sub-process per framework, resolves TOML | ||
| configuration, validates results against a reference and persists timings to a |
There was a problem hiding this comment.
Seems there is no validation against the reference is implemented / migrated. Or is that intentional?
| Unlike a pure-Python project, dpnp is a SYCL/DPC++ extension that requires the | ||
| Intel oneAPI compiler and a lengthy build, so ASV does not build dpnp itself: | ||
| `build_command` in `asv.conf.json` is empty and the benchmarks are run against | ||
| an **existing environment** that already has dpnp installed. |
There was a problem hiding this comment.
Isn't the below pip install ".[benchmark]" command will trigger full dpnp rebuild?
|
Array API standard conformance tests for dpnp=0.21.0dev2=py313h509198e_23 ran successfully. |
Fixes and refactors ASV benchmarking to mirror dpbench implementations.