iree-org / iree-test-suites

Test suites for IREE and related projects
Apache License 2.0
1 stars 3 forks source link

Import matmul/conv/attention tests from iree/tests/e2e/ #2

Open ScottTodd opened 1 month ago

ScottTodd commented 1 month ago

Could start with what already exists, including the C++ binaries files and CMake build system:

Or... run the generator scripts and jump straight to a prototype replacement test runner (pytest? other cmake functions?)

The test generators seem to be using mostly upstream dialects (e.g. linalg.conv_2d_nchw_fchw). The build system usage does some fancy things with flags though... should watch out for layering in there. For example:

  COMPILER_FLAGS
    "--iree-opt-data-tiling=false"
    "--iree-llvmcpu-enable-scalable-vectorization"
    "--iree-llvmcpu-target-triple=aarch64-unknown-unknown"
    "--iree-preprocessing-pass-pipeline=builtin.module\(util.func\(iree-preprocessing-transpose-matmul-pass{input=lhs}\)\)"
  LABELS
    "requires-arm-sme"
  TARGET_CPU_FEATURES_VARIANTS
    "arm_64:sme:+sve,+sme"

See this related thread on Discord: https://discord.com/channels/689900678990135345/1270451599231156266

ScottTodd commented 1 month ago

Can also draw on code from https://github.com/nod-ai/rocm-gemm-benchmark/. That has test case generators and checked in .mlir files.

ScottTodd commented 3 weeks ago

Current plan (cc @erman-gurses ):

  1. Land https://github.com/iree-org/iree/pull/17751 for interim coverage of attention on CPU (and possibly ROCm)
  2. Fork C++ and CMake matmul test code to this repo (including all transitive deps, a new CMake project that depends on the runtime, etc.)
  3. Fork C++ and CMake conv and attention test code to this repo
  4. Prototype a new test structure (check in generated files, rework CMake/ctest project or use pytest, etc.)
ScottTodd commented 3 weeks ago

Finding lots to clean up while refactoring the matmul tests. Debating starting fresh or cleaning up in-place.

Notes/ideas: