Skip to content

Graph~Explicit~sub_graph_nested.cpp and Graph~RecordReplay~sub_graph_nested.cpp compare floating point values with "==" #10860

Closed
@jsji

Description

@jsji

Describe the bug
This is found in our internal test, we get failures when running sycl-in-tree tests.

Assertion `Output[i] == ref' failed.error: command failed with exit status

To Reproduce
Run sycl-in-tree in different GPU should be able to reproduce it.

Additional context

@wwXing0 and @tylanphear did the initial triage, the following

The tests assertion fail seems because it use "==" to compare two floating-point numbers.

assert(Output[i] == ref);

Adding some debug prints, I got some output that seems to indicate this is a floating point accuracy issue. There are small differences between the reference and output:

Ref: 0.140000000596046
Output[0]: 0.140000000596046
Ref: 0.639999985694885
Output[1]: 0.640000104904175
Ref - Output[i]: -1.19209289550781e-07
Ref: -2.85999989509583
Output[2]: -2.8600001335144
Ref - Output[i]: 2.38418579101562e-07
Ref: -10.3599996566772
Output[3]: -10.3599996566772
Ref: -21.8600006103516
Output[4]: -21.8600006103516
Ref: -37.3600006103516
Output[5]: -37.3600006103516
Ref: -56.8600006103516
Output[6]: -56.8600006103516
Ref: -80.3600006103516
Output[7]: -80.3600006103516
Ref: -107.860000610352
Output[8]: -107.860000610352
Ref: -139.360000610352
Output[9]: -139.360000610352

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions