-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fin Perf Eval handles (reboot) #1548
Conversation
a30a51bc6 remove unused header 7d2fd834c reduce scope of variable f6e9abe79 clang format 834e9a397 remove comment c8d6eb1a0 workspace rename aa7d2ea24 Merge remote-tracking branch 'origin/develop' into cderb/miopen_perf aaf13fb12 add to print for debug ebd9aa6bd update member name (#43) 34e11fa70 Merge remote-tracking branch 'origin/develop' into cderb/miopen_perf cb6c19d13 add search+update directives to execution context, add json examples for perf eval 85029077b connecting new fin functions for perf eval d6d798efe add cu count (#39) 8e1989a9f Add find option for selecting only dynamic solvers (#38) 4d1e031fd add outputs and definitions 952538cb8 adding perf eval function, in progress 0e164bf66 setting json version (#37) 617dccd9c rename 5c35ae886 fixes for collecting kernel blobs 5cfea7c43 syntax fixes 2f2a4ed9f add test file 7175019f5 first rendition of perf_compile f3f7fed18 Remove function redefinition (#36) e1de51a58 Performance DB de-serialize test (#34) 043cdcdaa Layout support in Fin (#33) 3a1d58236 Hotfix (#32) ee3f0d543 4.4 Tuning Bugfixes (#31) 832dbe234 Tunability Reporting (#27) a564a229f include gfx90a_110 (#28) git-subtree-dir: fin git-subtree-split: a30a51bc6b4e3b1dedf6a37b429b287abf5784fc
I'll draft that up in a separate pr. |
@cderb After second thought, I guess maybe it's time to kill ComputedContainers and replace them with STL. Yes, ComputedContainers are virtually endless, but this feature is not really used. After all, now we build kernels for all possible PerformanceConfigs before benchmarking. If there are too many PerformanceConfigs, then the system will first run out of disk space. Usual STL container of PerformanceConfigs will run out of space much later. So I am not against brute-force approach. And removal of ComputedContainers should make our code simpler. |
@cderb So please decide yourself. If you decide to use STL, then go ahead. I will get rid of ComputedContainers after that, in a separate PR. |
@atamazov I'm leaning more towards this implementation (using STL). It looks more clean from an interface level to have a function that specifically returns the array of solutions. The callback implementation I've tested and is functional, but I have some concerns about expanding the function signature of GenericSearch / what unintended uses that function pointer could enable. |
@cderb Ok. |
@atamazov @DrizztDoUrden @JehandadKhan last round call for the reviewers, we plan to proceed with this one. |
ConvSolution FindSolution(const ConvolutionContext& ctx, | ||
Db& db, | ||
const miopen::AnyInvokeParams& invoke_ctx) const override | ||
{ | ||
return miopen::solver::FindSolution(value, ctx, db, invoke_ctx); | ||
}; | ||
|
||
std::string GetPerfCfgParams(const ConvolutionContext& ctx, Db& db, std::true_type) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The body of this function looks like a modified copy of very similar code from FindSolutionImpl
(src/include/miopen/find_solution.hpp). Can we generalize this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The objective of this function is to return the parameter string from the performance config. I see the portion that is common here, and most likely it was the example for this addition. They are entirely similar in that they
- use the same type declaration
- load from the db
- check validity of the config loaded
- do a function x with the loaded config
- log progress
The main difference being (4) the way to minimize this code would be to create an additional function providing a callback in place of (4).
Disregarding log statements and syntactical spacing there are a total of 4 shared lines. Not sure if it's worth complicating with a callback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The objective of this function is to return the parameter string from the performance config
Excuse me, but AFAICS this function is not used, so it seems like it does not have an objective expressed in the code ;)
Which is not surprising, because from the architectural point of view, getting tuning config from the database is not a Solver's job.
I think that this method should be removed from AnySolver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we remove this function, I'll need a way to retrieve the serialized performance parameters. Could be the winner from the solver or from a solution. I'm searching for another method, but nothing yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add this function to a PR that will actually use it? This will allow us to expedite the review of this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. If you know SolverId, then it is possible to construct an instance of the Solver and then follow the design pattern of:
https://github.com/ROCmSoftwarePlatform/MIOpen/blob/72d89b40ee97666efaac0a0979a48680bd02f1da/src/include/miopen/find_solution.hpp#L123-L125
I can do this for you in a future PR where you will implement Fin changes. Or you can ask @DrizztDoUrden to assist.
But let's avoid adding unused code in this PR. Is it acceptable for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the key issue is that in order to call serialize on PerformanceConfig, access to the fully substantiated type is required, but occluded behind AnySolver. There needs to be some way of extracting that performance parameter string so that the pdb entry data can be recorded by Fin.
A function producing the performance parameter string would be necessary for the current implementation of performance tuning in Fin to be complete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please send me proposed Fin changes (where you call GetPerfCfgParams
) and I will offer a substitute. This is necessary, because
from the architectural point of view, getting tuning config from the database is not a Solver's job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll email the code section to your amd address. Do you still have access?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cderb No, unfortunately. But you can send me mail to DXC (please check your amd inbox).
9563a5e
Co-authored-by: Artem Tamazov <artem.tamazov@gmail.com>
…OCmSoftwarePlatform/MIOpen into cderb/fin_perf_solver_mergres2
@@ -67,6 +67,7 @@ struct ExecutionContext | |||
{ | |||
// Operation modes & environment | |||
bool do_search = false; | |||
bool db_update = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only initialized but not updated anywhere. Can we make this change when it's really needed (thus following the YAGNI principle)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in fin, at conv_fin.hpp:559
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but the problem is that this PR does NOT include changes in conv_fin.hpp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be resolved by changes in #1588
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move forward with whatever we already have. I will try to refactor the code after some ongoing rework (that involves reworking of the PerformanceConfig class hierarchy) is done.
/cc @averinevg
rehash of #1546
Changes:
generic_search
GetAllSolutions function added to generic_search, this function is made available through any_solver to the outside. This allows Fin to get the full list of solutions so that it may manage compilation manually.
Related function GetAllConfigs is also introduced for code modularity.
any_solver has functions added
GetAllSolutions - returns list of all solutions, used for kernel compiling in Fin.
GetPerfCfgParams - returns the parameter string for the solver's performance configuration. This is used for db recording in Fin.
LegacySolver - creates a bool at compile time that identifies legacy solvers
execution_context & find_solutions
add db_update bool to context - This allows Fin to programmatically initiate a db update tuning.
solver.hpp + .cpp files
changes necessary for new functions in generic_search
binary_cache
spelling fix