[code-reflection] RFR: Integrate Java Triton example with Intel Triton Backend [v2]

hanklo6 duke at openjdk.org
Wed Nov 6 16:14:23 UTC 2024


On Tue, 5 Nov 2024 21:39:49 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> hanklo6 has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add comments
>
> cr-examples/triton/src/main/java/oracle/code/triton/ArithMathOps.java line 398:
> 
>> 396:     public static class CompareOp extends ArithMathOp implements Op.Pure {
>> 397:         public static final String NAME = "arith.cmp";
>> 398:         public static final String ATTRIBUTE_CONSTANT_VALUE = "predicate";
> 
> Suggestion:
> 
>         public static final String ATTRIBUTE_PREDICATE = "predicate";

Fixed.

> cr-examples/triton/src/main/java/oracle/code/triton/ArithMathOps.java line 401:
> 
>> 399: 
>> 400:         public enum CompareKind {
>> 401:             eq,
> 
> Can you link to https://mlir.llvm.org/docs/Dialects/ArithOps/#cmpipredicate ? and also state in the comment the enum ordinal corresponds to the MLIR symbol's value. Further comment that we would need to refine when considering comparisons of floating point numbers which is in a different namespace.

Thanks, fixed.

> cr-examples/triton/src/main/java/oracle/code/triton/TritonTransformer.java line 1054:
> 
>> 1052:             a = block.context().getValue(a);
>> 1053:             b = block.context().getValue(b);
>> 1054:             Object zero;
> 
> Add a comment such as
> 
> // Computed result is tensor of floats, regardless of inputs
> 
> like when we compute the type. Since the result is hard coded we don't need to use reflection and can directly use the constant expression "0.0".

Fixed.

-------------

PR Review Comment: https://git.openjdk.org/babylon/pull/241#discussion_r1831333593
PR Review Comment: https://git.openjdk.org/babylon/pull/241#discussion_r1831333218
PR Review Comment: https://git.openjdk.org/babylon/pull/241#discussion_r1831334498


More information about the babylon-dev mailing list