Skip to content
Draft
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,29 @@ enumerateMatmulTileRiscv64(TypeRange elementTypes, DictionaryAttr config) {
};
}
}
// This adds support for our s8*sx`8->s32 kernel.
if (lhs.isSignlessInteger(8) && rhs.isSignlessInteger(8) &&
out.isSignlessInteger(32)) {
// This logic follows the f32 case, as both use 32-bit accumulators.
// For your +zvl512b target, vlen = 512.
// N0 = (512 bits / 32 bits_per_element) * 4_LMUL = 64 elements.

// N0 for LMUL=8 path (M0=16)
int N0_lmul8 = vlen / 4;
// N0 for LMUL=4 path (M0=8, 4, 2, 1)
int N0_lmul4 = vlen / 8;

return {
// --- LMUL=8 Path ---
TileMxNxK{16, N0_lmul8, 1}, // Target tile for s8s8s32 (LMUL=8)

// --- LMUL=4 Paths ---
TileMxNxK{8, N0_lmul4, 1}, // Truncation (LMUL=4)
TileMxNxK{4, N0_lmul4, 1}, // Truncation (LMUL=4)
TileMxNxK{2, N0_lmul4, 1}, // Truncation (LMUL=4)
TileMxNxK{1, N0_lmul4, 1}, // Truncation (vecmat) (LMUL=4)
};
}
// Fallback - no architecture-optimized tile size for this case.
return {};
}
Expand Down
31 changes: 31 additions & 0 deletions experimental/iree_evo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2024 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""IREE Evolutionary Optimization Package.

This package provides an autonomous optimization system for the IREE compiler
using Evolutionary Strategies via the `openevolve` library.

The system optimizes compilation flags and Transform Dialect scripts,
specifically for Integer-Only Requantization (fusing float dequant/requant
operations into integer math).
"""

from .knowledge_base import KnowledgeBase
from .slicer import MLIRSlicer
from .verification import LitGen
from .evaluator import IREEEvaluator, CompilationError, OpenEvolveCompatibleEvaluator
from .prompts import PLANNER_PROMPT, CODER_PROMPT

__all__ = [
"KnowledgeBase",
"MLIRSlicer",
"LitGen",
"IREEEvaluator",
"OpenEvolveCompatibleEvaluator",
"CompilationError",
"PLANNER_PROMPT",
"CODER_PROMPT",
]
Loading