HandH1998 / QQQ

QQQ is an innovative and hardware-optimized W4A8 quantization solution for LLMs.
https://arxiv.org/pdf/2406.09904
91 stars 8 forks source link

smooth.py报错 #8

Closed darrenearl closed 2 months ago

darrenearl commented 3 months ago

我在执行代码的时候,出现了以下报错,请问是库的版本的问题吗?

Traceback (most recent call last):
  File "/home/wsy/hdd/greenbit/QQQ-main/examples/quant_model.py", line 88, in <module>
    main()
  File "/home/wsy/anaconda3/envs/qqq/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/wsy/hdd/greenbit/QQQ-main/examples/quant_model.py", line 61, in main
    scale_list = smooth(model, tokenizer, q_config, args)
  File "/home/wsy/anaconda3/envs/qqq/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/wsy/hdd/greenbit/QQQ-main/QQQ/smooth/smooth.py", line 114, in smooth
    cali_data = prepare_data(
  File "/home/wsy/hdd/greenbit/QQQ-main/QQQ/smooth/smooth.py", line 75, in prepare_data
    return cali_data
UnboundLocalError: local variable 'cali_data' referenced before assignment
HandH1998 commented 3 months ago

@darrenearl You should modify the entry calibrate_path to your cali_data path in https://github.com/HandH1998/QQQ/blob/main/quant_config/llama/w4a8-pergroup.yaml.