Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dividing by zero and assertion, and add test-blas0 in make test on x86_64 #62

Closed
wants to merge 3 commits into from

Conversation

katsu560
Copy link
Contributor

@katsu560 katsu560 commented Apr 2, 2023

After gq merged to master, make test failed by exception by zero dividing and assertion.
It caused by cgraph->n_threads is zero in ggml.c ggml_graph_compute().
and assertion is GGML_ASSERT(!ggml_is_transposed(a)); in ggml_mul_mat().

And test-blas0 is tested on x86_64 system with using OpenBLAS, but make test is failed.
I fixed tests/CMakeLists.txt to do test-blas0 with command line options '0 0 0'.

test3 is too slow on my old 4-cored PC with running 8 threads setting.
So, n_threads parameter is changed by GGML_NTHREADS or command line option.
It changes test3 time from 50.10sec to 2.35sec.

before:

$ GGML_NLOOP=1 GGML_NTHREADS=4 make test
Running tests...
Test project /home/user/github/gpt/ggml/build
      Start  1: test-vec0
 1/11 Test  #1: test-vec0 ........................   Passed    4.11 sec
      Start  2: test-vec1
 2/11 Test  #2: test-vec1 ........................   Passed   12.14 sec
      Start  3: test-grad0
 3/11 Test  #3: test-grad0 .......................***Exception: Numerical  2.20 sec
      Start  4: test-mul-mat0
 4/11 Test  #4: test-mul-mat0 ....................Subprocess aborted***Exception:   2.09 sec
      Start  5: test-blas0
 5/11 Test  #5: test-blas0 .......................***Failed    2.15 sec
      Start  6: test-mul-mat2
 6/11 Test  #6: test-mul-mat2 ....................   Passed    4.68 sec
      Start  7: test0
 7/11 Test  #7: test0 ............................   Passed    2.17 sec
      Start  8: test1
 8/11 Test  #8: test1 ............................***Exception: Numerical  2.18 sec
      Start  9: test2
 9/11 Test  #9: test2 ............................   Passed    7.26 sec
      Start 10: test3
10/11 Test #10: test3 ............................Subprocess aborted***Exception:   2.30 sec
      Start 11: test-svd0
11/11 Test #11: test-svd0 ........................   Passed    2.11 sec

55% tests passed, 5 tests failed out of 11

Total Test time (real) =  43.44 sec

The following tests FAILED:
          3 - test-grad0 (NUMERICAL)
          4 - test-mul-mat0 (Subprocess aborted)
          5 - test-blas0 (Failed)
          8 - test1 (NUMERICAL)
         10 - test3 (Subprocess aborted)
Errors while running CTest
Output from these tests are in: /home/user/github/gpt/ggml/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
Makefile:70: recipe for target 'test' failed
make: *** [test] Error 8

after:

$ GGML_NLOOP=1 GGML_NTHREADS=4 make test
Running tests...
Test project /home/user/github/gpt/ggml/build
      Start  1: test-vec0
 1/11 Test  #1: test-vec0 ........................   Passed    4.00 sec
      Start  2: test-vec1
 2/11 Test  #2: test-vec1 ........................   Passed   11.85 sec
      Start  3: test-grad0
 3/11 Test  #3: test-grad0 .......................   Passed    2.40 sec
      Start  4: test-mul-mat0
 4/11 Test  #4: test-mul-mat0 ....................   Passed    2.42 sec
      Start  5: test-blas0
 5/11 Test  #5: test-blas0 .......................   Passed    2.80 sec
      Start  6: test-mul-mat2
 6/11 Test  #6: test-mul-mat2 ....................   Passed    4.89 sec
      Start  7: test0
 7/11 Test  #7: test0 ............................   Passed    2.45 sec
      Start  8: test1
 8/11 Test  #8: test1 ............................   Passed    2.27 sec
      Start  9: test2
 9/11 Test  #9: test2 ............................   Passed    7.16 sec
      Start 10: test3
10/11 Test #10: test3 ............................   Passed    2.35 sec
      Start 11: test-svd0
11/11 Test #11: test-svd0 ........................   Passed    2.31 sec

100% tests passed, 0 tests failed out of 11

Total Test time (real) =  44.95 sec

please confirm this pull request.

@ggerganov
Copy link
Owner

Pushed an alternative fix 216b172

@ggerganov ggerganov closed this Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants