You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "hantao-zhou (via GitHub)" <gi...@apache.org> on 2025/10/25 07:33:23 UTC

[I] [Bug] MIsmatch of codegen precision [tvm]

hantao-zhou opened a new issue, #18395:
URL: https://github.com/apache/tvm/issues/18395

   Thanks for participating in the TVM community! We use https://discuss.tvm.ai for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking.  You are always welcomed to post on the forum first :smile_cat:
   
   Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed.
   
   ### Expected behavior
   
   What you were expecting
   The precision should have fallen within the limitations
   
   ### Actual behavior
   
   What actually happened
   
   (matopbench) hans@fedora:~/workspace/matopbench/src/matopbench/singleop$ python /home/hans/workspace/matopbench/external/tvm/tests/python/codegen/test_target_codegen_cuda.py
   enabled targets: llvm; cuda; nvptx
   pytest marker: 
   ===================================================================================================================================== test session starts ======================================================================================================================================
   platform linux -- Python 3.14.0, pytest-8.4.2, pluggy-1.6.0 -- /home/hans/workspace/matopbench/.pixi/envs/default/bin/python
   cachedir: .pytest_cache
   rootdir: /home/hans/workspace/matopbench/external/tvm
   configfile: pyproject.toml
   collected 27 items                                                                                                                                                                                                                                                                             
   
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_vectorize_add PASSED                                                                                                                                                                                   [  3%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_bf16_vectorize_add PASSED                                                                                                                                                                              [  7%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_multiply_add PASSED                                                                                                                                                                                    [ 11%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_vectorize_load PASSED                                                                                                                                                                                  [ 14%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_make_int8 FAILED                                                                                                                                                                                       [ 18%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_inf_nan PASSED                                                                                                                                                                                         [ 22%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_crossthread_reduction1[cuda] PASSED                                                                                                                                                                         [ 25%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_crossthread_reduction1[rocm] SKIPPED (No device exists for target rocm)                                                                                                                                     [ 29%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_crossthread_reduction2[cuda] PASSED                                                                                                                                                                         [ 33%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_crossthread_reduction2[rocm] SKIPPED (No device exists for target rocm)                                                                                                                                     [ 37%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_reduction_binding PASSED                                                                                                                                                                               [ 40%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_const_float_to_half PASSED                                                                                                                                                                             [ 44%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_floordiv_with_vectorization PASSED                                                                                                                                                                     [ 48%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_floormod_with_vectorization PASSED                                                                                                                                                                     [ 51%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_vectorized_casts FAILED                                                                                                                                                                                     [ 55%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_vectorized_intrin1 PASSED                                                                                                                                                                                   [ 59%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_vectorized_intrin2 PASSED                                                                                                                                                                                   [ 62%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_vectorized_popcount PASSED                                                                                                                                                                                  [ 66%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_vectorize_load_permute_pad PASSED                                                                                                                                                                      [ 70%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_try_unaligned_vector_load PASSED                                                                                                                                                                            [ 74%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_thread_sync_inside_condition PASSED                                                                                                                                                                    [ 77%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_invalid_reinterpret PASSED                                                                                                                                                                                  [ 81%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_tensormap PASSED                                                                                                                                                                                       [ 85%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_device_func_call PASSED                                                                                                                                                                                [ 88%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_float_const_hex_format PASSED                                                                                                                                                                          [ 92%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_device_host_call_same_func PASSED                                                                                                                                                                           [ 96%]
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_thread_return PASSED                                                                                                                                                                                        [100%]
   
   =========================================================================================================================================== FAILURES ===========================================================================================================================================
   _____________________________________________________________________________________________________________________________________ test_cuda_make_int8 ______________________________________________________________________________________________________________________________________
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py:205: in test_cuda_make_int8
       check_cuda(64, np.int8(0xAB), 4)
                      ^^^^^^^^^^^^^
   E   OverflowError: Python integer 171 out of bounds for int8
   ____________________________________________________________________________________________________________________________________ test_vectorized_casts _____________________________________________________________________________________________________________________________________
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py:474: in test_vectorized_casts
       check(t0, t1, 8)
   ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py:446: in check
       tvm.testing.assert_allclose(c_nd.numpy(), c_np, rtol=1e-3)
   ../../../external/tvm/python/tvm/testing/utils.py:118: in assert_allclose
       np.testing.assert_allclose(actual, desired, rtol=rtol, atol=atol, verbose=True)
   E   AssertionError: 
   E   Not equal to tolerance rtol=0.001, atol=1e-07
   E   
   E   Mismatched elements: 30 / 128 (23.4%)
   E   Max absolute difference among violations: 20
   E   Max relative difference among violations: 1.
   E    ACTUAL: array([ -3,   9,   0, -11, -14,  -2,   0,  -6, -10, -12,   0,   3,  -8,
   E           11,   0,  -1,  -3,  -5,   0,  -2,  -5, -15,   0,  -2, -16,  -9,
   E            0,   6,   3, -15,   0,  -4,   4,   3,   0,  -1,   4,   3,   0,...
   E    DESIRED: array([ -3,   9,   6, -11, -14,  -2,  -6,  -6, -10, -12, -11,   3,  -8,
   E           11,  -6,  -1,  -3,  -5,  13,  -2,  -5, -15,  -2,  -2, -16,  -9,
   E           -3,   6,   3, -15,   5,  -4,   4,   3,   9,  -1,   4,   3,  -1,...
   ======================================================================================================================================= warnings summary =======================================================================================================================================
   tests/python/codegen/test_target_codegen_cuda.py::test_cuda_floordiv_with_vectorization
   tests/python/codegen/test_target_codegen_cuda.py::test_cuda_floormod_with_vectorization
     /home/hans/workspace/matopbench/external/tvm/python/tvm/target/target.py:446: UserWarning: Try specifying cuda arch by adding 'arch=sm_xx' to your target.
       warnings.warn("Try specifying cuda arch by adding 'arch=sm_xx' to your target.")
   
   tests/python/codegen/test_target_codegen_cuda.py::test_vectorized_popcount
   tests/python/codegen/test_target_codegen_cuda.py::test_vectorized_popcount
     /home/hans/workspace/matopbench/external/tvm/tests/python/codegen/test_target_codegen_cuda.py:579: RuntimeWarning: overflow encountered in scalar negative
       x -= x & -x
   
   -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
   =================================================================================================================================== short test summary info ====================================================================================================================================
   FAILED ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_cuda_make_int8 - OverflowError: Python integer 171 out of bounds for int8
   FAILED ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda.py::test_vectorized_casts - AssertionError: 
   ===================================================================================================================== 2 failed, 23 passed, 2 skipped, 4 warnings in 34.83s =
   
   ### Environment
   
   Any environment details, such as: Operating System, TVM version, etc
   
   ### Steps to reproduce
   
   Preferably a minimal script to cause the issue to occur.
   
   ### Triage
   
   Please refer to the list of label tags [here](https://github.com/apache/tvm/wiki/Issue-Triage-Labels) to find the relevant tags and add them below in a bullet format (example below).
   
   * needs-triage
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] MIsmatch of codegen precision [tvm]

Posted by "hantao-zhou (via GitHub)" <gi...@apache.org>.
hantao-zhou closed issue #18395: [Bug] MIsmatch of codegen precision
URL: https://github.com/apache/tvm/issues/18395


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] MIsmatch of codegen precision [tvm]

Posted by "hantao-zhou (via GitHub)" <gi...@apache.org>.
hantao-zhou commented on issue #18395:
URL: https://github.com/apache/tvm/issues/18395#issuecomment-3446580534

   #18398 i have submitted the solution to this error, it is a bug related to the codegen source code


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org