Skip to content

Commit 0f87fd5

Browse files
fix(tensilelite): Accept .dat.zlib in --use-cache existence check [AIHPBLAS-3508]
PR #8294 changed writeMsgPack() to produce .dat.zlib files but missed updating the Python existence check in BenchmarkProblems.py. The C++ client already probes for .zlib automatically (fileToMsgObject tries filename + ".zlib" first), so the fix widens only the Python check to accept both .dat and .dat.zlib on disk. Without this fix, all --use-cache benchmark tests FATAL with "cache.yaml refers to a library file that no longer exists" when LibraryFormat=msgpack. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent edcb934 commit 0f87fd5

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

projects/hipblaslt/tensilelite/Tensile/BenchmarkProblems.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,9 @@ def _benchmarkProblemType(problemTypeConfig, problemSizeGroupConfig, problemSize
758758
outFile = os.path.join(sourcePath, "ClientParameters.ini")
759759

760760
cachedLibraryFile = tensileLibraryFile(sourcePath, gfxName, globalParameters["LibraryFormat"])
761-
if not os.path.isfile(cachedLibraryFile):
761+
# writeMsgPack produces .dat.zlib; accept both on disk.
762+
if not os.path.isfile(cachedLibraryFile) \
763+
and not os.path.isfile(str(cachedLibraryFile) + ".zlib"):
762764
printExit(
763765
f"cache.yaml refers to a library file that no longer "
764766
f"exists on disk: {cachedLibraryFile}. The cache directory may "

projects/hipblaslt/tensilelite/Tensile/Tests/unit/test_benchmarkProblems_cache_library_file.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,23 @@ class StubBenchmarkStep:
8383
)
8484

8585

86+
def test_cached_path_accepts_zlib_compressed_library_file():
87+
"""The existence check must accept .dat.zlib when .dat is absent.
88+
89+
writeMsgPack produces .dat.zlib (PR #8294). The C++ client probes for
90+
.zlib automatically, so cachedLibraryFile stays as .dat — but the
91+
Python guard must not FATAL when only .dat.zlib exists on disk.
92+
"""
93+
src = inspect.getsource(bp._benchmarkProblemType)
94+
cached_branch = src.split("Using cached solution data", 1)[1]
95+
cached_branch = cached_branch.split("writeSolutions", 1)[0]
96+
assert '".zlib"' in cached_branch, (
97+
"Cached path must check for .dat.zlib fallback alongside .dat. "
98+
"writeMsgPack produces .dat.zlib; without this check, --use-cache "
99+
"FATALs with 'library file no longer exists' for msgpack format."
100+
)
101+
102+
86103
def test_cached_path_uses_loaded_LibraryFile_not_recompute():
87104
"""The cached branch of _benchmarkProblemType must use the LibraryFile
88105
that flowed back from _loadCacheIfMatches, NOT recompute via libraryDir()."""

0 commit comments

Comments
 (0)