Intel® High Level Design
Support for Intel® High Level Synthesis Compiler, DSP Builder, OneAPI for Intel® FPGAs, Intel® FPGA SDK for OpenCL™
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
593 Discussions

QRD and QRI to solve LLS problem with oneMKL LAPACK gels or gelsy?

hoemin
Beginner
711 Views

Dear Sir/Madam,

 

I am an Intel DevCloud user base on oneAPI and DPC++FPGA.

 

The task is to take the Ground-Base TEM (Transient ElectroMagnetic) data in Universal Sounding Format (USF) for geophysical groundwater investigations to convert to matrices (if required) and process with qrd and qri from oneapi-src/oneAPI-samples/ DirectProgramming/ DPC++FPGA/ ReferenceDesigns to solve the Linear Least Square (LLS) problem.

 

Since unable to find any reference design for LLS for DPC++FPGA, would presume to take the above outputs to solve with LLS  LAPACK Driver Routines, but not sue to use gels or gelsy?

 

Any help that you could provide will be most appreciated.

 

Thanks. Best Regards

Min HOE

0 Kudos
11 Replies
aikeu
Employee
672 Views

Hi hoemin,


I will get back to your when I have relevant info to your question.


Thanks.

Regards,

Aik Eu


hoemin
Beginner
665 Views

Thanks, Aik Eu. Look forward to hear from you soon.

 

Best Regards
Hoe Min 

aikeu
Employee
615 Views

Hi hoemin,


I have sent you an email regarding the info I get from my team.


Thanks.

Regards,

Aik Eu


aikeu
Employee
604 Views

Hi hoemin,


I will close this thread if no further question.


Thanks.

Regards,

Aik Eu


hoemin
Beginner
597 Views

Dear Aik Eu, 

I will work on it on this weekend and get back to you for any issue. 

Thanks for your help.

Best Regards

Hoe Min 

 

 

aikeu
Employee
556 Views

Hi hoemin,


Any update from the previous comment?


Thanks.

Regards,

Aik Eu


hoemin
Beginner
548 Views

Dear Aik Eu, 

I had already replied you on 16th May, 2022, see copy below. Thanks and Best Regards Hoe Min

From: hm3_KL <hm3_KL@student.wou.edu.my>
Sent: 16 May 2022 16:40
To: Intel Customer Support <supportreplies@intel.com>
Subject: Re: QRD and QRI to solve LLS problem with oneMKL LAPACK gels or gelsy?
 

Dear Aik Eu, 

I fully agree with one of your respective team member recommendation to use the existing QRD from FPGA code samples especially this project continues to make use of Direct Programming DPC++FPGA and that is my main objective.

As I am just a beginner in using FPGA, there are many areas not well understood and much to learn.  Appreciate your team member(s) to enlighten me on the followings:

1) The TEM data in USF format are attached.  The attached zip file consists of 3 sets of data (K004 to K006) both in raw.usf and stcked.usf formats were taken from TEM Instrument and already converted to raw and stack data in USF formats. 

 

2) Presume these USF data can be converted/read/imported directly into QRD of the FPGA code sample?  Please provide example or sample code for me to convert/read/import in to QRD. By doing so am I able to get the 

 

 

-matrix and 

 

 

-vector in order for me to implement 1. perform QRD on 

 

 

-matrix to generate 

 

 

 using the library in code samples, kindly advise the name of the code sample in the library. 

 

3) After successfully implemented above steps, I then continue to implement 2.Calculate  

 

 

 using matrix-vector product (this is very trivial) and 3. Back-substitute to solve 

 

 

(this is also very trivial).

Thank you very much for your help. 

Best Regards
Hoe Min



From: Intel Customer Support <supportreplies@intel.com>
Sent: 10 May 2022 09:32
To: hm3_KL <hm3_KL@student.wou.edu.my>
Subject: QRD and QRI to solve LLS problem with oneMKL LAPACK gels or gelsy?
 
Hi hoemin,

I obtained the following info as below:
"
According to one of the repective team member, It is much better performance by using the existing QRD from the FPGA code samples than by trying to use the MKL libraries which are not optimized for FPGA.

 
Linear Least Squares is used to solve coefficients 
 

 

 

 

 

 

, … 
 

 

for a system of linear equations when you know 
 

 

 

 

 

 

 

 

 and have measured ordered pairs 
 

 

 

 

 

 

… 
 

 

.
 
 

 


 

 


 

 


 

 


 

 


 
You can model this as a matrix equation like this:
 

 


Where 
 

 

is a matrix 
 

 

 

 

is a vector 
 

 

 

 

 

 

, … 
 

 

and 
 

 

is a vector 
 

 

.
 
 
If you factor 
 

 

with QRD, you get 
 

 

, and can find 
 

 

. Since 
 

 

is rectangular (
 

 

), the resulting 
 

 

- matrix will be made of an 
 

 

upper-triangular matrix 
 

 

, and a 
 

 

matrix of 0s. then we can split the vector 
 

 

into an n-element vector 
 

 

and an 
 

 

element vector 
 

 

:
 

 


 
We can find a solution for 
 

 

by solving 
 

 

; we can solve for 
 

 

using back-substitution since 
 

 

is upper-triangular.
 
Therefore, to implement a LLS given an existing QRD when the 
 

 

-matrix and 
 

 

-vector are known, I think you will need to
  1. Perform QRD on 
     

     

    -matrix to generate 
     

     

    using the library in code samples
  2. Calculate  
     

     

     using matrix-vector product (this is very trivial)
  3. Back-substitute to solve 
     

     

    (this is also very trivial)
"

Thanks.
Regards,
Aik Eu
 

 



ref:_00DU0YT3c._5004UxX9Ie:ref
hoemin
Beginner
520 Views

Dear Aik Eu, 

I am not sure you have received my reply on May 16, 2022 as I received undeliverable message on May 19, therefore attached here again the pdf version of the followings:


1) Email - hm3_KL - Outlook (Reply sent on 16 May 2022) with USF Format zipped file

2) Email - hm3_KL - Outlook (Undeliverable message received on 19 May 22).

Please confirm receipt.

Look forward to your early reply.

Thanks.

Best Regards
Hoe Min

 

 

aikeu
Employee
513 Views

Hi hoemin,


I get your reply. I was trying to ask about the info to your question.

I am not able to be certain that there will be answer to your latest questions.


Thanks.

Regards,

Aik Eu


aikeu
Employee
501 Views

Hi hoemin,


I get the below respond from the team:


The QRD Code sample is here: https://github.com/oneapi-src/oneAPI-samples/tree/master/DirectProgramming/DPC%2B%2BFPGA/ReferenceDesigns/qrd

 

Unfortunately, we do not have a code sample for reading from USF. Those USF files are simply comma-separated text files, so user can either find a library or make one themselves.


Thanks.

Regards,

Aik Eu


aikeu
Employee
482 Views

Hi hoemin,,


I will close this thread if no further question.


Thanks.

Regards,

Aik Eu


Reply