triton icon indicating copy to clipboard operation
triton copied to clipboard

[Frontend] [BC breaking] Always follow C semantics on %

Open lezcano opened this issue 1 year ago • 1 comments

The semantics of % in triton used to be type dependant (!!).

With this PR, we make % always follow C semantics, similar to //.

We update the type promotion docs fixing some inaccuracies. It is still not entirely precise though. For a discussion of the current semantics see https://github.com/triton-lang/triton/issues/4697

lezcano avatar Sep 10 '24 22:09 lezcano

I left this aside for now, prioritising the mxfp stuff, as this is lower prio. It shouldn't take long too long to land tho.

lezcano avatar Sep 30 '24 13:09 lezcano

Hello, I was wondering what more is left of this task? I'm happy to pick it up if this is a task that is still lower priority.

I've looked through the failed tests and interpreter code to get a better understanding of what is happening. I could be wrong about this assumption but it seems that the create_frem function needs to have special cases to handle the new semantics? Similar to how the create_idiv is created to follow C semantics.

brod4910 avatar Oct 15 '24 18:10 brod4910

It pretty much just needs to make the tests more resilient. Many tests rely on UB and things that should not be tested. I think it shouldn't be terribly difficult to get it though the finish line. I don't think I'll be able to shepherd you, but if you think you can do it (and given what you have said, I think you are), feel free to take on it and tag me as a reviewer once you have a PR up :)

lezcano avatar Oct 15 '24 18:10 lezcano

Sweet, I'll take a crack at it then!

brod4910 avatar Oct 15 '24 18:10 brod4910

Will land in https://github.com/triton-lang/triton/pull/4955

lezcano avatar Oct 22 '24 09:10 lezcano