This change attaches builtin-ness as an explicit attribute, rather than a module prefix expectation. This permits us to source those builtins from multiple sub-modules (useful when some builtins are part of the true cyclic implementation core, and some are just useful library additions); but also prevents accidental inclusion of non-builtins that happen to be in the right library. Once the flag exists, and the compiler is using `is_builtin()` for decision making; the existence of the current `@extern` interface becomes isomorphic to `@builtin`; and the interface can be unified. Leaving `@extern` a thin-wrapper, and encouraging continued use of it, establishes future-proofing towards adding additional extern tracing, metric hooks, or scanning in the future. * Add `triton.impl` package to hold the core, order dependent impl details. * Extract `@builtin` and unify `@extern`; add `is_builtin()` * Add sense bit so that `@builtin` detection is less fragile. * Modify the compiler to use `is_builtin()`
23 lines
466 B
Python
23 lines
466 B
Python
"""Triton internal implementation details.
|
|
|
|
Client libraries should not import interfaces from the `triton.impl` module;
|
|
as the details are subject to change.
|
|
|
|
APIs defined in the `triton.impl` module which are public will be re-exported
|
|
in other relevant `triton` module namespaces.
|
|
"""
|
|
|
|
from triton._C.libtriton.triton import ir
|
|
from .base import (
|
|
builtin,
|
|
extern,
|
|
is_builtin,
|
|
)
|
|
|
|
__all__ = [
|
|
"builtin",
|
|
"extern",
|
|
"ir",
|
|
"is_builtin",
|
|
]
|