tilelang.autoddΒΆ
AttributesΒΆ
ClassesΒΆ
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
FunctionsΒΆ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module ContentsΒΆ
- tilelang.autodd.ast_replace(node, **changes)ΒΆ
- Parameters:
node (ast.AST)
- Return type:
ast.AST
- tilelang.autodd.parse_stmts(s)ΒΆ
- Parameters:
s (str)
- Return type:
list[ast.stmt]
- tilelang.autodd.parse_expr(s)ΒΆ
- Parameters:
s (str)
- Return type:
ast.expr
- class tilelang.autodd.ASTRewriteΒΆ
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- abstract get_name()ΒΆ
- Return type:
str
- abstract match(node, parent, field, inside_list)ΒΆ
- class tilelang.autodd.GeneralRemoveΒΆ
Bases:
ASTRewriteHelper class that provides a standard way to create an ABC using inheritance.
- name: strΒΆ
- target_type: type[ast.AST]ΒΆ
- replace_with: ast.AST | list[ast.AST] | None = NoneΒΆ
- get_name()ΒΆ
- Return type:
str
- match(node, parent, field, inside_list)ΒΆ
- tilelang.autodd.expr_to_zeros(target)ΒΆ
- Parameters:
target (ast.expr)
- Return type:
ast.expr
- class tilelang.autodd.CallFwdArg1ΒΆ
Bases:
ASTRewriteHelper class that provides a standard way to create an ABC using inheritance.
- get_name()ΒΆ
- Return type:
str
- match(node, parent, field, inside_list)ΒΆ
- class tilelang.autodd.AttachFullFuncArgsΒΆ
Bases:
ASTRewriteHelper class that provides a standard way to create an ABC using inheritance.
- get_name()ΒΆ
- Return type:
str
- match(node, parent, field, inside_list)ΒΆ
- class tilelang.autodd.IntConstApplyΒΆ
Bases:
ASTRewriteHelper class that provides a standard way to create an ABC using inheritance.
- apply: Callable[[int], ast.AST]ΒΆ
- name: strΒΆ
- get_name()ΒΆ
- Return type:
str
- match(node, parent, field, inside_list)ΒΆ
- class tilelang.autodd.BinOpFwdArgΒΆ
Bases:
ASTRewriteHelper class that provides a standard way to create an ABC using inheritance.
- forward: Literal['left', 'right'] = 'left'ΒΆ
- get_name()ΒΆ
- Return type:
str
- match(node, parent, field, inside_list)ΒΆ
- tilelang.autodd.ASTPatKindΒΆ
- class tilelang.autodd.ASTPatΒΆ
- tree: ast.expr | list[ast.stmt]ΒΆ
- placeholders: set[str]ΒΆ
- classmethod from_code(kind, code, placeholders)ΒΆ
- Parameters:
kind (ASTPatKind)
code (str)
placeholders (set[str])
- Return type:
- match_placeholders(node)ΒΆ
- Parameters:
node (ast.AST | list[ast.AST])
- Return type:
dict[str, ast.AST] | bool
- replace(repl)ΒΆ
- Parameters:
repl (dict[str, ast.AST])
- Return type:
ast.AST
- class tilelang.autodd.ASTPatRewriteΒΆ
Bases:
ASTRewriteHelper class that provides a standard way to create an ABC using inheritance.
- name: strΒΆ
- checker: Callable[[dict[str, ast.AST]], bool] | dict[str, Callable[[ast.AST], bool]] | None = NoneΒΆ
- derived: dict[str, Callable[[dict[str, ast.AST]], ast.AST]] | None = NoneΒΆ
- classmethod from_code(name, kind, match, rewrite, placeholders, checker=None, derived=None)ΒΆ
- Parameters:
- Return type:
- get_name()ΒΆ
- Return type:
str
- match_placeholders(node)ΒΆ
- Parameters:
node (ast.AST)
- match(node, parent, field, inside_list)ΒΆ
- class tilelang.autodd.LabeledRewriteΒΆ
- label: intΒΆ
- rewrite: ASTRewriteΒΆ
- class tilelang.autodd.RewriteAttacher(rewrites)ΒΆ
Bases:
ASTMutator- Parameters:
rewrites (list[ASTRewrite])
- rewritesΒΆ
- uid_counter = 0ΒΆ
- rewrite_counter = 0ΒΆ
- rewrite_namesΒΆ
- tilelang.autodd.attach_rewrites(tree, rewrites)ΒΆ
- Parameters:
tree (ast.AST)
rewrites (list[ASTRewrite])
- Return type:
tuple[ast.AST, int, int]
- class tilelang.autodd.RewriteApplier(target_labels)ΒΆ
Bases:
ASTMutator- Parameters:
target_labels (set[int])
- target_labelsΒΆ
- applied_rewrites: set[int]ΒΆ
- visited: set[int]ΒΆ
- tilelang.autodd.apply_rewrites(tree, target_labels)ΒΆ
- Parameters:
tree (ast.AST)
target_labels (set[int])
- Return type:
tuple[ast.AST, set[int]]
- tilelang.autodd.test_rewrite(rewrite, code)ΒΆ
- Parameters:
rewrite (ASTRewrite)
code (str)
- class tilelang.autodd.PDD(all_labels, init_proba=0.93)ΒΆ
- Parameters:
all_labels (list[int])
init_proba (float)
- all_labelsΒΆ
- probasΒΆ
- apply(target_labels)ΒΆ
- Parameters:
target_labels (set[int])
- Return type:
set[int]
- class tilelang.autodd.TaskManagerΒΆ
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- classmethod from_source(source, *args, **kwargs)ΒΆ
- Abstractmethod:
- Parameters:
source (str)
- Return type:
- class tilelang.autodd.ASTPDD(tree, rewrites, init_proba=0.93)ΒΆ
Bases:
TaskManager,PDDHelper class that provides a standard way to create an ABC using inheritance.
- Parameters:
tree (ast.AST)
rewrites (list[ASTRewrite])
init_proba (float)
- classmethod from_source(source, *args, **kwargs)ΒΆ
- apply(target_labels)ΒΆ
- Parameters:
target_labels (set[int])
- Return type:
set[int]
- tilelang.autodd.ruff_fix_code(code_string, fix_lint=True, format_code=True)ΒΆ
- class tilelang.autodd.LinePDD(source, init_proba=0.93)ΒΆ
Bases:
TaskManager,PDDHelper class that provides a standard way to create an ABC using inheritance.
- Parameters:
source (str)
init_proba (float)
- linesΒΆ
- classmethod from_source(source, *args, **kwargs)ΒΆ
- class tilelang.autodd.Ruff(source, fix_lint=True, format_code=True)ΒΆ
Bases:
TaskManagerHelper class that provides a standard way to create an ABC using inheritance.
- sourceΒΆ
- fix_lint = TrueΒΆ
- format_code = TrueΒΆ
- finished = FalseΒΆ
- task_generator()ΒΆ
- class tilelang.autodd.AsyncPythonRunnerΒΆ
- process = NoneΒΆ
- input_queue = NoneΒΆ
- output_queue = NoneΒΆ
- lockΒΆ
- start_proc()ΒΆ
- stop_proc()ΒΆ
- __enter__()ΒΆ
- __exit__(exc_type, exc_value, traceback)ΒΆ
- async run(code, timeout=5.0)ΒΆ
- Parameters:
code (str)
timeout (float)
- class tilelang.autodd.SubProcRunnerΒΆ
- __enter__()ΒΆ
- __exit__(exc_type, exc_value, traceback)ΒΆ
- async run(code, timeout=5.0)ΒΆ
- Parameters:
code (str)
timeout (float)
- tilelang.autodd.clean_empty_pass(code)ΒΆ
- Parameters:
code (str)
- Return type:
str
- tilelang.autodd.JobBackendΒΆ
- class tilelang.autodd.ParTaskManagerΒΆ
- err_msg: strΒΆ
- text: strΒΆ
- output_file: pathlib.PathΒΆ
- timeout: int = 60ΒΆ
- num_workers: int = 1ΒΆ
- backend: JobBackend = 'runner'ΒΆ
- __post_init__()ΒΆ
- property text_lenΒΆ
- reset(task_manager)ΒΆ
- Parameters:
task_manager (TaskManager)
- post_proc(text)ΒΆ
- async worker(wid)ΒΆ
- Parameters:
wid (int)
- async start_workers()ΒΆ
- async stop_workers()ΒΆ
- async run_async(task_manager)ΒΆ
- Parameters:
task_manager (TaskManager)
- async run_with(cls, *args, **kwargs)ΒΆ
- Parameters:
cls (type[TaskManager])
- class tilelang.autodd.ArgsΒΆ
Bases:
NamedTuple- source: pathlib.PathΒΆ
- err_msg: strΒΆ
- output: pathlib.PathΒΆ
- backend: JobBackendΒΆ
- timeout: intΒΆ
- jobs: intΒΆ
- tilelang.autodd.cli_main(argv=None)ΒΆ
- Parameters:
argv (Sequence[str] | None)
- Return type:
None