Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if /i [%1] == [--azureBuild] (
) else goto :Usage

:Usage
echo "Usage: build.cmd [--configuration <Configuration>] [--runTests] [--includeExtendedTests] [--buildDotNetBridgeOnly] [--skipDotNetBridge] [--azureBuild]"
echo "Usage: build.cmd [--configuration <Configuration>] [--runTests] [--installPythonPackages] [--includeExtendedTests] [--buildDotNetBridgeOnly] [--skipDotNetBridge] [--azureBuild]"
echo ""
echo "Options:"
echo " --configuration <Configuration> Build Configuration (DbgWinPy3.7,DbgWinPy3.6,DbgWinPy3.5,DbgWinPy2.7,RlsWinPy3.7,RlsWinPy3.6,RlsWinPy3.5,RlsWinPy2.7)"
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mkdir -p "${DependenciesDir}"

usage()
{
echo "Usage: $0 --configuration <Configuration> [--runTests] [--includeExtendedTests]"
echo "Usage: $0 --configuration <Configuration> [--runTests] [--includeExtendedTests] [--installPythonPackages]"
echo ""
echo "Options:"
echo " --configuration <Configuration> Build Configuration (DbgLinPy3.7,DbgLinPy3.6,DbgLinPy3.5,DbgLinPy2.7,RlsLinPy3.7,RlsLinPy3.6,RlsLinPy3.5,RlsLinPy2.7,DbgMacPy3.7,DbgMacPy3.6,DbgMacPy3.5,DbgMacPy2.7,RlsMacPy3.7,RlsMacPy3.6,RlsMacPy3.5,RlsMacPy2.7)"
Expand Down
4 changes: 4 additions & 0 deletions src/DotNetBridge/Bridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ private struct EnvironmentBlock
// Call back to provide cancel flag.
[FieldOffset(0x28)]
public readonly void* checkCancel;

// Path to python executable.
[FieldOffset(0x30)]
public readonly sbyte* pythonPath;
#pragma warning restore 649 // never assigned
}

Expand Down
2 changes: 1 addition & 1 deletion src/DotNetBridge/DotNetBridge.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<PackageReference Include="Microsoft.ML.Dnn" Version="0.15.1" />
<PackageReference Include="Microsoft.ML.Ensemble" Version="0.15.1" />
<PackageReference Include="Microsoft.ML.TimeSeries" Version="1.3.1" />
<PackageReference Include="Microsoft.DataPrep" Version="0.0.1.5-preview" />
<PackageReference Include="Microsoft.DataPrep" Version="0.0.1.12-preview" />
<PackageReference Include="TensorFlow.NET" Version="0.10.10" />
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="1.14.0" />
</ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/DotNetBridge/RunGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,11 @@ private static void RunGraphCore(EnvironmentBlock* penv, IHostEnvironment env, s
var extension = Path.GetExtension(path);
if (extension == ".txt")
dv = TextLoader.LoadFile(host, new TextLoader.Options(), new MultiFileSource(path));
else if(extension == ".dprep")
else if (extension == ".dprep")
{
DPrepSettings.Instance.PythonPath = BytesToString(penv->pythonPath);
dv = DataFlow.FromDPrepFile(path).ToDataView();
}
else
dv = new BinaryLoader(host, new BinaryLoader.Arguments(), path);
}
Expand Down
3 changes: 2 additions & 1 deletion src/NativeBridge/ManagedInterop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ EnvironmentBlock::~EnvironmentBlock()
FillDead(_vset[i]);
}

EnvironmentBlock::EnvironmentBlock(int verbosity, int maxThreadsAllowed, int seed)
EnvironmentBlock::EnvironmentBlock(int verbosity, int maxThreadsAllowed, int seed, const char* pythonPath)
{
// Assert that this class doesn't have a vtable.
assert(offsetof(EnvironmentBlock, verbosity) == 0);
Expand All @@ -86,6 +86,7 @@ EnvironmentBlock::EnvironmentBlock(int verbosity, int maxThreadsAllowed, int see
this->verbosity = verbosity;
this->maxThreadsAllowed = maxThreadsAllowed;
this->seed = seed;
this->pythonPath = pythonPath;
this->_kindMask = (1 << Warning) | (1 << Error);
if (verbosity > 0)
this->_kindMask |= (1 << Info);
Expand Down
5 changes: 4 additions & 1 deletion src/NativeBridge/ManagedInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ class CLASS_ALIGN EnvironmentBlock
// Check cancellation flag.
CHECKCANCEL checkCancel;

// Path to python executable
const char* pythonPath;

public:
EnvironmentBlock(int verbosity = 0, int maxThreadsAllowed = 0, int seed = 42);
EnvironmentBlock(int verbosity = 0, int maxThreadsAllowed = 0, int seed = 42, const char* pythonPath = NULL);
~EnvironmentBlock();
PyErrorCode GetErrorCode() { return _errCode; }
std::string GetErrorMessage() { return _errMessage; }
Expand Down
11 changes: 7 additions & 4 deletions src/NativeBridge/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define PARAM_MLNET_PATH "mlnetPath"
#define PARAM_DOTNETCLR_PATH "dotnetClrPath"
#define PARAM_DPREP_PATH "dprepPath"
#define PARAM_PYTHON_PATH "pythonPath"
#define PARAM_DATA "data"


Expand Down Expand Up @@ -74,13 +75,15 @@ bp::dict pxCall(bp::dict& params)
bp::extract<std::string> mlnetPath(params[PARAM_MLNET_PATH]);
bp::extract<std::string> dotnetClrPath(params[PARAM_DOTNETCLR_PATH]);
bp::extract<std::string> dprepPath(params[PARAM_DPREP_PATH]);
bp::extract<std::int32_t> verbose(params[PARAM_VERBOSE]);
bp::extract<std::string> pythonPath(params[PARAM_PYTHON_PATH]);
bp::extract<std::int32_t> verbose(params[PARAM_VERBOSE]);
std::int32_t i_verbose = std::int32_t(verbose);
std::string s_mlnetPath = std::string(mlnetPath);
std::string s_dotnetClrPath = std::string(dotnetClrPath);
std::string s_dprepPath = std::string(dprepPath);
std::string s_graph = std::string(graph);
const char *mlnetpath = s_mlnetPath.c_str();
std::string s_pythonPath = std::string(pythonPath);
std::string s_graph = std::string(graph);
const char *mlnetpath = s_mlnetPath.c_str();
const char *coreclrpath = s_dotnetClrPath.c_str();
const char *dpreppath = s_dprepPath.c_str();

Expand All @@ -93,7 +96,7 @@ bp::dict pxCall(bp::dict& params)
if (params.has_key(PARAM_SEED))
seed = bp::extract<int>(params[PARAM_SEED]);

EnvironmentBlock env(i_verbose, 0, seed);
EnvironmentBlock env(i_verbose, 0, seed, s_pythonPath.c_str());
int retCode;
if (params.has_key(PARAM_DATA) && bp::extract<bp::dict>(params[PARAM_DATA]).check())
{
Expand Down
2 changes: 1 addition & 1 deletion src/Platforms/build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PackageReference Include="Microsoft.ML.Dnn" Version="0.15.1" />
<PackageReference Include="Microsoft.ML.Ensemble" Version="0.15.1" />
<PackageReference Include="Microsoft.ML.TimeSeries" Version="1.3.1" />
<PackageReference Include="Microsoft.DataPrep" Version="0.0.1.5-preview" />
<PackageReference Include="Microsoft.DataPrep" Version="0.0.1.12-preview" />
<PackageReference Include="TensorFlow.NET" Version="0.10.10" />
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="1.14.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/python/nimbusml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Microsoft Machine Learning for Python
"""

__version__ = '1.3.0'
__version__ = '1.3.1'

# CoreCLR version of MicrosoftML is built on Windows.
# But file permissions are not preserved when it's copied to Linux.
Expand Down
2 changes: 2 additions & 0 deletions src/python/nimbusml/internal/utils/entrypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
definition of classes for the entities in the entrypoint manifest.json
"""
import sys
import functools
import json
import os
Expand Down Expand Up @@ -450,6 +451,7 @@ def remove_multi_level_index(c):
call_parameters['dotnetClrPath'] = try_set(get_clr_path(), False, str)
call_parameters['mlnetPath'] = try_set(get_mlnet_path(), False, str)
call_parameters['dprepPath'] = try_set(get_dprep_path(), False, str)
call_parameters['pythonPath'] = try_set(sys.executable, False, str)

if random_state:
call_parameters['seed'] = try_set(random_state, False, six.integer_types)
Expand Down
2 changes: 1 addition & 1 deletion src/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# Versions should comply with PEP440. For a discussion on
# single-sourcing the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='1.3.0',
version='1.3.1',

description='NimbusML',
long_description=long_description,
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.3.1