Skip to content

[Bug] The test scripts tries to tell numpy a dtype name that it cannot recognise. #18394

@hantao-zhou

Description

@hantao-zhou

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 😸

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 test scripts should work fine, but no

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_fp4.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 3 items

../../../external/tvm/tests/python/codegen/test_target_codegen_cuda_fp4.py::test_e2m1_vector_conversions[float32x2] FAILED [ 33%]
../../../external/tvm/tests/python/codegen/test_target_codegen_cuda_fp4.py::test_e2m1_vector_conversions[float16x2] FAILED [ 66%]
../../../external/tvm/tests/python/codegen/test_target_codegen_cuda_fp4.py::test_e2m1_dequantize PASSED [100%]

=========================================================================================================================================== FAILURES ===========================================================================================================================================
___________________________________________________________________________________________________________________________ test_e2m1_vector_conversions[float32x2] ____________________________________________________________________________________________________________________________
../../../external/tvm/tests/python/codegen/test_target_codegen_cuda_fp4.py:78: in test_e2m1_vector_conversions
a_np = np.random.uniform(low=0, high=5, size=np_shape).astype(numpytype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E TypeError: data type 'float4_e2m1fn' not understood
___________________________________________________________________________________________________________________________ test_e2m1_vector_conversions[float16x2] ____________________________________________________________________________________________________________________________
../../../external/tvm/tests/python/codegen/test_target_codegen_cuda_fp4.py:78: in test_e2m1_vector_conversions
a_np = np.random.uniform(low=0, high=5, size=np_shape).astype(numpytype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E TypeError: data type 'float4_e2m1fn' not understood
=================================================================================================================================== short test summary info ====================================================================================================================================
FAILED ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda_fp4.py::test_e2m1_vector_conversions[float32x2] - TypeError: data type 'float4_e2m1fn' not understood
FAILED ../../../external/tvm/tests/python/codegen/test_target_codegen_cuda_fp4.py::test_e2m1_vector_conversions[float16x2] - TypeError: data type 'float4_e2m1fn' not understood
================================================================================================================================= 2 failed, 1 passed in 1.72s ==================================================================================================================================
(matopbench) hans@fedora:~/workspace/matopbench/src/matopbench/singleop$

Environment

Any environment details, such as: Operating System, TVM version, etc
linux fedora
TVM from source version

Steps to reproduce

Preferably a minimal script to cause the issue to occur.
Just install and try to run the test codegen

Triage

Please refer to the list of label tags here to find the relevant tags and add them below in a bullet format (example below).

  • needs-triage

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triagePRs or issues that need to be investigated by maintainers to find the right assignees to address ittype: bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions