Processors
Intel® Processors, Tools, and Utilities
14403 Discussions

Use case of VP2INTERSECT instructions.

guillermozo
Beginner
2,294 Views

I'm wondering what the intended use case for the AVX512-VP2INTERSECT instruction set is.

In particular, I wonder if the intended use case requires the calculation of both output masks, or if computing only one is sufficient in practice.

If we are given two arrays of integers, then computing their intersection (or only the size of the intersection) can be done using only one of the output masks returned by _mm512_2intersect_epi32. It seems to me this is true whether the input array is sorted (which would be the typical case since intersecting sorted vectors has linear time complexity) or unsorted.

In the case that only one output mask is computed, an emulation of the VP2INTERSECT instructions can be faster than the native instructions, as described here:

https://arxiv.org/abs/2112.06342

 

Of course I may be missing some important use case for which computing both output masks is necessary. I would like to ask what the intended use cases of VP2INTERSECT are, and whether the above fast emulation returning only the first output mask would be expected to cover most practical use cases.

 

Thank you. 

0 Kudos
6 Replies
Alberto_R_Intel
Moderator
2,279 Views

guillermozo, Thank you for posting in the Intel® Communities Support.


In reference to your inquiries, in order for us to provide the most accurate response on this scenario, first, we just wanted to confirm a few details:

What is the specific model of the Intel® processor you are referring to?

Is there any particular reason why you need that information?

Are you a developer?

Are you working on a project?

If that is the case, what is the project about?

Are you building, designing, or modifying hardware/software?

Are you working with a specific Intel® hardware/software platform?

Which Windows* version are you using?


Any questions, please let me know.


Regards,

Albert R.


Intel Customer Support Technician



0 Kudos
guillermozo
Beginner
2,270 Views

Hi Alberto, 

 

Thanks for your reply. 

> What is the specific model of the Intel® processor you are referring to?

I'm running tests on a i7-1165G7 Tiger Lake mobile cpu, but the question is about the AVX512-VP2INTERSECT instruction set in general. 

 

> Is there any particular reason why you need that information?

I'm the author of the preprint paper cited above. It started because I wanted to efficiently compute the intersection (common elements) between two vectors of sorted integers. I found I only needed one of the output masks, and with some work could make the emulated version faster than the native AVX512-VP2INTERSECT version. I thought this could be useful to others so I wrote it up. 

But I wanted to know whether this is the intended, or most common use of these instructions (note that if the vectors are not sorted you also only need the first mask returned by the AVX512-VP2INTERSECT instructions). If it is, then this could be useful for two reasons: 

1) developers can use the faster emulated version

2) Intel can either save the silicon space for VP2INTERSECT, or improve its microcode based on the above preprint. 

Also, since I will submit the above preprint to a journal, I wanted to get feedback from Intel, in case I am mistaken and I should revise the paper. 

 

> Are you a developer?

> Are you working on a project?

> If that is the case, what is the project about?

I'm a researcher in machine learning. Intersecting vectors of sorted integers is just something I find useful, but is not tied to any project. 

 

> Are you building, designing, or modifying hardware/software?

No. 

 

> Are you working with a specific Intel® hardware/software platform?

I'm running tests on a laptop with a i7-1165G7 cpu. 

 

> Which Windows* version are you using?

I'm using Ubuntu linux, latest stable version (20.04). 

 

 

Thank you for your help, 

 

Guille. 

0 Kudos
Alberto_R_Intel
Moderator
2,264 Views

Hi guillermozo, You are very welcome, thank you very much for letting us know that information.


We will do further research on this matter to try to provide the details you are looking for or to point you in the right direction to gather that information. As soon as I get any updates I will post all the details on this thread.


Regards,

Albert R.


Intel Customer Support Technician


0 Kudos
Alberto_R_Intel
Moderator
2,253 Views

Hello guillermozo, I just received an update on this matter.


Regarding this topic and in order to get the most detailed information about your questions, please visit, sign in and submit your inquiry in our Intel® Resource and Design Center website, they will further assist you in there:

https://www.intel.com/content/www/us/en/developer/get-help/overview.html#gs.lfzipf


Regards,

Albert R.


Intel Customer Support Technician


0 Kudos
guillermozo
Beginner
2,244 Views

Hi Albert, 

 

Thank your for researching this and for the information,

 

Guille. 

0 Kudos
Alberto_R_Intel
Moderator
2,242 Views

Hi guillermozo, Thank you very much for your response.


"Thank your for researching this and for the information,", You are very welcome, we are glad to help and we hope you can gather all the information that you are looking for.


Any other inquiries, do not hesitate to contact us again.


Regards,

Albert R.


Intel Customer Support Technician


0 Kudos
Reply