Skip to content
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

Customer Request: Add Wasm to issue ADX query #4531

Open
LoopedBard3 opened this issue Oct 22, 2024 · 3 comments
Open

Customer Request: Add Wasm to issue ADX query #4531

LoopedBard3 opened this issue Oct 22, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@LoopedBard3
Copy link
Member

Request is to update the generated ADX query in autofiled issues to include WASM similar to how Mono is included. New base query is as follows:

Measurements
| where BuildRepo == 'dotnet/runtime'
| where BuildBranch == 'refs/heads/main'
| where BuildArchitecture in ('x64', 'arm64')
| where TestName == @'System.Memory.Span<Byte>.Clear(Size: 512)'
// Mono
// | where RunConfigurations['CompilationMode'] =~ 'tiered'
// | where RunConfigurations['RunKind'] =~ 'micro_mono'
// | where RunConfigurations['LLVM'] =~ 'true'
// | where RunConfigurations['MonoAOT'] =~ 'true'
// | where RunConfigurations['MonoInterpreter'] =~ 'false'
// WASM
// | where RunConfigurations['AOT'] =~ 'true'
// | where RunConfigurations['RunKind'] =~ 'micro'
| where (RunConfigurations['CompilationMode'] =~ 'tiered' and RunConfigurations['RunKind'] =~ 'micro_mono') or (RunConfigurations['CompilationMode'] =~ 'wasm' and RunConfigurations['RunKind'] =~ 'micro')
| where isempty(RunConfigurationsIosLlvmBuild)
| where isempty(RunConfigurationsJsEngine)
| where isempty(RunConfigurationsPgoType)
| where isempty(RunConfigurationsPhysicalPromotionType)
| where isempty(RunConfigurationsHybridGlobalization)
| where isempty(RunConfigurationsR2RType)
| where isempty(RunConfigurationsExperimentName)
| where TestCounterTopCounter
| where BuildTimeStamp > datetime(2024-08-15T09:19:27.5358056+00:00)
| extend RuntimeName=iff(RunConfigurations['RunKind'] =~ 'micro_mono', "mono", "wasm")
| extend Series=strcat(RuntimeName, "-", FriendlyQueueName(RunQueue), iff(tobool(RunConfigurationsMonoAot) or tobool(RunConfigurationsAot), "-AOT", ""), iff(tobool(RunConfigurationsMonoInterpreter), "-Interp", ""), iff(tobool(RunConfigurationsLlvm), "-LLVM", ""))
| summarize arg_max(BuildName, *) by BuildTimeStamp, TestName, Series
| project BuildTimeStamp, Result=round(TestCounterResultAverage, 3), Series
| render timechart with (series=Series, xcolumn=BuildTimeStamp, ycolumns=Result, xtitle='Date', ytitle='Time (ns)')
@LoopedBard3 LoopedBard3 added the enhancement New feature or request label Oct 22, 2024
@matouskozak
Copy link
Member

fyi: @radekdoulik

@caaavik-msft
Copy link
Contributor

Instead of updating the query in our autofiler code everytime, I'm working on a stored function for our Azure Data Explorer cluster that we can define this in instead. Here is the function I have defined as a work-in-progress so far and it is already available on our ADX to experiment with:

.create-or-alter function GetHistoricalDataWithComparisons(test: string, counter: string = "", repo: string = "", branch: string = "", after: datetime = datetime(null)) 
{
    let afterValue = iff(isnull(after), ago(60d), after);
    Measurements 
    | where repo == "" or BuildRepo == repo
    | where (branch == "" and (BuildBranch  == "refs/heads/main" or BuildBranch == "9.0")) or BuildBranch == branch
    | where TestName == test
    | where iff(counter == "", TestCounterTopCounter, TestCounterName == counter)
    | where BuildTimeStamp > afterValue
    | summarize arg_max(QualityLevel, *) by RunId, TestId
    | extend ConfigShort = strcat(
      iff(RunConfigurationsCompilationMode == "wasm", "-wasm", ""),
      iff(RunConfigurationsRunKind == "micro_mono", "-mono", ""),
      iff(RunConfigurationsExperimentName != "", strcat("-", RunConfigurationsExperimentName), ""),
      iff(RunConfigurationsPgoType != "", strcat("-", RunConfigurationsPgoType), ""),
      iff(RunConfigurationsHybridGlobalization != "", "-HybridGlobalization", ""),
      iff(RunConfigurationsR2RType != "", strcat("-", RunConfigurationsR2RType), ""),
      iff(tobool(RunConfigurationsAot) or tobool(RunConfigurationsMonoAot),"-AOT", ""),
      iff(tobool(RunConfigurationsMonoInterpreter),"-Interp", ""),
      iff(tostring(RunConfigurations["RuntimeType"]) != "", strcat("-", tostring(RunConfigurations["RuntimeType"])), ""),
      iff(tobool(RunConfigurations["iOSStripSymbols"]),"-iOSStripSymbols", ""),
      iff(tobool(RunConfigurationsLlvm) or tobool(RunConfigurationsIosLlvmBuild),"-LLVM", ""),
      iff(tobool(RunConfigurationsJsEngine),strcat("-", RunConfigurationsJsEngine), ""),
      iff(RunConfigurationsPhysicalPromotionType != "", strcat("-", RunConfigurationsPhysicalPromotionType), ""))
    | extend Series = strcat(FriendlyQueueName(RunQueue), iff(BuildArchitecture == "x86", "-x86", ""), ConfigShort)
}

Then an example usage of this which renders the chart would be

GetHistoricalDataWithComparisons(@'System.Memory.Span<Byte>.BinarySearch(Size: 512)', after=datetime(2024-08-22T09:01:51.8330745+00:00))
// | where RunConfigurationsRunKind == "micro_mono" or RunConfigurationsCompilationMode == "wasm"
| project BuildTimeStamp, Result=round(TestCounterResultAverage, 3), Series
| render timechart with (series=Series, xcolumn=BuildTimeStamp, ycolumns=Result, xtitle='Date', ytitle='Time (ns)')

So we would just generate this query inside our auto-filter instead of the full query.

What did we think of this approach? For most microbenchmarks this causes way too many series by default so need to decide what might be some sensible default filters to apply on top of the result from GetHistoricalDataWithComparisons.

@matouskozak
Copy link
Member

Instead of updating the query in our autofiler code everytime, I'm working on a stored function for our Azure Data Explorer cluster that we can define this in instead. Here is the function I have defined as a work-in-progress so far and it is already available on our ADX to experiment with:

.create-or-alter function GetHistoricalDataWithComparisons(test: string, counter: string = "", repo: string = "", branch: string = "", after: datetime = datetime(null))
{
let afterValue = iff(isnull(after), ago(60d), after);
Measurements
| where repo == "" or BuildRepo == repo
| where (branch == "" and (BuildBranch == "refs/heads/main" or BuildBranch == "9.0")) or BuildBranch == branch
| where TestName == test
| where iff(counter == "", TestCounterTopCounter, TestCounterName == counter)
| where BuildTimeStamp > afterValue
| summarize arg_max(QualityLevel, *) by RunId, TestId
| extend ConfigShort = strcat(
iff(RunConfigurationsCompilationMode == "wasm", "-wasm", ""),
iff(RunConfigurationsRunKind == "micro_mono", "-mono", ""),
iff(RunConfigurationsExperimentName != "", strcat("-", RunConfigurationsExperimentName), ""),
iff(RunConfigurationsPgoType != "", strcat("-", RunConfigurationsPgoType), ""),
iff(RunConfigurationsHybridGlobalization != "", "-HybridGlobalization", ""),
iff(RunConfigurationsR2RType != "", strcat("-", RunConfigurationsR2RType), ""),
iff(tobool(RunConfigurationsAot) or tobool(RunConfigurationsMonoAot),"-AOT", ""),
iff(tobool(RunConfigurationsMonoInterpreter),"-Interp", ""),
iff(tostring(RunConfigurations["RuntimeType"]) != "", strcat("-", tostring(RunConfigurations["RuntimeType"])), ""),
iff(tobool(RunConfigurations["iOSStripSymbols"]),"-iOSStripSymbols", ""),
iff(tobool(RunConfigurationsLlvm) or tobool(RunConfigurationsIosLlvmBuild),"-LLVM", ""),
iff(tobool(RunConfigurationsJsEngine),strcat("-", RunConfigurationsJsEngine), ""),
iff(RunConfigurationsPhysicalPromotionType != "", strcat("-", RunConfigurationsPhysicalPromotionType), ""))
| extend Series = strcat(FriendlyQueueName(RunQueue), iff(BuildArchitecture == "x86", "-x86", ""), ConfigShort)
}
Then an example usage of this which renders the chart would be

GetHistoricalDataWithComparisons(@'System.Memory.Span.BinarySearch(Size: 512)', after=datetime(2024-08-22T09:01:51.8330745+00:00))
// | where RunConfigurationsRunKind == "micro_mono" or RunConfigurationsCompilationMode == "wasm"
| project BuildTimeStamp, Result=round(TestCounterResultAverage, 3), Series
| render timechart with (series=Series, xcolumn=BuildTimeStamp, ycolumns=Result, xtitle='Date', ytitle='Time (ns)')
So we would just generate this query inside our auto-filter instead of the full query.

What did we think of this approach? For most microbenchmarks this causes way too many series by default so need to decide what might be some sensible default filters to apply on top of the result from GetHistoricalDataWithComparisons.

Looking good @caaavik-msft, thank you! I think for Mono, it is sensible to have | where RunConfigurationsRunKind == "micro_mono" or RunConfigurationsCompilationMode == "wasm" enabled by default. It would be nice to have e.g., one CoreCLR job included as well just for comparison between CoreCLR and Mono. However, if that would be too complicated, I think having Mono-only by default is good enough and if we need to, we can always comment it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants