Sebastianhayashi / eigen

0 stars 0 forks source link

Eigen `-march=rv64gc` 相关优化问题 #1

Open Sebastianhayashi opened 3 weeks ago

Sebastianhayashi commented 3 weeks ago

环境

硬件:lpi4a (TH1520) 软件:RevyOS 0721

问题描述

在启用了 -march=rv64gcv 参数后,遇到了 log 中的错误

log 过长,放在评论区中

若启用 -march=rv64gc 则可以正常跑测试

但目前观测到前两次批次的测试时间差异不大:

第一批次:

第二批次:

分析:

根据cat /proc/cpuinfo 输出结果,cpu-vector 字段为 0.7.1,表示支持 RISC-V 向量扩展,但版本是 0.7.1,这可能与一些现代编译器生成的指令集(如 v1.0)不完全兼容(需要更进一步调研)

debian@revyos-lpi4a:~$ cat /proc/cpuinfo
processor       : 0
hart            : 0
isa             : rv64imafdcvsu
mmu             : sv39
cpu-freq        : 1.848Ghz
cpu-icache      : 64KB
cpu-dcache      : 64KB
cpu-l2cache     : 1MB
cpu-tlb         : 1024 4-ways
cpu-cacheline   : 64Bytes
cpu-vector      : 0.7.1

processor       : 1
hart            : 1
isa             : rv64imafdcvsu
mmu             : sv39
cpu-freq        : 1.848Ghz
cpu-icache      : 64KB
cpu-dcache      : 64KB
cpu-l2cache     : 1MB
cpu-tlb         : 1024 4-ways
cpu-cacheline   : 64Bytes
cpu-vector      : 0.7.1

processor       : 2
hart            : 2
isa             : rv64imafdcvsu
mmu             : sv39
cpu-freq        : 1.848Ghz
cpu-icache      : 64KB
cpu-dcache      : 64KB
cpu-l2cache     : 1MB
cpu-tlb         : 1024 4-ways
cpu-cacheline   : 64Bytes
cpu-vector      : 0.7.1

processor       : 3
hart            : 3
isa             : rv64imafdcvsu
mmu             : sv39
cpu-freq        : 1.848Ghz
cpu-icache      : 64KB
cpu-dcache      : 64KB
cpu-l2cache     : 1MB
cpu-tlb         : 1024 4-ways
cpu-cacheline   : 64Bytes
cpu-vector      : 0.7.1
Sebastianhayashi commented 3 weeks ago
debian@revyos-lpi4a:~/build/bench/btl$ OMP_NUM_THREADS=4 ctest -V | tee -a eigen-10-29-16-37.log
UpdateCTestConfiguration  from :/home/debian/build/bench/btl/DartConfiguration.tcl
UpdateCTestConfiguration  from :/home/debian/build/bench/btl/DartConfiguration.tcl
Test project /home/debian/build/bench/btl
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
    Start 1: btl_eigen3_linear

1: Test command: /home/debian/build/bench/btl/libs/eigen3/btl_eigen3_linear
1: Working Directory: /home/debian/build/bench/btl/libs/eigen3
1: Test timeout computed to be: 10000000
1/8 Test #1: btl_eigen3_linear ................***Exception: Illegal  0.12 sec
test 2
    Start 2: btl_eigen3_vecmat

2: Test command: /home/debian/build/bench/btl/libs/eigen3/btl_eigen3_vecmat
2: Working Directory: /home/debian/build/bench/btl/libs/eigen3
2: Test timeout computed to be: 10000000
2/8 Test #2: btl_eigen3_vecmat ................***Exception: Illegal  0.12 sec
test 3
    Start 3: btl_eigen3_matmat

3: Test command: /home/debian/build/bench/btl/libs/eigen3/btl_eigen3_matmat
3: Working Directory: /home/debian/build/bench/btl/libs/eigen3
3: Test timeout computed to be: 10000000
3/8 Test #3: btl_eigen3_matmat ................***Exception: Illegal  0.12 sec
test 4
    Start 4: btl_eigen3_adv

4: Test command: /home/debian/build/bench/btl/libs/eigen3/btl_eigen3_adv
4: Working Directory: /home/debian/build/bench/btl/libs/eigen3
4: Test timeout computed to be: 10000000
4/8 Test #4: btl_eigen3_adv ...................***Exception: Illegal  0.12 sec
test 5
    Start 5: btl_tensor_linear

5: Test command: /home/debian/build/bench/btl/libs/tensors/btl_tensor_linear
5: Working Directory: /home/debian/build/bench/btl/libs/tensors
5: Test timeout computed to be: 10000000
5/8 Test #5: btl_tensor_linear ................***Exception: Illegal  0.12 sec
test 6
    Start 6: btl_tensor_vecmat

6: Test command: /home/debian/build/bench/btl/libs/tensors/btl_tensor_vecmat
6: Working Directory: /home/debian/build/bench/btl/libs/tensors
6: Test timeout computed to be: 10000000
6/8 Test #6: btl_tensor_vecmat ................***Exception: Illegal  0.01 sec
test 7
    Start 7: btl_tensor_matmat

7: Test command: /home/debian/build/bench/btl/libs/tensors/btl_tensor_matmat
7: Working Directory: /home/debian/build/bench/btl/libs/tensors
7: Test timeout computed to be: 10000000
7/8 Test #7: btl_tensor_matmat ................***Exception: Illegal  0.01 sec
test 8
    Start 8: btl_ublas

8: Test command: /home/debian/build/bench/btl/libs/ublas/btl_ublas
8: Working Directory: /home/debian/build/bench/btl/libs/ublas
8: Test timeout computed to be: 10000000
8/8 Test #8: btl_ublas ........................***Exception: Illegal  0.01 sec

0% tests passed, 8 tests failed out of 8

Total Test time (real) =   0.67 sec

The following tests FAILED:
          1 - btl_eigen3_linear (ILLEGAL)
          2 - btl_eigen3_vecmat (ILLEGAL)
          3 - btl_eigen3_matmat (ILLEGAL)
          4 - btl_eigen3_adv (ILLEGAL)
          5 - btl_tensor_linear (ILLEGAL)
          6 - btl_tensor_vecmat (ILLEGAL)
          7 - btl_tensor_matmat (ILLEGAL)
          8 - btl_ublas (ILLEGAL)
Errors while running CTest
Output from these tests are in: /home/debian/build/bench/btl/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
debian@revyos-lpi4a:~/build/bench/btl$ OMP_NUM_THREADS=4 ctest -V | tee -a eigen-10-29-16-37.log