NVIDIA/numbast

Error when running tests after a fresh install

Open

#164 创建于 2025年7月31日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)C (22 fork)github user discovery
good first issue

仓库指标

Star
 (62 star)
PR 合并指标
 (PR 指标待抓取)

描述

I'm encountering errors when I run tests after following the installation instructions as described in the readme. Here are the commands I'm running:

conda env create -f conda/environment.yaml
conda activate numbast
bash ast_canopy/build.sh
pip install numbast/
pytest ast_canopy/ numbast/

These are the errors:

_______________________________________________________________________________ ERROR collecting numbast/benchmarks/test_arithmetic.py ________________________________________________________________________________
ImportError while importing test module '/tmp/numbast/numbast/benchmarks/test_arithmetic.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/home/lakshayg/miniconda3/envs/numbast_tmp/lib/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
numbast/benchmarks/test_arithmetic.py:5: in <module>
    from numbast_extensions.bf16 import nv_bfloat16, get_shims
E   ModuleNotFoundError: No module named 'numbast_extensions'
___________________________________________________________________________________ ERROR collecting numbast/tests/test_version.py ____________________________________________________________________________________
import file mismatch:
imported module 'test_version' has this __file__ attribute:
  /tmp/numbast/ast_canopy/tests/test_version.py
which is not the same as the test file we want to collect:
  /tmp/numbast/numbast/tests/test_version.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules

One of them can be resolved the running pip install numbast_extensions/

The other one is because there are two files named test_version.py

$ find . -name test_version.py
./numbast/tests/test_version.py
./ast_canopy/tests/test_version.py

Renaming one of them solves the issue

贡献者指南