Each call to _roundtrip was creating a file with the same name in the temp directory and the second write would fail. This gives each temp file a unique name manually.
We could also
Close the file to allow it to be reopened
Use other functions in tempfile to create uniquely named files, not just a directory
Sample error: FAILED sharktank\tests\types\quantizers_test.py::StaticScaledQuantizerTest::testPerTensorQuantDequant - RuntimeError: Error building parameter archive: D:\a\iree\iree\c\runtime\src\iree\base\internal\file_io.c:381: UNKNOWN; failed to open file 'C:\Users\RUNNER~1\AppData\Local\Temp\tmpejgrnsnpStaticScaledQuantizerTest\poodoo.irpa'. Full logs: https://github.com/nod-ai/sharktank/actions/runs/9509442435/job/26212392662.
Each call to
_roundtrip
was creating a file with the same name in the temp directory and the second write would fail. This gives each temp file a unique name manually.We could also
Sample error:
FAILED sharktank\tests\types\quantizers_test.py::StaticScaledQuantizerTest::testPerTensorQuantDequant - RuntimeError: Error building parameter archive: D:\a\iree\iree\c\runtime\src\iree\base\internal\file_io.c:381: UNKNOWN; failed to open file 'C:\Users\RUNNER~1\AppData\Local\Temp\tmpejgrnsnpStaticScaledQuantizerTest\poodoo.irpa'
. Full logs: https://github.com/nod-ai/sharktank/actions/runs/9509442435/job/26212392662.References: