Skip to content

Conversation

@LittleLittleCloud
Copy link

We are excited to review your PR.

So we can do the best job, please check:

  • There's a descriptive title that will make sense to other developers some time from now.
  • There's associated issues. All PR's should have issue(s) associated - unless a trivial self-evident change such as fixing a typo. You can use the format Fixes #nnnn in your description to cause GitHub to automatically close the issue(s) when your PR is merged.
  • Your change description explains what the change does, why you chose your approach, and anything else that reviewers should know.
  • You have included any necessary tests in the same PR.

@LittleLittleCloud LittleLittleCloud changed the title move ReportTrialResourceUsage to IPerformanceMonitor move ReportTrialResourceUsage to IPerformanceMonitor and rename it to OnPerformanceMetricsUpdatedHandler Jan 3, 2023
/// <param name="factory"></param>
/// <returns></returns>
public static AutoMLExperiment SetPerformanceMonitor<TPerformanceMonitor>(this AutoMLExperiment experiment, Func<IServiceProvider, TPerformanceMonitor> factory)
where TPerformanceMonitor : class, IPerformanceMonitor
Copy link
Author

Choose a reason for hiding this comment

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

You can inject your own IPerformanceMonitor here.


public virtual void OnPerformanceMetricsUpdatedHandler(TrialSettings trialSettings, TrialPerformanceMetrics metrics, CancellationTokenSource trialCancellationTokenSource)
{
if (_settings.MaximumMemoryUsageInMegaByte is double d && metrics.PeakMemoryUsage > d && !trialCancellationTokenSource.IsCancellationRequested)
Copy link
Author

Choose a reason for hiding this comment

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

You can bring ReportTrialResourceUsage here. It will be called every time a new PerformanceMetric get sampled

@andrasfuchs andrasfuchs merged commit aeb651c into andrasfuchs:add-cancellation-and-resource-monitoring-to-imonitor Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants