Conversation
…t instead of a filename, added a unit test for cache conversion (although i dont know how to run it)
|
|
I've just tried to convert a Kernel Tuner cache file to the T4 format, but the conversion does not yet handle non-valid configurations. This can be seen in |
| invalidity = "constraints" | ||
|
|
||
| result = T4ResultLineJSON( | ||
| timestamp=cache_line["timestamp"], |
There was a problem hiding this comment.
This line requires the input cachefile to have timestamps, is that something we want to enforce or are we okay with something like cache_line.get("timestamp", None)?
|
There was a problem hiding this comment.
The ignore statements added here means that ruff no longer checks for missing docstrings in public modules, classes, methods and functions. I don't think that is what we want.
This can happen if time is not the auto-tuning objective; just because times are not present does not mean there has not been time spent tuning.
|



This pull request restores the accidentally closed pull request #265 that I can't seem to otherwise restore myself. This time its not from a 'master' branch on a fork, but from a branch of our own repository which makes it easier to work with.
To restore the original text of the pull request by @tdejong00:
This pull request adds an interface for modifying cache files, which is located in the
kernel_tuner/cachedirectory. This directory contains the following modules:cache(main module): contains aCacheclass through which cache files can be created, read and written. This should be the only python module that needs to be used for modifying cache files.cli_tools: contains functions used in thektcachecommand.convert: contains functions for converting (older) cache files to newer cache files.file: contains functions for reading JSON from and writing JSON to cache files.json: contains TypeDict type hints for typing code.json_encoder: contains a custom instance of JSONEncoder that automatically serializes data into JSON in a readable format.paths: contains useful paths within the project.versions: exports useful Semver version constants.Furthermore the following test modules have been added:
test_cachefile_class.py: tests whether the class integrates the functionalities of the other cache modules in the correct way and the additional logic in theCacheclass.test_cachefile_encoder.py: tests whether the JSON is encoded in the right way.test_cachefile_read_write.py: tests whether cache is read and written in the correct format.test_cachefile_schema.py: tests the correctness of the schema.test_script_ktcache.py: tests thektcacheCLI command.We have not yet added an entry to the
CHANGELOG.md, because we are not sure in what version these changes will be introduced.