| Add mechanism for remapping device-specific module imports (#4539)
This is motivated by #4509. The crux of the problem is that the Triton
code generator needs to inspect a function's arguments / attributes /
types in order to determine how it should be called. This meant that
"implementation details" like whether a function is a builtin needed to
be exposed in the "interface" tl.extra.libdevice module, instead of
just residing in tl.extra.cuda.libdevice. Moreover, this meant that
libdevice functions marked as @core.extern in the interface could not
be implemented via JitFunctions.
Allowing each backend to provide its own module map solves this problem
as the code generator can inspect the actual function implementation. | 1 年前 |