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

hanklo6 duke at openjdk.org
Fri Nov 8 00:08:44 UTC 2024


On Wed, 6 Nov 2024 23:48: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/TritonTransformer.java line 1061:
> 
>> 1059:             } catch (Throwable e) {
>> 1060:                 throw new RuntimeException(e);
>> 1061:             }
> 
> Suggestion:
> 
>             Object zero = 0.0;

Fixed.

> cr-examples/triton/src/test/java/oracle/code/triton/TritonTestExtension.java line 114:
> 
>> 112:             });
>> 113: 
>> 114:             String mlirText = MLIRGenerator.transform(actualTritonKernel);
> 
> We should write the files to the maven target directory. Add the following to the surefire plugin configuration:
> 
>                         <systemPropertyVariables>
>                             <project.build.directory>${project.build.directory}</project.build.directory>
>                         </systemPropertyVariables>
> 
> Then replace the code below with:
> 
>             Path buildDir = Path.of(System.getProperty("project.build.directory", ""));
>             Path mlirDir = buildDir.resolve("mlir");
>             try {
>                 Files.createDirectories(mlirDir);
>                 Files.writeString(mlirDir.resolve(javaKernelName + ".mlir"), mlirText, StandardOpenOption.CREATE);
>             } catch (IOException e) {
>                 e.printStackTrace();
>             }

Thanks, fixed.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/241#discussion_r1833521448
PR Review Comment: https://git.openjdk.org/babylon/pull/241#discussion_r1833521919


More information about the babylon-dev mailing list