[code-reflection] RFR: Integrate Java Triton example with Intel Triton Backend [v2]
Paul Sandoz
psandoz at openjdk.org
Thu Nov 7 00:43:20 UTC 2024
On Wed, 6 Nov 2024 15:46:36 GMT, hanklo6 <duke at openjdk.org> wrote:
>> cr-examples/triton/src/test/java/oracle/code/triton/TestMatrix.java line 264:
>>
>>> 262: LessThan);
>>> 263: var b = load(b_ptrs, broadcast(offs_k_m_3, b_ptrs.type()));
>>> 264: // We accumulate along the K dimension.
>>
>> Were these necessary changes because you encountered a bug?
>
> Because I changed the return type of the `compare` function to `boolean`, It can't match the return type of the `expand` function.
Ah yes, of course.
>> cr-examples/triton/src/test/java/oracle/code/triton/TestMatrix.java line 471:
>>
>>> 469: int stride_am, @Constant int stride_ak,
>>> 470: int stride_bk, @Constant int stride_bn,
>>> 471: int stride_cm, @Constant int stride_cn,
>>
>> Why the marking as constants?
>
> Triton will mark these three stride values as constants if they are equal to one at compile time. We mark them as constants directly as our code is not compiled by Triton.
Oh i see, i don't see those equivalent parameters marked as `tl.constexpr` in the Python matmul example. I think we need the concept of optional constants e.g., a boolean on the `@Constant` annotation. An optional constant parameter can be associated with type or a constant type.
(Alternatively we could drop the constant annotation, but it seems useful to distinguish various parameters)
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/241#discussion_r1831864743
PR Review Comment: https://git.openjdk.org/babylon/pull/241#discussion_r1831868919
More information about the babylon-dev
mailing list