This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Size of vectors in SVE2

Hello,

I want to use the SVE2 instruction set. To this end, I have created a VM in a known cloud provider based on armv9 architecture which supports SVE2 instruction set.

I want to ask the following:

1) How can I determine the size of the vectors? The only way that I am aware of is by executing the following asm code:

rdvl            x9, #1
cmp             x9, #16
bgt             .label1

And branch based on the VL number. Is there any other command in the operating system level?

2) How can I change the size of the vectors? Currently, I can see that the size in my VM is 128 bits (using the aforementioned asm code). Is there a way to increase this value (provided that the underlying processor supports it)? For example, a command in the operating system level?

3) I want to have vectors whose size is bigger than 128 bits. Is a processor that supports this enough or do I need anything else (for example a specific version of a specific operating system, specific gcc, and so on)?

4) Do you know a cloud provider which supports armv9 VMs with vector size bigger than 128 bits?

Thank you in advance,

Akis

Parents
  • Hi Akis,

    You're right, it seems like you would need SVE2 for your workload
    unfortunately. You are also correct that the performance at a vector length of
    128-bits is likely to be roughly the same as the Neon performance unless you
    are able to take advantage of instructions only present in SVE or SVE2 such as
    unpacked load/stores, predication, or gather/scatter instructions.

    If your motivation for using other machines with different vector lengths is to
    test correctness of your SVE2 code, there are a few different options available
    to you.

    The open-source QEMU emulator supports SVE2 at any vector length, you should be
    able to run your program as such:

    qemu-aarch64 -cpu max,sve-max-vq=[1-16] ./a.out

    Where 1-16 specifies the number of 128-bit segments in your vector, such that
    e.g. 1 = 128-bits, 4 = 512-bits, etc).

    Arm also maintains Arm Instruction Emulator, which you can find documentation
    for here: https://developer.arm.com/documentation/102190/22-0/?lang=en

    Once installed you should just be able to run your binaries as normal using a
    command such as:

    armie -msve-vector-bits=[128-2048] ./a.out

    Hope that helps!

    Thanks,
    George

Reply
  • Hi Akis,

    You're right, it seems like you would need SVE2 for your workload
    unfortunately. You are also correct that the performance at a vector length of
    128-bits is likely to be roughly the same as the Neon performance unless you
    are able to take advantage of instructions only present in SVE or SVE2 such as
    unpacked load/stores, predication, or gather/scatter instructions.

    If your motivation for using other machines with different vector lengths is to
    test correctness of your SVE2 code, there are a few different options available
    to you.

    The open-source QEMU emulator supports SVE2 at any vector length, you should be
    able to run your program as such:

    qemu-aarch64 -cpu max,sve-max-vq=[1-16] ./a.out

    Where 1-16 specifies the number of 128-bit segments in your vector, such that
    e.g. 1 = 128-bits, 4 = 512-bits, etc).

    Arm also maintains Arm Instruction Emulator, which you can find documentation
    for here: https://developer.arm.com/documentation/102190/22-0/?lang=en

    Once installed you should just be able to run your binaries as normal using a
    command such as:

    armie -msve-vector-bits=[128-2048] ./a.out

    Hope that helps!

    Thanks,
    George

Children
  • Hi George,

    thanks for your answer. I am after a real platform on which I can test and benchmark my code. The qemu and ARM emulator approaches seem quite interesting, but as you said, it is only for development purposes. I will try to use them and come back to you if I face any problem.

    Is there a commercial platform that I can buy which supports SVE2 with vector sizes greater than 128 bits? It seems that neither raspberry nor macbooks is such a platform.

    Thanks!

    Akis

  • Hi Akis,

    Sure, let me know if you run into any problems using the tools and I will try
    and help if possible!

    Unfortunately I am not aware of any platforms currently available that support
    SVE2 at vector lengths greater than 128-bits.

    Thanks,
    George