Interchange
Interchange action for MLIR loop transformations.
This module implements the loop interchange transformation action, which reorders loop dimensions using different encoding methods (enumerate, pointers, continuous).
InterchangeMethod
Interchange(parameters, state=None, /, *, process_params=True, **extras)
Bases: Action
Class representing Interchange action
Source code in mlir_rl_artifact/actions/interchange.py
log_std
class-attribute
instance-attribute
Log standard deviation for continuous interchange encoding.
__decode_continuous(parameter, num_loops)
staticmethod
Decode the interchange parameter to get the loop permutation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameter
|
int
|
The interchange parameter. |
required |
num_loops
|
int
|
The number of loops in the operation. |
required |
Returns:
| Type | Description |
|---|---|
list[int]
|
The loop permutation. |
Source code in mlir_rl_artifact/actions/interchange.py
__get_candidates(num_loops)
staticmethod
Get all 1c 2c 3c possible interchanges for num_loops
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_loops
|
int
|
The number of loops in the operation. |
required |
Returns:
| Type | Description |
|---|---|
list[list[int]]
|
The list of all possible interchanges. |