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

[Bug] RuntimeError: Boolean value of Tensor with more than one value is ambiguous #17

Open
ChenMnZ opened this issue Aug 10, 2024 · 3 comments

Comments

@ChenMnZ
Copy link

ChenMnZ commented Aug 10, 2024

I strictly follow the instruction of environment installation. However, when I run the following command:

python -m lmquant.llm.run configs/llm.yaml configs/qoq/gchn.yaml --model-name llama2-7b --smooth-xw-alpha 0 --smooth-xw-beta 1

I still meet the following error:

  File "/cpfs01/user/chenmengzhao/efficientqat_repo/lmquant/lmquant/llm/run.py", line 276, in <module>
    run(config)
  File "/cpfs01/user/chenmengzhao/efficientqat_repo/lmquant/lmquant/llm/run.py", line 155, in run
    smooth_llm(model, config.quant, smooth_cache=torch.load(config.cache_path.smooth))
  File "/cpfs01/user/chenmengzhao/anaconda3/envs/lmquant/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/cpfs01/user/chenmengzhao/efficientqat_repo/lmquant/lmquant/llm/quant/smooth.py", line 189, in smooth_llm
    smooth_cache = smooth_cache or {}
                   ^^^^^^^^^^^^^^^^^^
RuntimeError: Boolean value of Tensor with more than one value is ambiguous
@xpq-tech
Copy link

xpq-tech commented Sep 1, 2024

Have you solved it? I also encountered this problem.

@ChenMnZ
Copy link
Author

ChenMnZ commented Sep 2, 2024

@xpq-tech I still not know how to solve this problem.

@JamesTheZ
Copy link

Had a similar problem and solved by downgrading the transformer version to 4.42.0.

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

No branches or pull requests

3 participants