-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIR, TVMScript] Add TIR - Triton integration #17395
Conversation
d8c1b19
to
25c7bc8
Compare
Added a macro `T.call_triton` in TIR script parser, which expands to AOT compilation of the kernel and the host TIR code to launch the kernel.
25c7bc8
to
03fb1a4
Compare
This is a great mechanism to integrate kernel generators. Some notes on design that might help generalize it abit Would be great to change the intrinsic to T.call_kernel, which checks the first parameter for kernel types and dispatch accordingly.
Overall Mechanism
|
pytestmark = pytest.skip("Triton is not available", allow_module_level=True) | ||
|
||
|
||
@tvm.testing.requires_cuda |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a testcase of rewrite usecase
if tir_mod is not None and len(tir_mod.get_global_vars()) > 0: | ||
lib = tvm.build( | ||
tir_mod, | ||
target=target, | ||
runtime=_autodetect_system_lib_req(target, system_lib), | ||
) | ||
return Executable(_ffi_api.VMLink(builder, target, lib, ext_libs, params)) # type: ignore | ||
for ext_mod in ext_libs: | ||
if ext_mod.type_key == "cuda": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a followup, add a function to check if the module is_device_module, this should include cuda, rocm, webgpu, vulkan, opencl
Added a macro
T.call_triton
in TIR script parser, which expands to AOT compilation of the kernel and the host TIR code to launch the kernel.cc @tqchen @cyx-6