qiboteam / qibo

A framework for quantum computing
https://qibo.science
Apache License 2.0
287 stars 58 forks source link

Inconsistent pytest results on macos with pytorch #1313

Closed scarrazza closed 5 months ago

scarrazza commented 5 months ago

Tests are failing on macos after merging 036e882adfd7878b566e90eae02ff2c72e16e296. The issue seems unrelated to code changes. I am able to reproduce the failure on macos, while it works well on linux.

alecandido commented 5 months ago

This seems to be related to the generation of pRNG sequences with Pytorch. We need to reproduce the different sequence outside Qibo (the numbers that are then used within Qibo, leading to the discrepancy) and test on the different platforms, to understand which is the origin of the issue.

The current advice is to skip the affected test.

Moreover, in general is a good idea if our tests do not depend (much) on the seed used, testing statistical properties within suitable uncertainties (though it is always possible that an extraction falls outside one sigma).