EleutherAI/delphi

`plotly` dependency not declared and can't find a working version

Closed this issue · 2 comments

vgel commented

When I try to run the command in the repo, I get an error about missing plotly. (Using uv pip in a venv, but I don't think that makes a difference?)

(venv) $ uv pip install -e .
Using Python 3.10.12 environment at: venv                                                          
Resolved 164 packages in 478ms                                                                     
Installed 164 packages in 281ms                                                                    
# snip, but plotly was not installed
    
(venv) $ python -m delphi meta-llama/Meta-Llama-3-8B EleutherAI/sae-l
lama-3-8b-32x --explainer_model 'hugging-quants/Meta-Llama-3.1-70B-Instruct-AWQ-INT4' --dataset_rep
o 'EleutherAI/fineweb-edu-dedup-10b' --dataset_split 'train[:1%]' --n_tokens 10_000_000 --max_latents 100 --hookpoints layers.5 --filter_bos --name llama-3-8B                                        
Triton not installed, using eager implementation of sparse decoder.                                
Traceback (most recent call last):                                                                   File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main                            
    return _run_code(code, main_globals, None,                                                       File "/usr/lib/python3.10/runpy.py", line 86, in _run_code                                       
    exec(code, run_globals)                                                                          File "/home/ubuntu/delphi/delphi/__main__.py", line 26, in <module>                                  from delphi.log.result_analysis import log_results                                               File "/home/ubuntu/delphi/delphi/log/result_analysis.py", line 6, in <module>                    
    import plotly.express as px
ModuleNotFoundError: No module named 'plotly'

I tried to install a few different versions of plotly (most recent, <6.0.0, 5.3.x, 5.4.x) but no matter what I tried I kept getting this error about MathJax:

(venv) $ python -m delphi meta-llama/Meta-Llama-3-8B EleutherAI/sae-llama-3-8b-32x --explainer_model 'hugging-quants/Meta-Llama-3.1-70B-Instruct-AWQ-INT4' --dataset_repo 'EleutherAI/fineweb-edu-dedup-10b' --dataset_split 'train[:1%]' --n_tokens 10_000_000 --max_latents 100 --hookpoints layers.5 --filter_bos --name llama-3-8B
Triton not installed, using eager implementation of sparse decoder.
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/ubuntu/delphi/delphi/__main__.py", line 26, in <module>
    from delphi.log.result_analysis import log_results
  File "/home/ubuntu/delphi/delphi/log/result_analysis.py", line 10, in <module>
    pio.kaleido.scope.mathjax = None  # https://github.com/plotly/plotly.py/issues/3469
AttributeError: 'NoneType' object has no attribute 'mathjax'

I eventually fixed it by commenting out the log_results import in __main__.py because I'm not using verbose mode anyways.

I think there was an overlook in the requirements that we probably want to fix @luciaquirke. Maybe @neverix can look into it this weekend? I'm only on my pc Monday.

It seems Kaleido updated its API and Plotly is in the process of migrating to the new one. When the Kaleido version is wrong, it fails to create a PlotlyScope object and create a scope for consumption by Plotly. Fixing kaleido==0.2.1 seems to fix this.