Skip to content

Support running benchmarks on netfx #2157

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 5 commits into from
Jan 22, 2019
Merged

Support running benchmarks on netfx #2157

merged 5 commits into from
Jan 22, 2019

Conversation

Anipik
Copy link
Contributor

@Anipik Anipik commented Jan 16, 2019

Fixes #1945

This PR makes changes in order to enable developers to run ML benchmarks against .NetFramework

@eerhardt
Copy link
Member

using System.Collections.Generic;

Can you add a copyright header while you are in here?


Refers to: test/Microsoft.ML.Benchmarks/Harness/Configs.cs:1 in 42b36d7. [](commit_id = 42b36d7, deletion_comment = False)

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

@Anipik I am very happy that you got it working with so few changes! Great job!

I left some comments, mostly nits.

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

@Anipik LGTM!

@@ -85,7 +85,7 @@ public void SetupScoringSpeedTests()
if (!File.Exists(_mslrWeb10k_Train))
throw new FileNotFoundException(string.Format(Errors.DatasetNotFound, _mslrWeb10k_Train));

_modelPath_MSLR = Path.Combine(Directory.GetCurrentDirectory(), @"FastTreeRankingModel.zip");
_modelPath_MSLR = Path.Combine(Path.GetDirectoryName(typeof(RankingTest).Assembly.Location), "FastTreeRankingModel.zip");
Copy link
Member

Choose a reason for hiding this comment

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

Why is this change necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

otherwise on .netfx it creates this new model file in the root directory

Copy link
Member

Choose a reason for hiding this comment

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

This confuses me. What do you mean by "the root directory"? Why would the current netfx have its current directory set to that?

also, the code is still using Directory.GetCurrentDirectory() in Test_Multiclass_WikiDetox_BigramsAndTrichar_OVAAveragedPerceptron. WHy doesn't that need to change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By root directory I mean C:\git\Mlnet\test\Microsoft.ML.Benchmarks

Yes, I missed that we need to change Test_Multiclass_WikiDetox_BigramsAndTrichar_OVAAveragedPerceptron

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why would the current netfx have its current directory set to that?

I don't have nay concrete explaination for why it is setting current directory to C:\git\Mlnet\test\Microsoft.ML.Benchmarks

Copy link
Member

Choose a reason for hiding this comment

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

@adamsitnik - do you happen to know? Is this something BenchmarkDotNet is controlling?

Copy link
Member

Choose a reason for hiding this comment

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

@eerhardt Yes BDN sets the working directory to the folder with built dlls for .NET Core and to null for FX. The problem is that I dont remember why and I would prefer not to change it if I dont have to ;) It most probably has to deal with the fact that we run executable for FX and do dotnet name.dll for Core

https://github.com/dotnet/BenchmarkDotNet/blob/573566b70f0ff27572b9268002fe9748be4de6ea/src/BenchmarkDotNet/Toolchains/DotNetCli/DotNetCliExecutor.cs#L72

https://github.com/dotnet/BenchmarkDotNet/blob/573566b70f0ff27572b9268002fe9748be4de6ea/src/BenchmarkDotNet/Toolchains/Executor.cs#L35

@Anipik
Copy link
Contributor Author

Anipik commented Jan 22, 2019

@eerhardt is there anything else that needs to be done here ?

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

:shipit:

@Anipik Anipik merged commit f8b2f39 into dotnet:master Jan 22, 2019
@Anipik Anipik deleted the benchmarknetfx branch January 22, 2019 19:46
@@ -34,7 +34,7 @@ public abstract partial class BaseTestBaseline : BaseTestClass

protected BaseTestBaseline(ITestOutputHelper output) : base(output)
{
#if NET462
#if NET461
Copy link
Member

Choose a reason for hiding this comment

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

NOTE: I just learned about VersionlessImplicitFrameworkDefine in the .NET Core SDK - dotnet/sdk#2073. It appears this can be changed to #if NETFRAMEWORK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add this change in my next PR

@ghost ghost locked as resolved and limited conversation to collaborators Mar 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants