Sanitize benchmark mxr file name to use _ instead of invalid Windows characters#5024
Sanitize benchmark mxr file name to use _ instead of invalid Windows characters#5024ahsan-ca wants to merge 5 commits into
_ instead of invalid Windows characters#5024Conversation
b5f11a8 to
442f654
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates GPU benchmark .mxr file naming to avoid :: in operator names (improving filename portability, especially on Windows), and adds a VS Code workspace settings file.
Changes:
- Sanitize
preop.name()when generating benchmark.mxrfilenames by replacing::with_. - Add
.vscode/settings.jsonwith workspace settings (remote extension kind + disable CMake configure-on-open).
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/targets/gpu/compile_ops.cpp | Sanitizes operator names before using them in benchmark .mxr filenames. |
| .vscode/settings.json | Adds VS Code workspace settings. |
442f654 to
2726846
Compare
_ instead of ::__ instead of ::
2726846 to
ac65834
Compare
| auto problem_hash = std::hash<std::string>{}(to_string(config->problem)); | ||
| auto mxr_file = mxr_dir / (preop.name() + "_" + std::to_string(i) + "_" + | ||
| // Sanitize the op name for use in a filename. Replace "::" with "__". | ||
| auto op_filename = replace_string(preop.name(), "::", "__"); |
There was a problem hiding this comment.
The pass_manager has a similar sanitize function, I wonder if we should reuse that somehow.
There was a problem hiding this comment.
I have made the changes for that. I had to pull the function from pass_manager out to be used for compile_ops. I have put it in filesystem.hpp, do you think it is better to keep it in filesystem.hpp or in stringutils.hpp?
985f007 to
b13c749
Compare
| #include <migraphx/config.hpp> | ||
| #include <algorithm> | ||
| #include <string> | ||
| #include <string_view> | ||
|
|
There was a problem hiding this comment.
@pfultz2 wondering if we should move sanitize_filename() to stringutils.hpp for the above comment.
There was a problem hiding this comment.
I think fileutils.hpp is better suited for sanitize_filename() function.
There was a problem hiding this comment.
Made changes to move sanitize_filename() to fileutils.hpp. Re-requesting review after this change. @pfultz2
__ instead of ::_ instead of invalid Windows characters
| auto op_filename = sanitize_filename(preop.name()); | ||
| auto mxr_file = mxr_dir / (op_filename + "_" + std::to_string(i) + "_" + | ||
| std::to_string(problem_hash) + ".mxr"); |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5024 +/- ##
========================================
Coverage 92.73% 92.73%
========================================
Files 596 596
Lines 31813 31817 +4
========================================
+ Hits 29500 29504 +4
Misses 2313 2313
🚀 New features to boost your workflow:
|
Check flagged results 🔆 * No develop baseline was found for this PR's branch point; compared against the latest available develop run instead. |
|
Motivation
Windows has issues with filenames containing
::.This changes mxr file names to use
__instead of::.Technical Details
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot Applicable