Skip to content

Commit

Permalink
branch on driver datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Aug 23, 2024
1 parent 10dab9e commit 41fb0cd
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 28 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ jobs:

test_linux:
name: E2E Test linux
runs-on: nod-nuc-linux-2
needs: build_and_ctest
strategy:
fail-fast: true
fail-fast: false
matrix:
- runs-on: [linux-phoenix-1.3, linux-phoenix-1.4]
runs-on: nod-nuc-linux-2
env:
XILINXD_LICENSE_FILE: /opt/xilinx/Xilinx.lic
steps:
Expand Down
72 changes: 46 additions & 26 deletions build_tools/ci/cpu_comparison/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import time
from pathlib import Path
from textwrap import dedent
from packaging.version import Version

import numpy as np

Expand Down Expand Up @@ -306,6 +307,15 @@ def __init__(
if xrt_hash:
self.xrt_hash = xrt_hash[0]

xdna_datetime = re.findall(
# eg 2.18.0_20240606
r"amdxdna\s+:\s\d\.\d+\.\d+_(\d+)",
xrt_info,
flags=re.MULTILINE | re.IGNORECASE,
)
if xdna_datetime:
self.xdna_datetime = int(xdna_datetime[0])

# Try and get the peano commit hash. This is a bit of a hack, if it fails
# peano_commit_has is left as "undetermined".
self.peano_commit_hash = "undetermined"
Expand Down Expand Up @@ -589,38 +599,45 @@ def run(self, config):
test_files_dir = config.file_dir / "test_files"
output_dir = config.output_dir

for name in [
"two_matmul_switching",
"matmul_f32_8_8_4",
"matmul_f32_8_4_8",
]:
aie_vs_llvm_cpu(config, test_files_dir / f"{name}.mlir")

aie_vs_llvm_cpu(
config,
test_files_dir / "three_matmuls.mlir",
function_name="three_$mm$",
)

# Test(s) of the form matmul(A,B) where A:MxK, B:KxN
test_name = output_dir / "test_from_template.mlir"
template_name = matmul_template_dir / "matmul_MxK_KxN.mlir"
generate_matmul_test(test_name, template_name, 32, 32, 64, "bf16", "f32")
aie_vs_llvm_cpu(config, test_name)

# Test(s) of the form matmul(A,B) + C where A:MxK, B:KxN, C:N
test_name = output_dir / "test_from_template_bias_N.mlir"
template_name = matmul_template_dir / "matmul_bias_MxK_KxN_N.mlir"
generate_matmul_test(test_name, template_name, 1024, 1024, 512, "bf16", "f32")
aie_vs_llvm_cpu(config, test_name, tile_pipeline="pack-peel", use_ukernel=True)
aie_vs_llvm_cpu(config, test_name, tile_pipeline="pack-peel", use_ukernel=False)

# Test(s) of the form matmul(A,B) + C where A:MxK, B:KxN, C:MxN
test_name = output_dir / "test_from_template_full_bias.mlir"
template_name = matmul_template_dir / "matmul_bias_MxK_KxN_MxN.mlir"
generate_matmul_test(test_name, template_name, 128, 128, 256, "i32", "i32")
aie_vs_llvm_cpu(config, test_name, tile_pipeline="pack-peel", rtol=0, atol=0)

if config.xdna_datetime and config.xdna_datetime < 20240819:
for name in [
"two_matmul_switching",
"matmul_f32_8_8_4",
"matmul_f32_8_4_8",
]:
aie_vs_llvm_cpu(config, test_files_dir / f"{name}.mlir")

aie_vs_llvm_cpu(
config,
test_files_dir / "three_matmuls.mlir",
function_name="three_$mm$",
)

# Test(s) of the form matmul(A,B) where A:MxK, B:KxN
test_name = output_dir / "test_from_template.mlir"
template_name = matmul_template_dir / "matmul_MxK_KxN.mlir"
generate_matmul_test(test_name, template_name, 32, 32, 64, "bf16", "f32")
aie_vs_llvm_cpu(config, test_name)

# Test(s) of the form matmul(A,B) + C where A:MxK, B:KxN, C:N
test_name = output_dir / "test_from_template_bias_N.mlir"
template_name = matmul_template_dir / "matmul_bias_MxK_KxN_N.mlir"
generate_matmul_test(
test_name, template_name, 1024, 1024, 512, "bf16", "f32"
)
aie_vs_llvm_cpu(
config, test_name, tile_pipeline="pack-peel", use_ukernel=True
)
aie_vs_llvm_cpu(
config, test_name, tile_pipeline="pack-peel", use_ukernel=False
)


class SmokeSet(TestSet):
def __init__(self):
Expand Down Expand Up @@ -841,6 +858,8 @@ def all_tests(
default="",
)

parser.add_argument("--driver-hash", type=str)

args = parser.parse_args()

test_set_list = args.test_set.split(",")
Expand All @@ -854,6 +873,7 @@ def all_tests(
args.verbose,
args.reset_npu_between_runs,
args.do_not_run_aie,
args.drive_date,
test_set_list,
args.additional_aie_compilation_flags,
)

0 comments on commit 41fb0cd

Please sign in to comment.