Thanks to visit codestin.com
Credit goes to github.com

Skip to content

reassociation is always allowed #2402

@dneto0

Description

@dneto0

In https://gpuweb.github.io/gpuweb/wgsl/#reassociation it says:

An implementation may reassociate and/or fuse operations if the optimization is at least as accurate as the original formulation.

The qualification of being "at least as accurate" makes no sense when applied to reassociation. You can't statically determine if the reassociation is at least as accurate as the original expression.

For example, for (a + b) + c vs. a + (b + c), catastrophic cancellation can occur with one or the other grouping of the terms, and is entirely dependent on the values of a, b, and c.

So it was an editoral error to qualify by "at least as accurate".

I can still see it applying for fusing operations, where an IEEE-compliant FMA can be more accurate than doing multiply followed by addition.

Metadata

Metadata

Assignees

Labels

wgslWebGPU Shading Language Issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions