Skip to content

benchdnn matmul silently ignores --kernel_name (always runs AOCL-DLP) #36

Description

@lwandrebeck

Summary

The LOWOHA matmul harness never applies --kernel_name. Two defects combine so
every value runs AOCL-DLP:

  1. VALID_KERNEL_NAMES (benchdnn_utils.hpp) omits native_gemm,
    native_brgemm and the auto_tuner spelling of auto — all real
    matmul_algo_t values. An unlisted name is not an error: matmul_utils.cpp
    silently substitutes aocl_dlp / aocl_dlp_blocked.
  2. set_lowoha_matmul_params() populates params.dtypes but never
    params.lowoha_algo, which is the field kernel_select() reads. It stays
    matmul_algo_t::none, and kernel_select() turns that into
    aocl_dlp_blocked.

On a --no-aocldlp build every --kernel_name therefore dies after ~2 ms with
"Selected kernel aocl_dlp_blocked requires AOCL-DLP", making matmul
unbenchmarkable on any host that cannot use AOCL-DLP. On a build that does have
AOCL-DLP the failure is quieter and arguably worse: the reported numbers are
AOCL-DLP's regardless of which algorithm was requested.

The library itself is fine — the ops-API path already honours the name via
set_forced_kernel().

Separate observation

The matmul driver performs no output comparison at all, so it cannot detect a
wrong result — only an execution failure. A kernel that computes garbage quickly
passes benchdnn. That made it unusable for validating the kernel work behind these
reports; the gtests were needed instead.

Suggested fix

Add the missing names and assign params.lowoha_algo from the requested name.
Unknown and "none" should map to matmul_algo_t::none so the library's own
selection still applies, which keeps ZENDNNL_MATMUL_ALGO round-tripping.

Reference branch: https://github.com/lwandrebeck/BullDNN/tree/upstream/benchdnn-kernel-name-ignored

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions