Skip to content

task: refactor ASV benchmarks#2996

Draft
jharlow-intel wants to merge 1 commit into
masterfrom
task/SAT-8518
Draft

task: refactor ASV benchmarks#2996
jharlow-intel wants to merge 1 commit into
masterfrom
task/SAT-8518

Conversation

@jharlow-intel

Copy link
Copy Markdown
Collaborator

Fixes and refactors ASV benchmarking to mirror dpbench implementations.

@jharlow-intel jharlow-intel self-assigned this Jul 9, 2026
@jharlow-intel jharlow-intel added the enhancement New feature or request label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/pull/2996/index.html

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 78.111%. remained the same — task/SAT-8518 into master

@antonwolfy antonwolfy added this to the 0.21.0 release milestone Jul 10, 2026
# -*- coding: utf-8 -*-
# *****************************************************************************
# Copyright (c) 2026, Intel Corporation
# Copyright (c) 2020, Intel Corporation

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.

Should be an year, when file is created (here and in other places):

Suggested change
# Copyright (c) 2020, Intel Corporation
# Copyright (c) 2026, Intel Corporation

Comment on lines +55 to 58
# 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",

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.

dpnp does not support these data types:

Suggested change
# 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

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 same name used to import dpnp, it'd be better to avoid that (here and in other places):

Suggested change
import numpy as np
import numpy

# --- dpBench benchmark metadata (see black_scholes.toml) --------------------

NAME = "black_scholes"
PRECISION = "double"

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.

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"]

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.

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?

Comment thread pyproject.toml
[project.optional-dependencies]
benchmark = [
"asv>=0.6",
"scipy"

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.

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"]

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.

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

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.

Seems there is no validation against the reference is implemented / migrated. Or is that intentional?

Comment thread benchmarks/README.md
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.

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.

Isn't the below pip install ".[benchmark]" command will trigger full dpnp rebuild?

@github-actions

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.21.0dev2=py313h509198e_23 ran successfully.
Passed: 1372
Failed: 3
Skipped: 5

@jharlow-intel jharlow-intel marked this pull request as draft July 10, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants