Quantcast
Channel: Intel® Software - Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all 3005 articles
Browse latest View live

LNK1104 'mkl_solver_lp64.lib' error

$
0
0

Hi everyone!!

I recently started using Parallel studio cluster edition on my windows 64 bit system. I am using visual studio 2015 edition for it. I am running already coded fortran console application using user provided library in resources. When i try to build the project, it gives me following error:

fatal error LNK1104: cannot open file 'mkl_solver_lp64.lib'

I tried the option to 'use Intel Math Kernel Library' but the error still remained.

Please help.Thanks

Zone: 

Thread Topic: 

Help Me

MKL library (Data Fitting Component)- substitute of P-chip function in MKL library

$
0
0

Dear Experts,

I want to implement the p-chip MATLAB function using the Intel MKL library. The details of the pchip function can be found at :https://in.mathworks.com/help/matlab/ref/pchip.html

I tried using the Hermite Cubic Spline but it returns zero values in the interpolated function. Why does it return zero values.

Can someone point to such an implementation, if you have tried previously ?

The Code 

// This is the main DLL file.

#include <algorithm>
#include <iostream>

#include "mkl_df.h"

#include "MKLWrapper64.h"
#include "Utils.h"

using namespace MKLWrapper64;

/// Performs interpolation of up to order 3,
/// with free-end boundary condition (i.e. second derivative of both ends = 0)
/// INPUT PARAMETER RESTRICTIONS:
/// --> x[] must be in ascending order
/// --> r[] must be of the format {lowerBound,upperBound} if isUniform
///            or contain outsize number of x-values if !isUniform
/// --> order should be within the range [1, 3]
/// OUTPUT PARAMETERS:
/// --> out[] contains output interpolated y-values
/// --> return int signifies no error (0) or error (non-zero status number)

int Interpolator::Interpolate(int nx, array<float>^ x, array<float>^ y,

    array<float>^ r, int outsize, array<float>^ out, int order, bool isUniform)
{
    int status;
    int ny = 1; // y-axis is 1 dimensional
    DFTaskPtr taskPtr;
    pin_ptr<float> xPtr = &x[0];
    pin_ptr<float> yPtr = &y[0];
    pin_ptr<float> interpolationRange = &r[0];

    // create new data fitting task
    status = dfsNewTask1D(&taskPtr, nx, xPtr, DF_UNIFORM_PARTITION, ny, yPtr, DF_NO_HINT);
    if (Utils::checkError(status, "dfsNewTask1D") != 0) return status;

    // specify type of spline
    int splineOrder;
    switch (order) {
    case 1:  splineOrder = DF_PP_LINEAR;    break;
    case 2:  splineOrder = DF_PP_QUADRATIC; break;
    case 3:  splineOrder = DF_PP_CUBIC;        break;
    default: splineOrder = DF_PP_CUBIC;        break;
    }

    int sorder = DF_PP_CUBIC;
    int stype = DF_PP_HERMITE;
    int bc_type = DF_BC_1ST_LEFT_DER | DF_BC_1ST_RIGHT_DER;
    int ic_type = DF_IC_1ST_DER;

    float* splineCoeff = new float[ny*splineOrder*(nx - 1)];
    status = dfsEditPPSpline1D(taskPtr, sorder, stype,
        bc_type, NULL, ic_type, NULL, splineCoeff, DF_NO_HINT);
    if (Utils::checkError(status, "dfsEditPPSpline1D") != 0) return status;

    // construct spline
    status = dfsConstruct1D(taskPtr, DF_PP_SPLINE, DF_METHOD_STD);
    if (Utils::checkError(status, "dfsConstruct1D") != 0) return status;

    // interpolate
    int intUniform = isUniform ? DF_UNIFORM_PARTITION : DF_NON_UNIFORM_PARTITION;
    MKL_INT evalOrder = DF_PP_STD + 1; // evaluate 0th derivative of spline (i.e. spline value itself)
    MKL_INT* dataOrder = new MKL_INT[outsize]; // instructs dfdInterpolate1D to evaluate 0th derivative at all points
    std::fill_n(dataOrder, outsize, evalOrder);
    float* resultArr = new float[outsize];
    status = dfsInterpolate1D(taskPtr, DF_INTERP, DF_METHOD_PP, outsize, interpolationRange,
        intUniform, evalOrder, dataOrder, nullptr, resultArr, DF_MATRIX_STORAGE_ROWS, NULL);
    if (Utils::checkError(status, "dfsInterpolate1D") != 0) return status;

    // delete data fitting task
    status = dfDeleteTask(&taskPtr);
    if (Utils::checkError(status, "dfDeleteTask") != 0) return status;

    for (int i = 0; i < outsize; i++)
        out[i] = resultArr[i];
    return 0;
}

Element-wise vector comparison

$
0
0

Hi,

I have a huge mxn matrix A where I need to compute A(i,j) > 0, ie. 1 for all values which are positive, and 0 otherwise

I would be better off writing it in C++, but let's assume I'm in a situation where I don't have admin rights and cannot install/compile anything. I'm using a single-threaded scripting language (VBA) to wrap calls to mkl_rt.dll, and any combination of MKL functions is still faster.

One way to solve this is to compute 1-0^(x+abs(x)), ie something like

    vdabs m*n, A(1, 1), temp(1, 1)
    vdadd m*n, A(1, 1), temp(1, 1), temp(1, 1)
    vdpow m*n, res(1, 1), temp(1, 1), res(1, 1)  /***** (res() is an array full of zeros)
    vdlinearfrac m*n, res(1, 1), res(1, 1), 0, -1, 0, 1, res(1, 1)

But the vdpow function is quite costly computation-wise (overall speed difference is ca x4 in favor of mkl, but I expect more from one single thread in VBA vs compiled multi-threaded code)

Another solution is to find the maximum value in the array, divide by max+1 to force all values into <-1, 1> and apply vdceil, <-1, 0] becomes 0, and <0, 1> becomes 1, but there can be some problems if the numbers are huge and end up as [-1, 1]

Can anyone think of a simpler way to do it?

Intel MKL ERROR: Parameter 12 was incorrect on entry to SGELSD

$
0
0

Hello all,

I encountered this error while I was trying to solve linear least square problem, ||Ax-b||. Trying to solve ([A](-1)b) to get x vector. MATLAB solves it like (A\b) and gives the correct answer.

I have properly followed the procedure given in 

https://software.intel.com/sites/products/documentation/doclib/mkl_sa/11/mkl_lapack_examples/dgelsd_ex.f.htm

But when I am trying to use this subroutine (SGELSD) with my matrix A and B, which are of size (135x135) and (135x6) respectively, it throws the above mentioned error. My A matrix is singular, as its determinant is zero.

Matlab solves these ||Ax-b||, and gives the correct answer, so A and B matrix are good. I am reading these two matrices (A and b) in my fortran code.

Sorry for such a long post!!!!!!!!!

Thanks
 

Zone: 

Thread Topic: 

Help Me

Giving version to MKL custom dll

$
0
0

Hi,

I created custom MKL dll for Windows and Mac, I need to give it a version , I guess it's something that should be done when building the dll i.e. by the builder tool. do you have any idea how I can do it ? 

Thanks

Incorrect Results from Feast Generalized Eigenvalue Solver

$
0
0

I am having a problem getting the correct results when solving a generalized eigenvalue problem of the form Ax=yBx. In my small test application the A and B matrices are both 3x3 real symmetric matrices. The dfeast_sygv​ solver returns only two eigenvalues between -10 and 10 of -1.313409 and 1.842060, both of which are wrong. I have also tested it using dfeast_scsrgv​ and get the same incorrect results. My test code is attached.

​The correct eigenvalues for my text case are -1.18725, -0.28274 and 1.711014. I have verified these using Matlab and also in Excel using the Matrix.xla routines. I have also checked that the equation Ax=yBx is satisfied using the returned eigenvalues and eigenvectors.

Interestingly, if I zero all the non-diagonal terms of the B matrix then dfeast_sygv​ returns the correct eigenvalues of -1.650985, 0.4497689 and 6.284550. This shows that the problem only occurs when there are non-zero terms away from the diagonal of the B matrix.

​Am I doing something that the Feast solver isn't meant for? I am using MKL v2017.2 with the latest 2017.2 Intel Fortran compiler in VS2015.
 

AttachmentSize
Downloadapplication/octet-streamEigenTest.for827 bytes

maximum no of threads from OMP and MKL

$
0
0

Some time ago I have already opened a similar problem in the premier support. The difference was between MKL and some OS subroutines.
​Now in the MKL documentation I can find:
​___________________________________________
mkl_get_max_threads
Gets the number of OpenMP* threads targeted for parallelism
____________________________________________________
The following piece of code:
​================================================
      NMAXTH = OMP_GET_MAX_THREADS()
!
      NPROC = OMP_GET_NUM_PROCS()
!
      ITH = OMP_GET_THREAD_NUM()
!
!     MX_THREADS = NMAXTH
      NMAXTH0 = NMAXTH
!
      NTMKL = MKL_GET_MAX_THREADS()
======================================================
gives:
NMAXTH​=8, NPROC = 8, NTMKL=4.
​The running workstation is: Intel Core i7-4810MQ CPU 2.80 Ghz.
​Running compiler:
Intel® Parallel Studio XE 2016 Update 4 Composer Edition for Fortran Windows* Integration for Microsoft Visual Studio* 2015, Version 16.0.0063.14, Copyright © 2002-2016 Intel Corporation. All rights reserved.
​Intel should clarify differences.

 

 

 

Thread Topic: 

Question

Implementing a convolutional neural network using MKL

$
0
0

Good evening,

After discovering that it is not possible to build MKL-DNN on Windows, I would like to know if there is an example code or some hints about implementing a convolutional neural network (CNN) using the primitives already implemented in the MKL library available with XE 2017 release 2?

Thanks in advance,

Jean Vezina

 


Wrong results from Pardiso solver with multi-threading

$
0
0

Hi,

I'm having problems with multi-threading in the Pardiso solver.

For a given sparse matrix (csr format in mat.txt) and right hand side (rhs.txt) I obtain a different and wrong solution with a number of threads equal or greater than 16.

I'm working on windows 7 and I'm compiling with the compiler C++ Visual Studio 2013 and the MKL 11.3 Update 4 (Intel Parallel Studio XE 2016 Update 4). I'm linking with the librairies: mkl_intel_lp64, mkl_intel_thread, mkl_core and libiomp5md.

Could you reproduce the problem? or is there a mistake in my Pardiso usage?

Attached please find my program (./test_mt.exe nb_threads).

Thanks in advance for your help.

Best regards.

 

AttachmentSize
Downloadapplication/x-7z-compressedProblem_Pardiso_MT.7z610.82 KB

could i incorporate the MKL's Pardiso into my software to be distributed for commercial pursose?

$
0
0

Hi,everyone,I have one question about the commercial licenses.

could i incorporate the MKL's Pardiso solver into my software product to be distributed at no cost for commercial pursose?

if i can not, how to get access to MKL's Pardiso ?

Zone: 

Redistributables for MKL, missing redist.txt?

$
0
0

Hi,

I have a paid copy of the Intel MKL, but not the Intel compiler. We use MKL to speed up processing in an application that we sell. I just installed version 2017 update 2. Unlike previous versions of MKL, I don't see any redist.txt file. Yet the license still refers to redist.txt as listing the files which can be redistributed.

Where did redist.txt go? How can I legally redistribute the MKL DLLs with our application if it's not there for me to verify that the files I distribute are legal?

Related question: the MKL libraries depend on libiomp5md.dll. We could include that DLL in our installer to make it available to the end customer. However, I notice that Intel provides an installer for compiler support libraries (ww_icl_redist_msi_2017.2.187.zip, which contains two .msi files). I think it would be better for me to include the Intel-created .msi files in my installer rather than install libiomp5md.dll myself. Is this legal? I think it should be, but since I don't actually have the Intel compiler I'm not sure about the legality of distributing and installing ww_icl_redist_msi_2017.2.187 on a customer computer.

Zone: 

Thread Topic: 

Question

Layout of structure dnnlayout_t in MKL DNN routines

$
0
0

Good evening, 

I am starting to use the Deep neural network routines in MKL. The definition of each node (weights, etc) is stored in a variable of type dnnlayout_t which is opaque. But, how I can save or load a trained network if I cannot extract the weights? So, I need the internal layout of that type or a way to access it.

Thanks in advance,

Jean

In the include file, the type is defined as following:

#if defined(__cplusplus_cli)
struct _uniPrimitive_s {};
struct _dnnLayout_s {};
#endif

typedef struct _uniPrimitive_s* dnnPrimitive_t;
typedef struct _dnnLayout_s* dnnLayout_t;
typedef void* dnnPrimitiveAttributes_t;

 

Beginner's guide to compile MKL in windows10 without a full VS2015 installation

$
0
0

I would like to share my experience compiling MKL in windows 10 without a full VS2015 installation. Hopefully this will save some unnecessary trial and error efforts. Since I was doing it on my Intel laptop, which has a very precious and limited SSD space (unless you charge your department for an SSD upgrade), I cannot afford (>16GB) full VS2015 installation on my precious SSD.

Here are the steps:

1. You can get a full-fledge (>16GB installation) VS2015 from ISM (Intel Software Market). But I opted for visualcppbuildtools_full.exe from http://landinghub.visualstudio.com/visual-cpp-build-tools. Download and install it (You can skip the windows SDK to save disk space)

2. Download and install MKL from https://software.intel.com/en-us/intel-mkl

3. Assuming that no1 and no2 are installed to the default target directory. Edit "compilervar_arch.bat" in the following path: C:\IntelSWTools\compilers_and_libraries_2017.2.187\windows\bin\compilervars_arch.bat

(ie. comment out the existence check for devenv.exe, which I don't have without a full VS2015 installation; Left is the edit, right is the original file)

Now we are ready to play with some examples provided in the MKL installation: C:\IntelSWTools\compilers_and_libraries_2017.2.187\windows\mkl\examples

I would recommend unzipping it out and copying a small examples to your "My Documents" area

Let me walk you with one simple example. I will show you 3 ways of compiling it. Let's try out examples_core_c\cblas\. Copy out data\cblas_sgemm_batchx.d, source\cblas_sgemm_batchx.c, source\common_func.c, source\mkl_example.h, cblas.lst, makefile. Please maintain the same directory structure as in the example folder:

.\
|-- cblas.lst
|-- data
|   `-- cblas_sgemm_batchx.d
|-- makefile
|-- source
|   |-- cblas_sgemm_batchx.c
|   |-- common_func.c
|   `-- mkl_example.h

Open up a windows console: windows-R: cmd, cd into the folder you copied over that example, ie. when you dir, you should see makefile, cblas.lst, data, source. Then type the following:

(I have a 64bit windows10 hp laptop, which is a quite generic IntelIT laptop for every employee, hence the "intel64" at the end of the following line)

>call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.2.187\windows\bin\compilervars.bat" intel64

This command will setup your environment variables. This will also call "compilervars_arch.bat", that in turn calls "vcvarsall.bat" (the VS2015 env var setup)

These are the 3 ways to compile:

1. Using nmake from VS2015, since the MKL example provides us a "makefile". I don't have icc on my machine, so I will just use cl.exe from VS2015

>nmake libintel64 function=cblas_sgemm_batch+ compiler=msvs /f makefile

The exe in under _results\ folder. Run this to checkout the exe

>_results\msvs_lp64_parallel_intel64_lib\cblas_sgemm_batchx.exe data\cblas_sgemm_batchx.d

2. Directly invoking cl.exe

>cl.exe /w /MT /Femy_cl /IC:\Users\hpandana\myhomedir\mkl_test\my_cl\source source\common_func.c source\cblas_sgemm_batchx.c mkl_core.lib mkl_intel_lp64.lib mkl_intel_thread.lib libiomp5md.lib

(some explanations: /Fe specifies my output exe filename, eg. my_cl.exe in this example; I copied over that example to this path: C:\Users\hpandana\myhomedir\mkl_test\my_cl, so please edit your /I include path accordingly. This method does not require "makefile", and its supporting "cblas.lst" file)

C:\Users\hpandana\myhomedir\mkl_test\my_cl\
|-- data
|   `-- cblas_sgemm_batchx.d
`-- source
    |-- cblas_sgemm_batchx.c
    |-- common_func.c
    `-- mkl_example.h

Just like before, to try out the exe:

>my_cl.exe data\cblas_sgemm_batchx.d

3. Using gcc. I have the strawberry perl (from ISM) installed, that comes with gcc. Any mingw gcc should work as well. Again it is installed at the default target directory (ie. C:\strawberry). I copied over the example again:

C:\Users\hpandana\myhomedir\mkl_test\my_gcc\
|-- data
|   `-- cblas_sgemm_batchx.d
`-- source
    |-- cblas_sgemm_batchx.c
    |-- common_func.c
    `-- mkl_example.h

(please edit the -I include paths, and -L libpaths in the following line accordingly)

>gcc.exe -o my_gcc -IC:\strawberry\c\include -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.2.187\windows\mkl\include" -IC:\Users\hpandana\myhomedir\mkl_test\my_cl\source -LC:\strawberry\c\lib -LC:\strawberry\c\lib\gcc\x86_64-w64-mingw32\4.7.3 -L"C:\IntelSWTools\compilers_and_libraries_2017.2.187\windows\redist\intel64_win\mkl" -L"C:\IntelSWTools\compilers_and_libraries_2017.2.187\windows\redist\intel64_win\compiler" source\common_func.c source\cblas_sgemm_batchx.c -lmkl_core -lmkl_rt -lmkl_intel_thread -liomp5md

Again, to try out the exe:

>my_gcc.exe data\cblas_sgemm_batchx.d

That's all. Hope it helps

 

Thanks,
Herman

Thread Topic: 

How-To

MKL Lapack parallel subroutine

$
0
0

Hello all

I am using the lapack subroutine 'dgelsd' in order to calculate the linear least square solution of (||Ax-b||) system. For that I have used Intel MKL Parallel library. When I run my code I can see that only 57% of the total CPU is used. Also setting the number of threads for MKL also has no effect. For that I used

call mkl_set_num_threads( 32 )

I am working on the workstation, whose specs are given below:

Intel(R) Xeon(R) CPU E5-2620 v4@ 2.10 GHz, Cores = 16, Logical processors = 32, Windows 10 Pro, 64-bit Operating system, x64-based processor.

Please suggest me how i can make use of available processing capacity. Presently my code is taking so much time to give results and its main computational part is calling DGELSD (where it is spending most of its time to give least square solution).

Thanks

Zone: 

Thread Topic: 

Help Me

Visual Studio 2017 support for MKL? Update 3 timeline?

$
0
0

Hello,

Is it correct that the latest MKL Update 2 doesn't support MSVS 2017 yet? If so, is there any time estimate for when this might become available? Is it planned for an Update 3 or earlier/later or unknown at this point?

I think that many MKL users (companies), including myself, are holding the upgrade to VS2017 b/c of the MKL :)

Thanks, Oleg

Zone: 


jit_gemm_convolution bwd data is too slow

$
0
0

Hi, I encountered a performance issue on jit_gemm_convolution, I have one convolution primitive whose input is: stride_w = 2 and jcp.t_pad = 3, so it can not go through avx512 or avx2 path, it go to jit_gemm_convolution path, however, our workload is dealing with small batch with large input, suppose it is 2*3*2240*2240, batch size = 2 on googlenet v1, running on xeon phi(68 cores). In jit_gemm_convolution bwd data execute, it will seperate it as 2 thread, each thread dealing with one batch(3*2240*2240). so it is very slow(sgemm and col2img are running on two cores). other 66 cores are running with no thread.So how can I solve it? or how can I make it running on avx512/avx2 path? thanks.  

Zone: 

No AVX-512 support?

$
0
0

It seems that MKL fails to use AVX-512 ISA on my system:

OS: CentOS 7 with Kernel 4.10
CPU (from /proc/cpuinfo): Intel(R) Xeon Phi(TM) CPU 7250 @ 1.40GHz with 272 logic processors

$ ./mkl_get_version
Major version:           2017
Minor version:           0
Update version:          2
Product status:          Product
Build:                   20170126
Platform:                Intel(R) 64 architecture
Processor optimization:  Intel(R) Advanced Vector Extensions 512 (Intel(R) AVX-512) for Intel(R) Many Integrated Core Architecture (Intel(R) MIC Architecture) enabled processors
=============================================================

$ ./mkl_enable_avx2
$ ./mkl_enable_avx512
mkl_enable_avx512: mkl_enable_avx512.c:7: int main(): Assertion `MKL_Enable_Instructions(4) == 1' failed.
Aborted
$

What is missing to use AVX-512 ISA?

Thank you in advance!

For the sake of completeness, here are the source code of the above programs:

$ cat ./mkl_get_version.c
#include
#include
#include "mkl.h"
int main(void)
  {
    MKLVersion Version;
    mkl_get_version(&Version);
    printf("Major version:           %d\n",Version.MajorVersion);
    printf("Minor version:           %d\n",Version.MinorVersion);
    printf("Update version:          %d\n",Version.UpdateVersion);
    printf("Product status:          %s\n",Version.ProductStatus);
    printf("Build:                   %s\n",Version.Build);
    printf("Platform:                %s\n",Version.Platform);
    printf("Processor optimization:  %s\n",Version.Processor);
    printf("=============================================================\n");
    printf("\n");
    return 0;
}
$ cat ./mkl_enable_avx2.c
#include

#include

int main()
{
    assert(mkl_enable_instructions(MKL_ENABLE_AVX2) == 1);
    return 0;
}
$ cat ./mkl_enable_avx512.c
#include

#include

int main()
{
    assert(mkl_enable_instructions(MKL_ENABLE_AVX512) == 1);
    return 0;
}

Thread Topic: 

Bug Report

Size problem using zgeqrf and zunmqr

$
0
0

Hello,

After using zgeqrf to compute the QR factorization of an m by n matrix, I want to multiply Q by another matrix C (k by k with k<m) with zunmqr.

My problem is that the result of the multiplication overwrites the matrix C, which size is smaller than the expected result.

I expect to get an m by k matrix, but C is only allocated for a k by k size.

Is there a way to directly compute the product into another allocated matrix with the proper size, or is the only solution to first compute the matrix Q and then multiply with zgemm ?

Thanks a lot in advance for your response.

Pierre

Cluster vs. Pardiso solver .net wrappers

$
0
0

I want to compare the solvers, but only one difference I saw between the cluster and Pardiso routines, which is comm parameter INTEGER MPI communicator. I was wondering how to wrap it to .net C# as in Pardiso solver that Intel provide.

Best

Cluster vs. Pardiso

Viewing all 3005 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>