legacy codegen: four kinds of rank-1 tensor arithmetic fail, also for f32
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start with the legacy AST code generator (--legacy-codegen) and the failing cases described in the issue. Read tests/backend/pass/arithmetic_on_borrowed_half_tensors.vx and its REQUIRES: flat-codegen annotation, then compare the legacy and default code generator behavior for the four rank-1 arithmetic cases. Done means all four cases verify and produce the expected values, including with f32 tensors.
Written by the indexing model from the issue text.
Description
The AST code generator (--legacy-codegen) fails on four kinds of rank-1 tensor arithmetic. The default code generator prints the right value for each of them. Each one also fails with f32 tensors, so the cause is not the half types.
-
A whole tensor and a scalar:
let mut a = Tensor<f32, [2]>::new(); a[0] = 2048.0; let s : f32 = 1.0; let c : Tensor<f32, [2]> = a + s;Warning: Falling back to bitcast from f32 to memref<?xf32>, and then MLIR verification fails. -
Two whole tensors of different element types, such as an f16 tensor plus an f32 tensor. The result is an f32 tensor:
'memref.cast' op operand type 'memref<?xf32>' and result type 'memref<?xf16>' are cast incompatible -
Two borrowed tensors,
let c = &a + &b;:'memref.dim' op operand #0 must be unranked.memref of any type values or non-0-ranked.memref of any type values, but got 'memref<memref<?xf32>>' -
A
letthat holds an operation on two rows, followed by an index into it:let r : Tensor<f32, [2]> = o[0] + o[1]; println!("{}", r[0]);'memref.load' op operand #0 must be memref of any type values, but got 'vector<2xf32>'
tests/backend/pass/arithmetic_on_borrowed_half_tensors.vx has REQUIRES: flat-codegen because of the third case.
Found while working on #3267.
- Dominant language
- Rust
- Stars
- 35
- Forks
- 5
- Avg merge
- 12h 26m
- Merged PRs (30d)
- 799
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
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 vx-lang/Vx
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
bug testing
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
`pub struct` gives "Expected 'fn' after 'pub'": the error should say that a struct needs no `pub`Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug devex
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
longbridge/gpui-kit#4031 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
neuralmagic/crucible#465 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
compiler P3
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
HerringtonDarkholme/hd-lang#2162 ·
Maintainers usually reply within 1 day
-
embedded SQL: pin correlated-guard behaviour when a closed variable is reassigned inside a branchOpenpriority: low
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
jonathanong/no-mistakes#3627 ·
Maintainers usually reply within 1 day