Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Dec 3, 2024
1 parent bc4ec08 commit 8754523
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/linux-riscv64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,14 @@ jobs:
- uses: actions/checkout@v4

- name: configure
continue-on-error: true
run: |
export RISCV_ROOT_PATH=/data/action/osd/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V3.0.1
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/c906-v301.toolchain.cmake -DCMAKE_BUILD_TYPE=release -DNCNN_OPENMP=OFF -DNCNN_THREADS=OFF -DNCNN_RUNTIME_CPU=OFF -DNCNN_RVV=OFF -DNCNN_XTHEADVECTOR=ON -DNCNN_ZFH=ON -DNCNN_SIMPLEOCV=ON -DNCNN_BUILD_EXAMPLES=ON -DNCNN_BUILD_TESTS=ON ..
- name: build
continue-on-error: true
run: cmake --build build -j 8

- name: test
continue-on-error: true
run: |
export PATH=/data/action/osd/Xuantie-qemu-x86_64-Ubuntu-20.04-V5.0.4-B20241127-1130/bin:$PATH
cd build
Expand All @@ -110,17 +107,14 @@ jobs:
- uses: actions/checkout@v4

- name: configure
continue-on-error: true
run: |
export RISCV_ROOT_PATH=/data/action/osd/Xuantie-900-gcc-linux-6.6.0-glibc-x86_64-V3.0.1
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/c910-v301.toolchain.cmake -DCMAKE_BUILD_TYPE=release -DNCNN_OPENMP=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_RVV=OFF -DNCNN_XTHEADVECTOR=ON -DNCNN_ZFH=ON -DNCNN_SIMPLEOCV=ON -DNCNN_BUILD_EXAMPLES=ON -DNCNN_BUILD_TESTS=ON ..
- name: build
continue-on-error: true
run: cmake --build build -j 8

- name: test
continue-on-error: true
run: |
export PATH=/data/action/osd/Xuantie-qemu-x86_64-Ubuntu-20.04-V5.0.4-B20241127-1130/bin:$PATH
cd build
Expand Down
1 change: 1 addition & 0 deletions src/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2752,6 +2752,7 @@ int cpu_support_riscv_xtheadvector()
int cpu_riscv_vlenb()
{
#if C906
// FIXME xuantie qemu reports all zero auxv flags
return 16;
#endif
try_initialize_global_cpu_info();
Expand Down
9 changes: 9 additions & 0 deletions src/layer/riscv/gelu_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ int GELU_riscv::forward_inplace(Mat& bottom_top_blob, const Option& opt) const
{
float* ptr = bottom_top_blob.channel(q);

#if C906
// FIXME -O3 leads illegal instruction
for (int i = 0; i < size; i++)
{
// y = x * P(X <= x) where X ~ N(0, 1)
ptr[i] = 0.5f * ptr[i] * erfcf(-0.70710678f * ptr[i]);
}
#else
int n = size;
while (n > 0)
{
Expand All @@ -91,6 +99,7 @@ int GELU_riscv::forward_inplace(Mat& bottom_top_blob, const Option& opt) const
n -= vl;
ptr += vl;
}
#endif
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/layer/riscv/selu_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ namespace ncnn {

int SELU_riscv::forward_inplace(Mat& bottom_top_blob, const Option& opt) const
{
#if C906
// FIXME -O3 leads illegal instruction
return SELU::forward_inplace(bottom_top_blob, opt);
#endif

int w = bottom_top_blob.w;
int h = bottom_top_blob.h;
int d = bottom_top_blob.d;
Expand Down

0 comments on commit 8754523

Please sign in to comment.