Skip to content

Find Mode TrustVerify #3604

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

Merged
merged 56 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
097f485
add find mode TrustVerify, first draft
cderb Feb 26, 2025
12c9b0f
fix build errors
cderb Feb 28, 2025
d8990b5
Merge remote-tracking branch 'pub/develop' into cderb/find_mode_verify
cderb Mar 10, 2025
c0a9d9c
tune when trustverify and performance check fails, add logging statem…
cderb Mar 10, 2025
4721681
add api test for new find mode
cderb Mar 10, 2025
881465c
stop addition of results when trustverify has regenerated, debug prints
cderb Mar 11, 2025
ccffe8a
fetch max workspace for trustverify
cderb Mar 11, 2025
5d551ad
remove log
cderb Mar 11, 2025
eeda496
trustverify triggers tuning on miss
cderb Mar 11, 2025
12c1cff
Merge branch 'develop' into cderb/find_mode_verify
cderb Mar 11, 2025
4234f4c
clang format
cderb Mar 12, 2025
eaba243
clang format
cderb Mar 12, 2025
b47bc73
update documentation for TrustVerify
cderb Mar 12, 2025
759ac80
Apply suggestions from code review
cderb Mar 12, 2025
a58f556
hip tidy
cderb Mar 13, 2025
ed89db5
Merge branch 'develop' into cderb/find_mode_verify
cderb Apr 28, 2025
2bb47c7
reduce fdb loads
cderb Apr 28, 2025
6fbb59d
split out logic for fdb verification to new function. Allow verificat…
cderb Apr 29, 2025
b945bcd
cleanup
cderb Apr 30, 2025
83b351a
add FallbackPath enum to pass fallback option selection
cderb Apr 30, 2025
e6e8beb
add time constraints around TrustVerify tuning, add TrustVerifyFull f…
cderb Apr 30, 2025
0e927ed
update test
cderb May 1, 2025
3009a13
clang-format
cderb May 1, 2025
1b7102f
hip tidy
cderb May 1, 2025
1c66b4c
update doc
cderb May 5, 2025
c87eaf1
fix bug in registering evaluated solvers
cderb May 7, 2025
d187884
clang format
cderb May 8, 2025
46574eb
Merge branch 'develop' into cderb/find_mode_verify
cderb May 12, 2025
0a1b00e
Merge branch 'develop' into cderb/find_mode_verify
cderb May 14, 2025
3971bcd
Merge branch 'develop' into cderb/find_mode_verify
cderb May 19, 2025
9b3aa07
Merge remote-tracking branch 'origin/develop' into cderb/find_mode_ve…
cderb May 27, 2025
ce2c614
merge fix for queue handling of last_imprv
cderb May 27, 2025
7730b55
add env for verify tolerance, bugfix for evaluating solutions.
cderb May 28, 2025
768cc1f
Merge remote-tracking branch 'origin/develop' into cderb/find_mode_ve…
cderb May 28, 2025
88ac81c
re-organize code to prevent IsEnoughWorkspace print for hybrid_dynami…
cderb May 28, 2025
95f4841
clang format
cderb May 28, 2025
9aa345e
revert to hybrid dynamic from trust verify when user db disabled
cderb May 29, 2025
aebb7ff
add assert for solver order in VerifiedFDBSolution
cderb May 29, 2025
cfda2ef
clang format
cderb May 30, 2025
229bd55
hip tidy
cderb Jun 2, 2025
6c3c074
Merge branch 'develop' into cderb/find_mode_verify
cderb Jun 5, 2025
727c0ce
break out smaller functions
cderb Jun 18, 2025
d6109ee
more function splitting
cderb Jun 19, 2025
7020591
drafting ut for new find mode
cderb Jun 19, 2025
e2b4998
test updates
cderb Jun 20, 2025
5d2fbb2
set test values
cderb Jun 23, 2025
5e8012a
cleanup
cderb Jun 23, 2025
5a9b6fb
Merge remote-tracking branch 'origin/develop' into cderb/trustverify_ut
cderb Jun 23, 2025
e993398
conform to gtest naming
cderb Jun 23, 2025
aa3894e
Merge branch 'cderb/trustverify_ut' of https://github.com/ROCm/MIOpen…
cderb Jun 23, 2025
0ca672d
tidy
cderb Jun 23, 2025
4bb57ad
replace memset with fill_n for tidy
cderb Jun 24, 2025
a03d847
Merge branch 'develop' into cderb/find_mode_verify
cderb Jun 27, 2025
aa9e7d2
Merge branch 'develop' into cderb/find_mode_verify
cderb Jun 30, 2025
2beb2bb
Merge branch 'develop' into cderb/find_mode_verify
cderb Jul 1, 2025
e7b6e77
revert default find mode to dynamic hybrid
cderb Jul 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/miopen/miopen.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,8 @@ typedef enum
miss, uses the existing Find machinery with skipping non-dynamic kernels, thus saving
compilation time. Faster start-up times than Hybrid Find, but GPU performance might be
a bit worse. >*/
miopenConvolutionFindModeTrustVerify =
6,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs docs like the others.
The PR description is probably pretty close to what is needed!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added doc

miopenConvolutionFindModeDefault =
miopenConvolutionFindModeDynamicHybrid /*!< Default FindMode >*/
Comment on lines 670 to 671
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resetting default mode to dynamic hybrid.
Will consider find mode 6 when user find db is usable in a networked file system.

} miopenConvolutionFindMode_t;
Expand Down
14 changes: 7 additions & 7 deletions src/conv/solver_finders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ const std::vector<std::unique_ptr<ISolversFinder>>& GetConvSolverFinders()
} // namespace conv

/// Register invoker only for the best solution within algorithm.
static std::vector<Solution> EvaluateInvokers(const Handle& handle,
const std::vector<solver::ConvSolution>& solutions,
const AlgorithmName& algorithm_name,
const NetworkConfig& network_config,
const AnyInvokeParams& invoke_ctx,
bool& is_result_optimal,
bool force_attach_binary)
std::vector<Solution> EvaluateInvokers(const Handle& handle,
const std::vector<solver::ConvSolution>& solutions,
const AlgorithmName& algorithm_name,
const NetworkConfig& network_config,
const AnyInvokeParams& invoke_ctx,
bool& is_result_optimal,
bool force_attach_binary)
{
const auto arch = env::value(MIOPEN_DEVICE_ARCH);
if(!arch.empty())
Expand Down
2 changes: 1 addition & 1 deletion src/convolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ std::size_t ConvolutionDescriptor::GetWorkSpaceSize(ExecutionContext ctx,
ctx.do_search = false;
ctx.disable_perfdb_access = true;

while(findMode.IsFast(ctx) || findMode.IsHybrid(ctx))
while(findMode.IsFast(ctx) || (findMode.IsHybrid(ctx) && !findMode.IsTrustVerify(ctx)))
{
/// \section ffind_gwss_why_not_0
/// Basically we can return 0 here because
Expand Down
8 changes: 8 additions & 0 deletions src/find_controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ const char* ToCString(const FindMode::Values mode)
case FindMode::Values::Hybrid: return "HYBRID";
case FindMode::Values::DeprecatedFastHybrid: break;
case FindMode::Values::DynamicHybrid: return "DYNAMIC_HYBRID";
case FindMode::Values::TrustVerify: return "TRUST_VERIFY";
case FindMode::Values::End_: break;
}
return "<Unknown>";
Expand Down Expand Up @@ -222,6 +223,10 @@ std::optional<FindMode::Values> GetFindModeValueImpl2(Variable variable)
{
return FindMode::Values::DynamicHybrid;
}
else if(str == "TRUST_VERIFY")
{
return FindMode::Values::TrustVerify;
}
else
{ // Nop. Fall down & try numerics.
}
Expand Down Expand Up @@ -270,5 +275,8 @@ static_assert(miopenConvolutionFindModeHybrid ==
static_assert(miopenConvolutionFindModeDynamicHybrid ==
static_cast<miopenConvolutionFindMode_t>(FindMode::Values::DynamicHybrid),
"API is not in sync with the implementation.");
static_assert(miopenConvolutionFindModeTrustVerify ==
static_cast<miopenConvolutionFindMode_t>(FindMode::Values::TrustVerify),
"API is not in sync with the implementation.");

} // namespace miopen
8 changes: 8 additions & 0 deletions src/include/miopen/conv/solver_finders.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ struct FindCoreResult
bool is_optimal;
};

std::vector<Solution> EvaluateInvokers(const Handle& handle,
const std::vector<solver::ConvSolution>& solutions,
const AlgorithmName& algorithm_name,
const NetworkConfig& network_config,
const AnyInvokeParams& invoke_ctx,
bool& is_result_optimal,
bool force_attach_binary);

FindCoreResult FindCore(const AnyInvokeParams& invoke_ctx,
const ExecutionContext& ctx,
const ProblemDescriptionBase& problem,
Expand Down
14 changes: 12 additions & 2 deletions src/include/miopen/find_controls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class MIOPEN_INTERNALS_EXPORT FindMode
Hybrid = miopenConvolutionFindModeHybrid,
DeprecatedFastHybrid = 4,
DynamicHybrid = miopenConvolutionFindModeDynamicHybrid,
TrustVerify = miopenConvolutionFindModeTrustVerify,
End_,
Default_ = miopenConvolutionFindModeDefault,
};
Expand Down Expand Up @@ -152,13 +153,22 @@ class MIOPEN_INTERNALS_EXPORT FindMode
template <class Context>
bool IsHybrid(const Context& context) const
{
return (value == Values::Hybrid || value == Values::DynamicHybrid) && IsEnabled(context);
return (value == Values::Hybrid || value == Values::DynamicHybrid ||
value == Values::TrustVerify) &&
IsEnabled(context);
}

template <class Context>
bool IsDynamicHybrid(const Context& context) const
{
return value == Values::DynamicHybrid && IsEnabled(context);
return (value == Values::DynamicHybrid || value == Values::TrustVerify) &&
IsEnabled(context);
}

template <class Context>
bool IsTrustVerify(const Context& context) const
{
return value == Values::TrustVerify && IsEnabled(context);
}

MIOPEN_INTERNALS_EXPORT friend std::ostream& operator<<(std::ostream&, const FindMode&);
Expand Down
Loading
Loading