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 scripts/nvbench_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def version_tuple(v):

def find_matching_bench(needle, haystack):
for hay in haystack:
if hay["name"] == needle["name"] and hay["axes"] == needle["axes"]:
if hay["name"] == needle["name"]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we check that intersection of hay["axes"] and need["axes"] is not empty?

Copy link
Collaborator

@oleksandr-pavlyk oleksandr-pavlyk Jan 6, 2026

Choose a reason for hiding this comment

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

I had something as follows in mind:

def axes_do_intersect(hay, needle):
    if (len(hay) != len(needle)):
        return False
    for ha, na in zip(hay, needle):
        if any(ha[k] != na[k] for k in ["name", "type", "flags"]):
            return False
        hv, nv = ha["values"], na["values"]
        if not any(v in hv for v in nv):
            return False
    return True


def find_matching_bench(needle, haystack):
    for hay in haystack:
        if hay["name"] == needle["name"] and axes_do_intersect(hay["axes"], needle["axes"]):
            return hay
    return None

Copy link
Collaborator

Choose a reason for hiding this comment

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

@bernhardmgruber Ping, do you object to this change? I think it is necessary to check that the sets of axes values for hay and needle do intersect, otherwise the script output is not going to be meaningful.

return hay
return None

Expand Down