[proposal] Add syntax for expressing priority of FMV target expressions
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
The issue names no implementation files, tests, or entry points. Start by reviewing the proposed target_clone and target_version syntax and the two priority approaches; done means agreeing on a concrete syntax and priority rules, then identifying implementation and test locations.
Written by the indexing model from the issue text.
Description
Summary
This proposal adds support for explicitly expressing the priority of function versions, in the target strings.
Example use case
For the case below, the default ordering has the sve feature as higher priority then dotprod, meaning for a target with both sve and dotprod the sve version would be selected. However, it may be that the dotprod version should be priority in this case.
typedef struct {
int x;
int y;
int z;
int w;
} Vec4;
[[target_clone("default", "sve")]]
Vec4 dotproduct (Vec4 a, Vec4 b)
{
// do a dot product
}
[[target_version("dotprod")]]
Vec4 dotproduct (Vec4 a, Vec4 b)
{
// Use dotprod intrinsics
}
Motivation
This enhancement was a natural result of considering the version priority rules. In specifying the default ordering, cases such as above, arose where the default priority rules would be a poor choice.
Possible solutions
There are several ways to solve this.
1. Add dummy features "priorityA", "priorityB", ...,
These features would have no effect on the versioned function, other than to change how they are ordered.
These versions would be higher priority than any other feature, so would override any default ordering.
Then the above would be:
typedef struct {
int x;
int y;
int z;
int w;
} Vec4;
[[target_clone("default", "sve")]]
Vec4 dotproduct (Vec4 a, Vec4 b)
{
// do a dot product
}
[[target_version("dotprod+priorityA")]]
Vec4 dotproduct (Vec4 a, Vec4 b)
{
// Use dotprod intrinsics
}
Could also use "priority1", "priority2", ...
This is similar to what was done for other targets (https://github.com/riscv-non-isa/riscv-c-api-doc/pull/85/files).
2. Label all the versions of a function
Another option is too support explicitly stating the order of all versions.
Something like:
typedef struct {
int x;
int y;
int z;
int w;
} Vec4;
[[target_clone("P3:default", "P2:sve")]]
Vec4 dotproduct (Vec4 a, Vec4 b)
{
// do a dot product
}
[[target_version("P1:dotprod")]]
Vec4 dotproduct (Vec4 a, Vec4 b)
{
// Use dotprod intrinsics
}
This seems like it introduces many more edge cases and complexity over suggestion 1 with little gain other than explicitness.
- Dominant language
- Python
- Stars
- 129
- Forks
- 77
- Avg merge
- 8d 12h
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ARM-software/acle
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ARM-software/acle#464 · 1 comment ·
-
[BUG] Reinterpret cast (vreinterpret*) table has 10 missing rows and 2 incorrect rows for AArch32Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ARM-software/acle#442 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
ARM-software/acle#463 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ARM-software/acle#436 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 48/100
ARM-software/acle#426 ·
All issues in ARM-software/acle
Similar issues
-
Zero-token evaluations are treated as missing cost in selectionPossibly taken @sylvesterkaczmarek claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
google-research/rrsi#6 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
aws-samples/sample-aws-genai-db-modernizer#294 ·
Maintainers usually reply within 1 day
-
feedback simulation workshop
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
githubnext/gh-aw-workshop#4174 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
WingedGuardian/GENesis-AGI#2852 ·
Maintainers usually reply within 1 day
-
camlight produces degenerate target camera and light framesPossibly taken @kavyabhand claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google-deepmind/mujoco_warp#1743 ·
Maintainers usually reply within 1 day