All things Linux

Risky64
Risky64
Joined: 1 Feb 25
Posts: 30
Credit: 87589
RAC: 3777

Tom M schrieb: Risky64

Tom M wrote:

Risky64 wrote:

What about using sse3 or SSE4_2 ?  Every new intel, and AMD CPU has it.

Two questions.

1) If a CPU doesn't have those does the task fail soft or die with a computation error?

2) What software development brings the most benefit to the project? And the related question what software can enjoy the widest use by volunteers?

All that said, the anonymous platform allows individuals, teams and groups to write code to solve the same task as the baseline programs, that may run faster or use less resources.

I am aware of such efforts and use them.

1) It will die with an error, but only on CPU, which do not have those extentions. Most new CPU have those. 

2) I do not understand your questions. Here are many user without gpu, who would benefit from any new code.

Keith Myers
Keith Myers
Joined: 11 Feb 11
Posts: 5063
Credit: 19365789747
RAC: 7921875

Application code can be

Application code can be agnostic for utilizing whatever SIMD instructions the cpu and OS support.  An example is the Asteroids@home cpu binary which is called a "universal" binary.  All SIMD instructions from SSE to AVX-512 supported.

Something like that app binary needs to be put in place here for the cpu applications.

 

mikey
mikey
Joined: 22 Jan 05
Posts: 12967
Credit: 1884538765
RAC: 13127

Keith Myers

Keith Myers wrote:

Application code can be agnostic for utilizing whatever SIMD instructions the cpu and OS support.  An example is the Asteroids@home cpu binary which is called a "universal" binary.  All SIMD instructions from SSE to AVX-512 supported.

Something like that app binary needs to be put in place here for the cpu applications. 

AND I wish it would be automatic to use it if a users CPU does not support the latest instructions. And with check box  on the Projects/Preferences page I wish it would be automatic to use it if a users CPU does not support the latest instructions. The check box would have a short explanation saying  that it could take a bit longer than if their CPU had AVX-512. ie if a user has the box checked on the Projects/Preferences page than the app will chose the best version for the cpu not just the latest one that could return errors.

Keith Myers
Keith Myers
Joined: 11 Feb 11
Posts: 5063
Credit: 19365789747
RAC: 7921875

The asteroids app uses the

The asteroids app uses the highest level SIMD instruction the cpu supports.  Always.

You would have to revert to explicit single level SIMD capable binaries with a very long list of each SIMD instruction level.

OR provide a app_config toggle to exclude AVX-512 instructions for example if a user decides to NOT use the AVX-512 capability of the universal app and only use the next highest level of AVX2 for example.

 

Ian&Steve C.
Ian&Steve C.
Joined: 19 Jan 20
Posts: 4160
Credit: 50546551541
RAC: 43202617

The asteroids app you can

The asteroids app you can pass a command line argument in app_config to select which instruction you want to use if you don’t want it to use the “best” one via its own detection. 

_________________________________________________________________________

JohnDK
JohnDK
Joined: 25 Jun 10
Posts: 122
Credit: 2687587322
RAC: 1475658

Ian&Steve C. skrev: The

Ian&Steve C. wrote:

The asteroids app you can pass a command line argument in app_config to select which instruction you want to use if you don’t want it to use the “best” one via its own detection. 

Which command line should I use to get the app to use AVX instead of FMA?

ahorek's team
ahorek's team
Joined: 16 Dec 05
Posts: 40
Credit: 249842190
RAC: 14613

AND I wish it would be

AND I wish it would be automatic to use it if a users CPU does not support the latest instructions. And with check box  on the Projects/Preferences page I wish it would be automatic to use it if a users CPU does not support the latest instructions. The check box would have a short explanation saying  that it could take a bit longer than if their CPU had AVX-512. ie if a user has the box checked on the Projects/Preferences page than the app will chose the best version for the cpu not just the latest one that could return errors.

The app should only use instruction sets supported by your CPU. It detects your CPU's capabilities, and if you attempt to run, for example, AVX-512 code on a CPU that doesn't support it, the app will crash due to an illegal instruction.

the latest one that could return errors

what do you mean? If the app crashes, it could be due to a bug, hardware failure, or overheating.

choosing a worse instruction set isn't something a regular user should do. There are a few exceptions:
* in some cases (depending on the app), on older Intels, the AVX512 code could perform worse due to more heat => lower clocks. Zen 4,5 don't have this issue.
* Zen 1 had some rare issues with FMA, and in certain cases, forcing AVX could resolve the problem.
* Bulldozer - due to their AVX/FMA implementations, using an older SSE3 may result in better performance (btw PG and asteroid apps do that by default)

some apps have an option to force the instruction set via param, for instance:
genefer -x avx
ap -cputype avx
asteroids --optimization 4

```
<app_config>
  <app_version>
    <app_name>period_search</app_name>
    <plan_class>win10</plan_class>
    <cmdline>--optimization 4</cmdline>
  </app_version>
</app_config>
```

However, this approach is mainly useful for testing and benchmarking. In 99% of cases, for optimal performance, you should always use the most efficient instruction set available, and at least the apps I mentioned handle this automatically.

ahorek's team
ahorek's team
Joined: 16 Dec 05
Posts: 40
Credit: 249842190
RAC: 14613

The app has to be tuned for

The app has to be tuned for newer instructions by the developer (via instincts or assembly) otherwise, it won’t achieve better performance even if your CPU supports them. Einstein apps include some AVX2 instructions but mainly rely on SSE assembly.

Ian&Steve C.
Ian&Steve C.
Joined: 19 Jan 20
Posts: 4160
Credit: 50546551541
RAC: 43202617

JohnDK wrote:Which command

JohnDK wrote:
Which command line should I use to get the app to use AVX instead of FMA?



<app_config>
<app_version>
<app_name>period_search</app_name>
<plan_class></plan_class>
<cmdline>--optimization 4</cmdline>
</app_version>
</app_config>


Optimizations:
1 = NONE
2 = SSE2
3 = SSE3
4 = AVX
5 = FMA
6 = AVX512

_________________________________________________________________________

Ian&Steve C.
Ian&Steve C.
Joined: 19 Jan 20
Posts: 4160
Credit: 50546551541
RAC: 43202617

ahorek's team wrote:However,

ahorek's team wrote:
However, this approach is mainly useful for testing and benchmarking. In 99% of cases, for optimal performance, you should always use the most efficient instruction set available, and at least the apps I mentioned handle this automatically.



I'm not sure if this is John's intention, or if this will be the case for Asteroids, but I have seen cases before that some users have wanted to use lesser optimization levels because the app wasnt much slower, but consumed less energy and produced less heat (by a factor greater than the loss in performance)

_________________________________________________________________________

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.